domain.fetcher.ports.email
Summary
Email fetcher: pull statement messages from Gmail and convert them to omniread content.
Classes
EmailFetcher
Fetch emails through Gmail and convert each message to :class:Content.
Notes
Lifecycle: Construction performs OAuth credential resolution once; a missing or expired token is refreshed automatically by the credential store.
Initialize the Gmail-backed email reader.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
credentials_path |
str
|
Path to the OAuth client credentials JSON. |
required |
token_path |
str
|
Path to the persisted OAuth token pickle. |
required |
scopes |
List[str]
|
OAuth scopes to request. |
required |
Functions
fetch
Return every message matching the Gmail query as content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query |
str
|
Gmail search query, e.g. |
required |
Returns:
| Type | Description |
|---|---|
List[Content]
|
List[Content]: HTML content per matching message. |