chore(release): 0.0.3
Squash-merge lib-standardisation: adopt repo standards across packaging, tooling, docs, and CI. - standardize pyproject.toml (canonical packaging, lint config, extras, GSDFC pydoclint) - add py.typed marker, modernize type hints and Google-style docstrings - nest generated docs under docs/lib and docs/mcp; add hand-written wiki - adopt standard Type A PyPI CI pipeline (tag==version guard + quality gate) - promote generated CHANGELOG.md; bump version to 0.0.3
This commit is contained in:
@@ -16,16 +16,17 @@ It coordinates:
|
||||
No provider-specific logic or API semantics are permitted in this layer.
|
||||
"""
|
||||
|
||||
from collections.abc import Iterator
|
||||
from datetime import datetime
|
||||
from typing import Iterator, Dict, Any
|
||||
from typing import Any
|
||||
|
||||
from mail_intake.adapters.base import MailIntakeAdapter
|
||||
from mail_intake.exceptions import MailIntakeParsingError
|
||||
from mail_intake.models.message import MailIntakeMessage
|
||||
from mail_intake.models.thread import MailIntakeThread
|
||||
from mail_intake.parsers.headers import parse_headers, extract_sender
|
||||
from mail_intake.parsers.body import extract_body
|
||||
from mail_intake.parsers.headers import extract_sender, parse_headers
|
||||
from mail_intake.parsers.subject import normalize_subject
|
||||
from mail_intake.exceptions import MailIntakeParsingError
|
||||
|
||||
|
||||
class MailIntakeReader:
|
||||
@@ -87,9 +88,9 @@ class MailIntakeReader:
|
||||
query (str):
|
||||
Provider-specific query string used to filter messages.
|
||||
|
||||
Yields:
|
||||
MailIntakeThread:
|
||||
An iterator of `MailIntakeThread` instances.
|
||||
Returns:
|
||||
Iterator[MailIntakeThread]:
|
||||
An iterator over `MailIntakeThread` instances.
|
||||
|
||||
Raises:
|
||||
`MailIntakeParsingError`:
|
||||
@@ -101,7 +102,7 @@ class MailIntakeReader:
|
||||
- Messages are grouped by `thread_id` and yielded as complete
|
||||
thread objects containing all associated messages.
|
||||
"""
|
||||
threads: Dict[str, MailIntakeThread] = {}
|
||||
threads: dict[str, MailIntakeThread] = {}
|
||||
|
||||
for ref in self._adapter.iter_message_refs(query):
|
||||
raw = self._adapter.fetch_message(ref["message_id"])
|
||||
@@ -119,12 +120,12 @@ class MailIntakeReader:
|
||||
|
||||
return iter(threads.values())
|
||||
|
||||
def _parse_message(self, raw_message: Dict[str, Any]) -> MailIntakeMessage:
|
||||
def _parse_message(self, raw_message: dict[str, Any]) -> MailIntakeMessage:
|
||||
"""
|
||||
Parse a raw provider message into a `MailIntakeMessage`.
|
||||
|
||||
Args:
|
||||
raw_message (Dict[str, Any]):
|
||||
raw_message (dict[str, Any]):
|
||||
Provider-native message payload.
|
||||
|
||||
Returns:
|
||||
|
||||
Reference in New Issue
Block a user