updated mcp
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-03-08 17:57:34 +05:30
parent 9191de9dff
commit 0e49f02c4c
167 changed files with 7632 additions and 98942 deletions

View File

@@ -1320,9 +1320,8 @@
<div class="doc doc-contents first">
<p>Mail provider adapter contracts for Mail Intake.</p>
<hr />
<h4 id="mail_intake.adapters.base--summary">Summary</h4>
<h3 id="mail_intake.adapters.base--summary">Summary</h3>
<p>Mail provider adapter contracts for Mail Intake.</p>
<p>This module defines the <strong>provider-agnostic adapter interface</strong> used for
read-only mail ingestion.</p>
<p>Adapters encapsulate all provider-specific access logic and expose a
@@ -1364,12 +1363,12 @@ types or semantics should leak beyond implementations of this interface.</p>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- discover messages matching a query
- retrieve full message payloads
- retrieve full thread payloads
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Discover messages matching a query.
- Retrieve full message payloads.
- Retrieve full thread payloads.
</code></pre></div></td></tr></table></div>
<p><strong>Lifecycle:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- adapters are intentionally read-only and must not mutate provider state
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Adapters are intentionally read-only and must not mutate provider state.
</code></pre></div></td></tr></table></div>
</details>
@@ -1613,21 +1612,23 @@ Dictionaries containing message and thread identifiers.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Implementations must yield dictionaries containing at least
`message_id` and `thread_id`.
</code></pre></div></td></tr></table></div>
</details>
<details class="example" open>
<summary>Example</summary>
<p>Typical yield:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>{
&quot;message_id&quot;: &quot;...&quot;,
&quot;thread_id&quot;: &quot;...&quot;
}
</code></pre></div></td></tr></table></div>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span>
<span class="normal"><a href="#__codelineno-0-2">2</a></span>
<span class="normal"><a href="#__codelineno-0-3">3</a></span>
<span class="normal"><a href="#__codelineno-0-4">4</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="p">{</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2"></a> <span class="s2">&quot;message_id&quot;</span><span class="p">:</span> <span class="s2">&quot;...&quot;</span><span class="p">,</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3"></a> <span class="s2">&quot;thread_id&quot;</span><span class="p">:</span> <span class="s2">&quot;...&quot;</span>
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4"></a><span class="p">}</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1368,15 +1368,16 @@
<div class="doc doc-contents first">
<p>Gmail adapter implementation for Mail Intake.</p>
<hr />
<h4 id="mail_intake.adapters.gmail--summary">Summary</h4>
<h3 id="mail_intake.adapters.gmail--summary">Summary</h3>
<p>Gmail adapter implementation for Mail Intake.</p>
<p>This module provides a <strong>Gmail-specific implementation</strong> of the
<code>MailIntakeAdapter</code> contract.</p>
<p>It is the only place in the codebase where:
- <code>googleapiclient</code> is imported
- Gmail REST API semantics are known
- Low-level <code>.execute()</code> calls are made</p>
<p>It is the only place in the codebase where:</p>
<ul>
<li><code>googleapiclient</code> is imported.</li>
<li>Gmail REST API semantics are known.</li>
<li>Low-level <code>.execute()</code> calls are made.</li>
</ul>
<p>All Gmail-specific behavior must be strictly contained within this module.</p>
@@ -1404,7 +1405,7 @@
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.adapters.base.MailIntakeAdapter" href="../../mail_intake/adapters/base/#mail_intake.adapters.base.MailIntakeAdapter">MailIntakeAdapter</a></code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.adapters.base.MailIntakeAdapter" href="../base/#mail_intake.adapters.base.MailIntakeAdapter">MailIntakeAdapter</a></code></p>
<p>Gmail read-only adapter.</p>
@@ -1418,16 +1419,16 @@ Gmail-specific API calls.</p>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is the ONLY place where googleapiclient is imported
- Gmail REST semantics are known
- .execute() is called
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is the ONLY place where `googleapiclient` is imported.
- Gmail REST semantics are known.
- `.execute()` is called.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Must remain thin and imperative
- Must not perform parsing or interpretation
- Must not expose Gmail-specific types beyond this class
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Must remain thin and imperative.
- Must not perform parsing or interpretation.
- Must not expose Gmail-specific types beyond this class.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize the Gmail adapter.</p>
@@ -1447,7 +1448,7 @@ Gmail-specific API calls.</p>
<tr class="doc-section-item">
<td><code>auth_provider</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.auth.base.MailIntakeAuthProvider" href="../../mail_intake/auth/base/#mail_intake.auth.base.MailIntakeAuthProvider">MailIntakeAuthProvider</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.auth.base.MailIntakeAuthProvider" href="../../auth/base/#mail_intake.auth.base.MailIntakeAuthProvider">MailIntakeAuthProvider</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1541,7 +1542,7 @@ Gmail-specific API calls.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../../exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1637,7 +1638,7 @@ Provider-native Gmail message payload.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../../exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1732,7 +1733,7 @@ Provider-native Gmail thread payload.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../../exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1827,7 +1828,7 @@ Dictionaries containing <code>message_id</code> and <code>thread_id</code>.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../../exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
</td>
<td>
<div class="doc-md-description">

View File

@@ -1272,26 +1272,27 @@
<div class="doc doc-contents first">
<p>Mail provider adapter implementations for Mail Intake.</p>
<hr />
<h4 id="mail_intake.adapters--summary">Summary</h4>
<h3 id="mail_intake.adapters--summary">Summary</h3>
<p>Mail provider adapter implementations for Mail Intake.</p>
<p>This package contains <strong>adapter-layer implementations</strong> responsible for
interfacing with external mail providers and exposing a normalized,
provider-agnostic contract to the rest of the system.</p>
<p>Adapters in this package:
- Implement the <code>MailIntakeAdapter</code> interface
- Encapsulate all provider-specific APIs and semantics
- Perform read-only access to mail data
- Return provider-native payloads without interpretation</p>
<p>Adapters in this package:</p>
<ul>
<li>Implement the <code>MailIntakeAdapter</code> interface.</li>
<li>Encapsulate all provider-specific APIs and semantics.</li>
<li>Perform read-only access to mail data.</li>
<li>Return provider-native payloads without interpretation.</li>
</ul>
<p>Provider-specific logic <strong>must not leak</strong> outside of adapter implementations.
All parsings, normalizations, and transformations must be handled by downstream
components.</p>
<hr />
<h4 id="mail_intake.adapters--public-api">Public API</h4>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>MailIntakeAdapter
MailIntakeGmailAdapter
</code></pre></div></td></tr></table></div>
<h3 id="mail_intake.adapters--public-api">Public API</h3>
<ul>
<li><code>MailIntakeAdapter</code></li>
<li><code>MailIntakeGmailAdapter</code></li>
</ul>
<hr />
@@ -1329,12 +1330,12 @@ MailIntakeGmailAdapter
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- discover messages matching a query
- retrieve full message payloads
- retrieve full thread payloads
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Discover messages matching a query.
- Retrieve full message payloads.
- Retrieve full thread payloads.
</code></pre></div></td></tr></table></div>
<p><strong>Lifecycle:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- adapters are intentionally read-only and must not mutate provider state
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Adapters are intentionally read-only and must not mutate provider state.
</code></pre></div></td></tr></table></div>
</details>
@@ -1578,21 +1579,23 @@ Dictionaries containing message and thread identifiers.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Implementations must yield dictionaries containing at least
`message_id` and `thread_id`.
</code></pre></div></td></tr></table></div>
</details>
<details class="example" open>
<summary>Example</summary>
<p>Typical yield:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>{
&quot;message_id&quot;: &quot;...&quot;,
&quot;thread_id&quot;: &quot;...&quot;
}
</code></pre></div></td></tr></table></div>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span>
<span class="normal"><a href="#__codelineno-0-2">2</a></span>
<span class="normal"><a href="#__codelineno-0-3">3</a></span>
<span class="normal"><a href="#__codelineno-0-4">4</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="p">{</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2"></a> <span class="s2">&quot;message_id&quot;</span><span class="p">:</span> <span class="s2">&quot;...&quot;</span><span class="p">,</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3"></a> <span class="s2">&quot;thread_id&quot;</span><span class="p">:</span> <span class="s2">&quot;...&quot;</span>
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4"></a><span class="p">}</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>
@@ -1620,7 +1623,7 @@ Dictionaries containing message and thread identifiers.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.adapters.base.MailIntakeAdapter" href="../mail_intake/adapters/base/#mail_intake.adapters.base.MailIntakeAdapter">MailIntakeAdapter</a></code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.adapters.base.MailIntakeAdapter" href="base/#mail_intake.adapters.base.MailIntakeAdapter">MailIntakeAdapter</a></code></p>
<p>Gmail read-only adapter.</p>
@@ -1634,16 +1637,16 @@ Gmail-specific API calls.</p>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is the ONLY place where googleapiclient is imported
- Gmail REST semantics are known
- .execute() is called
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is the ONLY place where `googleapiclient` is imported.
- Gmail REST semantics are known.
- `.execute()` is called.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Must remain thin and imperative
- Must not perform parsing or interpretation
- Must not expose Gmail-specific types beyond this class
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Must remain thin and imperative.
- Must not perform parsing or interpretation.
- Must not expose Gmail-specific types beyond this class.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize the Gmail adapter.</p>
@@ -1663,7 +1666,7 @@ Gmail-specific API calls.</p>
<tr class="doc-section-item">
<td><code>auth_provider</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.auth.base.MailIntakeAuthProvider" href="../mail_intake/auth/base/#mail_intake.auth.base.MailIntakeAuthProvider">MailIntakeAuthProvider</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.auth.base.MailIntakeAuthProvider" href="../auth/base/#mail_intake.auth.base.MailIntakeAuthProvider">MailIntakeAuthProvider</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1757,7 +1760,7 @@ Gmail-specific API calls.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1853,7 +1856,7 @@ Provider-native Gmail message payload.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1948,7 +1951,7 @@ Provider-native Gmail thread payload.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -2043,7 +2046,7 @@ Dictionaries containing <code>message_id</code> and <code>thread_id</code>.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAdapterError" href="../exceptions/#mail_intake.exceptions.MailIntakeAdapterError">MailIntakeAdapterError</a></code>
</td>
<td>
<div class="doc-md-description">

View File

@@ -1284,9 +1284,8 @@
<div class="doc doc-contents first">
<p>Authentication provider contracts for Mail Intake.</p>
<hr />
<h4 id="mail_intake.auth.base--summary">Summary</h4>
<h3 id="mail_intake.auth.base--summary">Summary</h3>
<p>Authentication provider contracts for Mail Intake.</p>
<p>This module defines the <strong>authentication abstraction layer</strong> used by mail
adapters to obtain provider-specific credentials.</p>
<p>Authentication concerns are intentionally decoupled from adapter logic.
@@ -1332,15 +1331,19 @@ declare the type of credentials they return.</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Acquire credentials from an external provider
- Refresh or revalidate credentials as needed
- Handle authentication-specific failure modes
- Coordinate with credential persistence layers where applicable
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Acquire credentials from an external provider.
- Refresh or revalidate credentials as needed.
- Handle authentication-specific failure modes.
- Coordinate with credential persistence layers where applicable.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Mail adapters must treat returned credentials as opaque and provider-specific
- Mail adapters rely only on the declared credential type expected by the adapter
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Mail adapters must treat returned credentials as opaque and
provider-specific.
- Mail adapters rely only on the declared credential type expected
by the adapter.
</code></pre></div></td></tr></table></div>
</details>
@@ -1429,9 +1432,13 @@ credentials could not be obtained or validated.</p>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This method is synchronous by design
- Represents the sole entry point through which adapters obtain authentication material
- Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><code>- This method is synchronous by design.
- Represents the sole entry point through which adapters obtain
authentication material.
- Implementations must either return credentials of the declared
type `T` that are valid at the time of return or raise an exception.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1284,16 +1284,17 @@
<div class="doc doc-contents first">
<p>Google authentication provider implementation for Mail Intake.</p>
<hr />
<h4 id="mail_intake.auth.google--summary">Summary</h4>
<h3 id="mail_intake.auth.google--summary">Summary</h3>
<p>Google authentication provider implementation for Mail Intake.</p>
<p>This module provides a <strong>Google OAuthbased authentication provider</strong>
used primarily for Gmail access.</p>
<p>It encapsulates all Google-specific authentication concerns, including:
- Credential loading and persistence
- Token refresh handling
- Interactive OAuth flow initiation
- Coordination with a credential persistence layer</p>
<p>It encapsulates all Google-specific authentication concerns, including:</p>
<ul>
<li>Credential loading and persistence.</li>
<li>Token refresh handling.</li>
<li>Interactive OAuth flow initiation.</li>
<li>Coordination with a credential persistence layer.</li>
</ul>
<p>No Google authentication details should leak outside this module.</p>
@@ -1321,7 +1322,7 @@ used primarily for Gmail access.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.auth.base.MailIntakeAuthProvider" href="../../mail_intake/auth/base/#mail_intake.auth.base.MailIntakeAuthProvider">MailIntakeAuthProvider</a></code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.auth.base.MailIntakeAuthProvider" href="../base/#mail_intake.auth.base.MailIntakeAuthProvider">MailIntakeAuthProvider</a></code></p>
<p>Google OAuth provider for Gmail access.</p>
@@ -1335,13 +1336,15 @@ Google's OAuth 2.0 flow and credential management libraries.</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Load cached credentials from a credential store when available
- Refresh expired credentials when possible
- Initiate an interactive OAuth flow only when required
- Persist refreshed or newly obtained credentials via the store
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Load cached credentials from a credential store when available.
- Refresh expired credentials when possible.
- Initiate an interactive OAuth flow only when required.
- Persist refreshed or newly obtained credentials via the store.
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is synchronous by design and maintains a minimal internal state
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is synchronous by design and maintains a minimal
internal state.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize the Google authentication provider.</p>
@@ -1375,7 +1378,7 @@ Google's OAuth 2.0 flow and credential management libraries.</p>
<tr class="doc-section-item">
<td><code>store</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../../mail_intake/credentials/store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="google.oauth2.credentials.Credentials">Credentials</span>]</code>
<code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../../credentials/store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="google.oauth2.credentials.Credentials">Credentials</span>]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1467,7 +1470,7 @@ for use with Google API clients.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAuthError" href="../../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAuthError">MailIntakeAuthError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAuthError" href="../../exceptions/#mail_intake.exceptions.MailIntakeAuthError">MailIntakeAuthError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1486,10 +1489,10 @@ or obtained via interactive authentication.</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Load cached credentials from the configured credential store
- Refresh expired credentials when possible
- Perform an interactive OAuth login as a fallback
- Persist valid credentials for future use
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Load cached credentials from the configured credential store.
- Refresh expired credentials when possible.
- Perform an interactive OAuth login as a fallback.
- Persist valid credentials for future use.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1212,26 +1212,29 @@
<div class="doc doc-contents first">
<p>Authentication provider implementations for Mail Intake.</p>
<hr />
<h4 id="mail_intake.auth--summary">Summary</h4>
<h3 id="mail_intake.auth--summary">Summary</h3>
<p>Authentication provider implementations for Mail Intake.</p>
<p>This package defines the <strong>authentication layer</strong> used by mail adapters
to obtain provider-specific credentials.</p>
<p>It exposes:
- A stable, provider-agnostic authentication contract
- Concrete authentication providers for supported platforms</p>
<p>Authentication providers:
- Are responsible for credential acquisition and lifecycle management
- Are intentionally decoupled from adapter logic
- May be extended by users to support additional providers</p>
<p>It exposes:</p>
<ul>
<li>A stable, provider-agnostic authentication contract.</li>
<li>Concrete authentication providers for supported platforms.</li>
</ul>
<p>Authentication providers:</p>
<ul>
<li>Are responsible for credential acquisition and lifecycle management.</li>
<li>Are intentionally decoupled from adapter logic.</li>
<li>May be extended by users to support additional providers.</li>
</ul>
<p>Consumers should depend on the abstract interface and use concrete
implementations only where explicitly required.</p>
<hr />
<h4 id="mail_intake.auth--public-api">Public API</h4>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>MailIntakeAuthProvider
MailIntakeGoogleAuth
</code></pre></div></td></tr></table></div>
<h3 id="mail_intake.auth--public-api">Public API</h3>
<ul>
<li><code>MailIntakeAuthProvider</code></li>
<li><code>MailIntakeGoogleAuth</code></li>
</ul>
<hr />
@@ -1273,15 +1276,19 @@ declare the type of credentials they return.</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Acquire credentials from an external provider
- Refresh or revalidate credentials as needed
- Handle authentication-specific failure modes
- Coordinate with credential persistence layers where applicable
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Acquire credentials from an external provider.
- Refresh or revalidate credentials as needed.
- Handle authentication-specific failure modes.
- Coordinate with credential persistence layers where applicable.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Mail adapters must treat returned credentials as opaque and provider-specific
- Mail adapters rely only on the declared credential type expected by the adapter
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Mail adapters must treat returned credentials as opaque and
provider-specific.
- Mail adapters rely only on the declared credential type expected
by the adapter.
</code></pre></div></td></tr></table></div>
</details>
@@ -1370,9 +1377,13 @@ credentials could not be obtained or validated.</p>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This method is synchronous by design
- Represents the sole entry point through which adapters obtain authentication material
- Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><code>- This method is synchronous by design.
- Represents the sole entry point through which adapters obtain
authentication material.
- Implementations must either return credentials of the declared
type `T` that are valid at the time of return or raise an exception.
</code></pre></div></td></tr></table></div>
</details>
</div>
@@ -1401,7 +1412,7 @@ credentials could not be obtained or validated.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.auth.base.MailIntakeAuthProvider" href="../mail_intake/auth/base/#mail_intake.auth.base.MailIntakeAuthProvider">MailIntakeAuthProvider</a></code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.auth.base.MailIntakeAuthProvider" href="base/#mail_intake.auth.base.MailIntakeAuthProvider">MailIntakeAuthProvider</a></code></p>
<p>Google OAuth provider for Gmail access.</p>
@@ -1415,13 +1426,15 @@ Google's OAuth 2.0 flow and credential management libraries.</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Load cached credentials from a credential store when available
- Refresh expired credentials when possible
- Initiate an interactive OAuth flow only when required
- Persist refreshed or newly obtained credentials via the store
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Load cached credentials from a credential store when available.
- Refresh expired credentials when possible.
- Initiate an interactive OAuth flow only when required.
- Persist refreshed or newly obtained credentials via the store.
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is synchronous by design and maintains a minimal internal state
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is synchronous by design and maintains a minimal
internal state.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize the Google authentication provider.</p>
@@ -1455,7 +1468,7 @@ Google's OAuth 2.0 flow and credential management libraries.</p>
<tr class="doc-section-item">
<td><code>store</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../mail_intake/credentials/store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="google.oauth2.credentials.Credentials">Credentials</span>]</code>
<code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../credentials/store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="google.oauth2.credentials.Credentials">Credentials</span>]</code>
</td>
<td>
<div class="doc-md-description">
@@ -1547,7 +1560,7 @@ for use with Google API clients.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAuthError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeAuthError">MailIntakeAuthError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeAuthError" href="../exceptions/#mail_intake.exceptions.MailIntakeAuthError">MailIntakeAuthError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1566,10 +1579,10 @@ or obtained via interactive authentication.</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Load cached credentials from the configured credential store
- Refresh expired credentials when possible
- Perform an interactive OAuth login as a fallback
- Persist valid credentials for future use
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Load cached credentials from the configured credential store.
- Refresh expired credentials when possible.
- Perform an interactive OAuth login as a fallback.
- Persist valid credentials for future use.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1356,9 +1356,8 @@
<div class="doc doc-contents first">
<p>Global configuration models for Mail Intake.</p>
<hr />
<h4 id="mail_intake.config--summary">Summary</h4>
<h3 id="mail_intake.config--summary">Summary</h3>
<p>Global configuration models for Mail Intake.</p>
<p>This module defines the <strong>top-level configuration object</strong> used to control
mail ingestion behavior across adapters, authentication providers, and
ingestion workflows.</p>
@@ -1395,7 +1394,7 @@ environment reads to ensure predictability and testability.</p>
<div class="doc doc-contents ">
<p>Global configuration for mail-intake.</p>
<p>Global configuration for <code>mail-intake</code>.</p>
<details class="notes" open>
@@ -1405,11 +1404,13 @@ environment reads to ensure predictability and testability.</p>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><code>- This configuration is intentionally explicit and immutable
- No implicit environment reads or global state
- Explicit configuration over implicit defaults
- No direct environment or filesystem access
- This model is safe to pass across layers and suitable for serialization
<span class="normal">5</span>
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><code>- This configuration is intentionally explicit and immutable.
- No implicit environment reads or global state.
- Explicit configuration over implicit defaults.
- No direct environment or filesystem access.
- This model is safe to pass across layers and suitable for
serialization.
</code></pre></div></td></tr></table></div>
</details>

View File

@@ -1566,29 +1566,29 @@
<div class="doc doc-contents first">
<p>Credential persistence interfaces and implementations for Mail Intake.</p>
<hr />
<h4 id="mail_intake.credentials--summary">Summary</h4>
<h3 id="mail_intake.credentials--summary">Summary</h3>
<p>Credential persistence interfaces and implementations for Mail Intake.</p>
<p>This package defines the abstractions and concrete implementations used
to persist authentication credentials across Mail Intake components.</p>
<p>The credential persistence layer is intentionally decoupled from
authentication logic. Authentication providers are responsible for
credential acquisition, validation, and refresh, while implementations
within this package are responsible solely for storage and retrieval.</p>
<p>The package provides:
- A generic <code>CredentialStore</code> abstraction defining the persistence contract
- Local filesystembased storage for development and single-node use
- Distributed, Redis-backed storage for production and scaled deployments</p>
<p>The package provides:</p>
<ul>
<li>A generic <code>CredentialStore</code> abstraction defining the persistence contract.</li>
<li>Local filesystembased storage for development and single-node use.</li>
<li>Distributed, Redis-backed storage for production and scaled deployments.</li>
</ul>
<p>Credential lifecycle management, interpretation, and security policy
decisions remain the responsibility of authentication providers.</p>
<hr />
<h4 id="mail_intake.credentials--public-api">Public API</h4>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>CredentialStore
PickleCredentialStore
RedisCredentialStore
</code></pre></div></td></tr></table></div>
<h3 id="mail_intake.credentials--public-api">Public API</h3>
<ul>
<li><code>CredentialStore</code></li>
<li><code>PickleCredentialStore</code></li>
<li><code>RedisCredentialStore</code></li>
</ul>
<hr />
@@ -1618,25 +1618,27 @@ RedisCredentialStore
Bases: <code><span title="abc.ABC">ABC</span></code>, <code><span title="typing.Generic">Generic</span>[<span title="mail_intake.credentials.store.T">T</span>]</code></p>
<p>Abstract base class defining a generic persistence interface for
authentication credentials.</p>
<p>Abstract base class defining a generic persistence interface.</p>
<p>Used for authentication credentials across different backends.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Provide persistent storage separating life-cycle management from storage mechanics
- Keep implementation focused only on persistence
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Provide persistent storage separating life-cycle management from
storage mechanics.
- Keep implementation focused only on persistence.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- The store is intentionally agnostic to:
- The concrete credential type being stored
- The serialization format used to persist credentials
- The underlying storage backend or durability guarantees
- The concrete credential type being stored.
- The serialization format used to persist credentials.
- The underlying storage backend or durability guarantees.
</code></pre></div></td></tr></table></div>
</details>
@@ -1736,8 +1738,14 @@ loadable; otherwise <code>None</code>.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized
- The store must not attempt to validate, refresh, or otherwise interpret the returned credentials
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><code>- Implementations should return `None` when no credentials are
present or when stored credentials cannot be successfully
decoded or deserialized.
- The store must not attempt to validate, refresh, or otherwise
interpret the returned credentials.
</code></pre></div></td></tr></table></div>
</details>
</div>
@@ -1832,7 +1840,7 @@ loadable; otherwise <code>None</code>.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../mail_intake/credentials/store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="mail_intake.credentials.pickle.T">T</span>]</code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="mail_intake.credentials.pickle.T">T</span>]</code></p>
<p>Filesystem-backed credential store using pickle serialization.</p>
@@ -1846,12 +1854,14 @@ development, testing, and single-process execution contexts.</p>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Stores credentials on the local filesystem
- Uses pickle for serialization and deserialization
- Does not provide encryption, locking, or concurrency guarantees
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Stores credentials on the local filesystem.
- Uses `pickle` for serialization and deserialization.
- Does not provide encryption, locking, or concurrency guarantees.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Credential lifecycle management, validation, and refresh logic are explicitly out of scope for this class
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Credential lifecycle management, validation, and refresh logic are
explicitly out of scope for this class.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize a pickle-backed credential store.</p>
@@ -1970,8 +1980,12 @@ successfully deserialized; otherwise <code>None</code>.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- If the credential file does not exist or cannot be successfully deserialized, this method returns ``None``
- The store does not attempt to validate or interpret the returned credentials
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- If the credential file does not exist or cannot be successfully
deserialized, this method returns `None`.
- The store does not attempt to validate or interpret the
returned credentials.
</code></pre></div></td></tr></table></div>
</details>
</div>
@@ -2055,7 +2069,7 @@ successfully deserialized; otherwise <code>None</code>.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../mail_intake/credentials/store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="mail_intake.credentials.redis.T">T</span>]</code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="mail_intake.credentials.redis.T">T</span>]</code></p>
<p>Redis-backed implementation of <code>CredentialStore</code>.</p>
@@ -2068,13 +2082,19 @@ must be shared across multiple processes or nodes.</p>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is responsible only for persistence and retrieval
- It does not interpret, validate, refresh, or otherwise manage the lifecycle of the credentials being stored
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is responsible only for persistence and retrieval.
- It does not interpret, validate, refresh, or otherwise manage the
lifecycle of the credentials being stored.
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- The store is intentionally generic and delegates all serialization concerns to caller-provided functions
- This avoids unsafe mechanisms such as pickle and allows credential formats to be explicitly controlled and audited
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- The store is intentionally generic and delegates all serialization
concerns to caller-provided functions.
- This avoids unsafe mechanisms such as `pickle` and allows
credential formats to be explicitly controlled and audited.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize a Redis-backed credential store.</p>
@@ -2250,8 +2270,16 @@ successfully deserialized; otherwise <code>None</code>.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- If no value exists for the configured key, or if the stored payload cannot be successfully deserialized, this method returns ``None``
- The store does not attempt to validate the returned credentials or determine whether they are expired or otherwise usable
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><code>- If no value exists for the configured key, or if the stored
payload cannot be successfully deserialized, this method
returns `None`.
- The store does not attempt to validate the returned
credentials or determine whether they are expired or
otherwise usable.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1320,15 +1320,14 @@
<div class="doc doc-contents first">
<p>Local filesystembased credential persistence for Mail Intake.</p>
<hr />
<h4 id="mail_intake.credentials.pickle--summary">Summary</h4>
<h3 id="mail_intake.credentials.pickle--summary">Summary</h3>
<p>Local filesystembased credential persistence for Mail Intake.</p>
<p>This module provides a file-backed implementation of the
<code>CredentialStore</code> abstraction using Python's <code>pickle</code> module.</p>
<p>The pickle-based credential store is intended for local development,
<p>The <code>pickle</code>-based credential store is intended for local development,
single-node deployments, and controlled environments where credentials
do not need to be shared across processes or machines.</p>
<p>Due to the security and portability risks associated with pickle-based
<p>Due to the security and portability risks associated with <code>pickle</code>-based
serialization, this implementation is not suitable for distributed or
untrusted environments.</p>
@@ -1357,7 +1356,7 @@ untrusted environments.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../../mail_intake/credentials/store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="mail_intake.credentials.pickle.T">T</span>]</code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="mail_intake.credentials.pickle.T">T</span>]</code></p>
<p>Filesystem-backed credential store using pickle serialization.</p>
@@ -1371,12 +1370,14 @@ development, testing, and single-process execution contexts.</p>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Stores credentials on the local filesystem
- Uses pickle for serialization and deserialization
- Does not provide encryption, locking, or concurrency guarantees
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Stores credentials on the local filesystem.
- Uses `pickle` for serialization and deserialization.
- Does not provide encryption, locking, or concurrency guarantees.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Credential lifecycle management, validation, and refresh logic are explicitly out of scope for this class
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Credential lifecycle management, validation, and refresh logic are
explicitly out of scope for this class.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize a pickle-backed credential store.</p>
@@ -1495,8 +1496,12 @@ successfully deserialized; otherwise <code>None</code>.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- If the credential file does not exist or cannot be successfully deserialized, this method returns ``None``
- The store does not attempt to validate or interpret the returned credentials
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- If the credential file does not exist or cannot be successfully
deserialized, this method returns `None`.
- The store does not attempt to validate or interpret the
returned credentials.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1320,9 +1320,8 @@
<div class="doc doc-contents first">
<p>Redis-backed credential persistence for Mail Intake.</p>
<hr />
<h4 id="mail_intake.credentials.redis--summary">Summary</h4>
<h3 id="mail_intake.credentials.redis--summary">Summary</h3>
<p>Redis-backed credential persistence for Mail Intake.</p>
<p>This module provides a Redis-based implementation of the
<code>CredentialStore</code> abstraction, enabling credential persistence
across distributed and horizontally scaled deployments.</p>
@@ -1330,11 +1329,13 @@ across distributed and horizontally scaled deployments.</p>
authentication credentials must be shared safely across multiple
processes, containers, or nodes, such as container orchestration
platforms and microservice architectures.</p>
<p>Key characteristics:
- Distributed-safe, shared storage using Redis
- Explicit, caller-defined serialization and deserialization
- No reliance on unsafe mechanisms such as pickle
- Optional time-to-live (TTL) support for automatic credential expiry</p>
<p>Key characteristics:</p>
<ul>
<li>Distributed-safe, shared storage using Redis.</li>
<li>Explicit, caller-defined serialization and deserialization.</li>
<li>No reliance on unsafe mechanisms such as <code>pickle</code>.</li>
<li>Optional time-to-live (TTL) support for automatic credential expiry.</li>
</ul>
<p>This module is responsible solely for persistence concerns.
Credential validation, refresh, rotation, and acquisition remain the
responsibility of authentication provider implementations.</p>
@@ -1364,7 +1365,7 @@ responsibility of authentication provider implementations.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../../mail_intake/credentials/store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="mail_intake.credentials.redis.T">T</span>]</code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.credentials.store.CredentialStore" href="../store/#mail_intake.credentials.store.CredentialStore">CredentialStore</a>[<span title="mail_intake.credentials.redis.T">T</span>]</code></p>
<p>Redis-backed implementation of <code>CredentialStore</code>.</p>
@@ -1377,13 +1378,19 @@ must be shared across multiple processes or nodes.</p>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is responsible only for persistence and retrieval
- It does not interpret, validate, refresh, or otherwise manage the lifecycle of the credentials being stored
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is responsible only for persistence and retrieval.
- It does not interpret, validate, refresh, or otherwise manage the
lifecycle of the credentials being stored.
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- The store is intentionally generic and delegates all serialization concerns to caller-provided functions
- This avoids unsafe mechanisms such as pickle and allows credential formats to be explicitly controlled and audited
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- The store is intentionally generic and delegates all serialization
concerns to caller-provided functions.
- This avoids unsafe mechanisms such as `pickle` and allows
credential formats to be explicitly controlled and audited.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize a Redis-backed credential store.</p>
@@ -1559,8 +1566,16 @@ successfully deserialized; otherwise <code>None</code>.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- If no value exists for the configured key, or if the stored payload cannot be successfully deserialized, this method returns ``None``
- The store does not attempt to validate the returned credentials or determine whether they are expired or otherwise usable
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><code>- If no value exists for the configured key, or if the stored
payload cannot be successfully deserialized, this method
returns `None`.
- The store does not attempt to validate the returned
credentials or determine whether they are expired or
otherwise usable.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1320,9 +1320,8 @@
<div class="doc doc-contents first">
<p>Credential persistence abstractions for Mail Intake.</p>
<hr />
<h4 id="mail_intake.credentials.store--summary">Summary</h4>
<h3 id="mail_intake.credentials.store--summary">Summary</h3>
<p>Credential persistence abstractions for Mail Intake.</p>
<p>This module defines the generic persistence contract used to store and
retrieve authentication credentials across Mail Intake components.</p>
<p>The <code>CredentialStore</code> abstraction establishes a strict separation
@@ -1363,25 +1362,27 @@ specific storage mechanism.</p>
Bases: <code><span title="abc.ABC">ABC</span></code>, <code><span title="typing.Generic">Generic</span>[<span title="mail_intake.credentials.store.T">T</span>]</code></p>
<p>Abstract base class defining a generic persistence interface for
authentication credentials.</p>
<p>Abstract base class defining a generic persistence interface.</p>
<p>Used for authentication credentials across different backends.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Provide persistent storage separating life-cycle management from storage mechanics
- Keep implementation focused only on persistence
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Provide persistent storage separating life-cycle management from
storage mechanics.
- Keep implementation focused only on persistence.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- The store is intentionally agnostic to:
- The concrete credential type being stored
- The serialization format used to persist credentials
- The underlying storage backend or durability guarantees
- The concrete credential type being stored.
- The serialization format used to persist credentials.
- The underlying storage backend or durability guarantees.
</code></pre></div></td></tr></table></div>
</details>
@@ -1481,8 +1482,14 @@ loadable; otherwise <code>None</code>.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized
- The store must not attempt to validate, refresh, or otherwise interpret the returned credentials
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><code>- Implementations should return `None` when no credentials are
present or when stored credentials cannot be successfully
decoded or deserialized.
- The store must not attempt to validate, refresh, or otherwise
interpret the returned credentials.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1309,7 +1309,7 @@ provider-specific or third-party exceptions.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeError">MailIntakeError</a></code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeError" href="#mail_intake.exceptions.MailIntakeError">MailIntakeError</a></code></p>
<p>Errors raised by mail provider adapters.</p>
@@ -1318,7 +1318,9 @@ provider-specific or third-party exceptions.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Lifecycle:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Raised when a provider adapter encounters API errors, transport failures, or invalid provider responses
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Raised when a provider adapter encounters API errors, transport
failures, or invalid provider responses.
</code></pre></div></td></tr></table></div>
</details>
@@ -1339,7 +1341,7 @@ provider-specific or third-party exceptions.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeError">MailIntakeError</a></code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeError" href="#mail_intake.exceptions.MailIntakeError">MailIntakeError</a></code></p>
<p>Authentication and credential-related failures.</p>
@@ -1348,7 +1350,9 @@ provider-specific or third-party exceptions.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Lifecycle:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Raised when authentication providers are unable to acquire, refresh, or persist valid credentials
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Raised when authentication providers are unable to acquire,
refresh, or persist valid credentials.
</code></pre></div></td></tr></table></div>
</details>
@@ -1403,7 +1407,7 @@ provider-specific or third-party exceptions.</p>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeError">MailIntakeError</a></code></p>
Bases: <code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeError" href="#mail_intake.exceptions.MailIntakeError">MailIntakeError</a></code></p>
<p>Errors encountered while parsing message content.</p>
@@ -1412,7 +1416,9 @@ provider-specific or third-party exceptions.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Lifecycle:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Raised when raw provider payloads cannot be interpreted or normalized into internal domain models
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Raised when raw provider payloads cannot be interpreted or
normalized into internal domain models.
</code></pre></div></td></tr></table></div>
</details>

View File

@@ -303,7 +303,7 @@
<li class="md-nav__item">
<a href="#mail_intake--quick-start" class="md-nav__link">
<span class="md-ellipsis">
Quick start
Quick Start
</span>
</a>
@@ -1186,7 +1186,7 @@
<li class="md-nav__item">
<a href="#mail_intake--quick-start" class="md-nav__link">
<span class="md-ellipsis">
Quick start
Quick Start
</span>
</a>
@@ -1246,118 +1246,127 @@
<div class="doc doc-contents first">
<p>Mail Intake — provider-agnostic, read-only email ingestion framework.</p>
<hr />
<h4 id="mail_intake--summary">Summary</h4>
<h3 id="mail_intake--summary">Summary</h3>
<p>Mail Intake — provider-agnostic, read-only email ingestion framework.</p>
<p>Mail Intake is a <strong>contract-first library</strong> designed to ingest, parse, and
normalize email data from external providers (such as Gmail) into clean,
provider-agnostic domain models.</p>
<p>The library is intentionally structured around clear layers, each exposed
as a first-class module at the package root:</p>
<ul>
<li>adapters: provider-specific access (e.g. Gmail)</li>
<li>auth: authentication providers and credential lifecycle management</li>
<li>credentials: credential persistence abstractions and implementations</li>
<li>parsers: extraction and normalization of message content</li>
<li>ingestion: orchestration and high-level ingestion workflows</li>
<li>models: canonical, provider-agnostic data representations</li>
<li>config: explicit global configuration</li>
<li>exceptions: library-defined error hierarchy</li>
<li><code>adapters</code>: Provider-specific access (e.g., Gmail).</li>
<li><code>auth</code>: Authentication providers and credential lifecycle management.</li>
<li><code>credentials</code>: Credential persistence abstractions and implementations.</li>
<li><code>parsers</code>: Extraction and normalization of message content.</li>
<li><code>ingestion</code>: Orchestration and high-level ingestion workflows.</li>
<li><code>models</code>: Canonical, provider-agnostic data representations.</li>
<li><code>config</code>: Explicit global configuration.</li>
<li><code>exceptions</code>: Library-defined error hierarchy.</li>
</ul>
<p>The package root acts as a <strong>namespace</strong>, not a facade. Consumers are
expected to import functionality explicitly from the appropriate module.</p>
<hr />
<h4 id="mail_intake--installation">Installation</h4>
<h3 id="mail_intake--installation">Installation</h3>
<p>Install using pip:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>pip install mail-intake
</code></pre></div></td></tr></table></div>
<div class="language-bash highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a>pip<span class="w"> </span>install<span class="w"> </span>mail-intake
</span></code></pre></div></td></tr></table></div>
<p>Or with Poetry:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>poetry add mail-intake
</code></pre></div></td></tr></table></div>
<div class="language-bash highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-1-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1"></a>poetry<span class="w"> </span>add<span class="w"> </span>mail-intake
</span></code></pre></div></td></tr></table></div>
<p>Mail Intake is pure Python and has no runtime dependencies beyond those
required by the selected provider (for example, Google APIs for Gmail).</p>
<hr />
<h4 id="mail_intake--quick-start">Quick start</h4>
<h3 id="mail_intake--quick-start">Quick Start</h3>
<p>Minimal Gmail ingestion example (local development):</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span></pre></div></td><td class="code"><div><pre><span></span><code>from mail_intake.ingestion import MailIntakeReader
from mail_intake.adapters import MailIntakeGmailAdapter
from mail_intake.auth import MailIntakeGoogleAuth
from mail_intake.credentials import PickleCredentialStore
store = PickleCredentialStore(path=&quot;token.pickle&quot;)
auth = MailIntakeGoogleAuth(
credentials_path=&quot;credentials.json&quot;,
store=store,
scopes=[&quot;https://www.googleapis.com/auth/gmail.readonly&quot;],
)
adapter = MailIntakeGmailAdapter(auth_provider=auth)
reader = MailIntakeReader(adapter)
for message in reader.iter_messages(&quot;from:recruiter@example.com&quot;):
print(message.subject, message.from_email)
</code></pre></div></td></tr></table></div>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-2-1"> 1</a></span>
<span class="normal"><a href="#__codelineno-2-2"> 2</a></span>
<span class="normal"><a href="#__codelineno-2-3"> 3</a></span>
<span class="normal"><a href="#__codelineno-2-4"> 4</a></span>
<span class="normal"><a href="#__codelineno-2-5"> 5</a></span>
<span class="normal"><a href="#__codelineno-2-6"> 6</a></span>
<span class="normal"><a href="#__codelineno-2-7"> 7</a></span>
<span class="normal"><a href="#__codelineno-2-8"> 8</a></span>
<span class="normal"><a href="#__codelineno-2-9"> 9</a></span>
<span class="normal"><a href="#__codelineno-2-10">10</a></span>
<span class="normal"><a href="#__codelineno-2-11">11</a></span>
<span class="normal"><a href="#__codelineno-2-12">12</a></span>
<span class="normal"><a href="#__codelineno-2-13">13</a></span>
<span class="normal"><a href="#__codelineno-2-14">14</a></span>
<span class="normal"><a href="#__codelineno-2-15">15</a></span>
<span class="normal"><a href="#__codelineno-2-16">16</a></span>
<span class="normal"><a href="#__codelineno-2-17">17</a></span>
<span class="normal"><a href="#__codelineno-2-18">18</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1"></a><span class="kn">from</span><span class="w"> </span><span class="nn">mail_intake.ingestion</span><span class="w"> </span><span class="kn">import</span> <span class="n">MailIntakeReader</span>
</span><span id="__span-2-2"><a id="__codelineno-2-2" name="__codelineno-2-2"></a><span class="kn">from</span><span class="w"> </span><span class="nn">mail_intake.adapters</span><span class="w"> </span><span class="kn">import</span> <span class="n">MailIntakeGmailAdapter</span>
</span><span id="__span-2-3"><a id="__codelineno-2-3" name="__codelineno-2-3"></a><span class="kn">from</span><span class="w"> </span><span class="nn">mail_intake.auth</span><span class="w"> </span><span class="kn">import</span> <span class="n">MailIntakeGoogleAuth</span>
</span><span id="__span-2-4"><a id="__codelineno-2-4" name="__codelineno-2-4"></a><span class="kn">from</span><span class="w"> </span><span class="nn">mail_intake.credentials</span><span class="w"> </span><span class="kn">import</span> <span class="n">PickleCredentialStore</span>
</span><span id="__span-2-5"><a id="__codelineno-2-5" name="__codelineno-2-5"></a>
</span><span id="__span-2-6"><a id="__codelineno-2-6" name="__codelineno-2-6"></a><span class="n">store</span> <span class="o">=</span> <span class="n">PickleCredentialStore</span><span class="p">(</span><span class="n">path</span><span class="o">=</span><span class="s2">&quot;token.pickle&quot;</span><span class="p">)</span>
</span><span id="__span-2-7"><a id="__codelineno-2-7" name="__codelineno-2-7"></a>
</span><span id="__span-2-8"><a id="__codelineno-2-8" name="__codelineno-2-8"></a><span class="n">auth</span> <span class="o">=</span> <span class="n">MailIntakeGoogleAuth</span><span class="p">(</span>
</span><span id="__span-2-9"><a id="__codelineno-2-9" name="__codelineno-2-9"></a> <span class="n">credentials_path</span><span class="o">=</span><span class="s2">&quot;credentials.json&quot;</span><span class="p">,</span>
</span><span id="__span-2-10"><a id="__codelineno-2-10" name="__codelineno-2-10"></a> <span class="n">store</span><span class="o">=</span><span class="n">store</span><span class="p">,</span>
</span><span id="__span-2-11"><a id="__codelineno-2-11" name="__codelineno-2-11"></a> <span class="n">scopes</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;https://www.googleapis.com/auth/gmail.readonly&quot;</span><span class="p">],</span>
</span><span id="__span-2-12"><a id="__codelineno-2-12" name="__codelineno-2-12"></a><span class="p">)</span>
</span><span id="__span-2-13"><a id="__codelineno-2-13" name="__codelineno-2-13"></a>
</span><span id="__span-2-14"><a id="__codelineno-2-14" name="__codelineno-2-14"></a><span class="n">adapter</span> <span class="o">=</span> <span class="n">MailIntakeGmailAdapter</span><span class="p">(</span><span class="n">auth_provider</span><span class="o">=</span><span class="n">auth</span><span class="p">)</span>
</span><span id="__span-2-15"><a id="__codelineno-2-15" name="__codelineno-2-15"></a><span class="n">reader</span> <span class="o">=</span> <span class="n">MailIntakeReader</span><span class="p">(</span><span class="n">adapter</span><span class="p">)</span>
</span><span id="__span-2-16"><a id="__codelineno-2-16" name="__codelineno-2-16"></a>
</span><span id="__span-2-17"><a id="__codelineno-2-17" name="__codelineno-2-17"></a><span class="k">for</span> <span class="n">message</span> <span class="ow">in</span> <span class="n">reader</span><span class="o">.</span><span class="n">iter_messages</span><span class="p">(</span><span class="s2">&quot;from:recruiter@example.com&quot;</span><span class="p">):</span>
</span><span id="__span-2-18"><a id="__codelineno-2-18" name="__codelineno-2-18"></a> <span class="nb">print</span><span class="p">(</span><span class="n">message</span><span class="o">.</span><span class="n">subject</span><span class="p">,</span> <span class="n">message</span><span class="o">.</span><span class="n">from_email</span><span class="p">)</span>
</span></code></pre></div></td></tr></table></div>
<p>Iterating over threads:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>for thread in reader.iter_threads(&quot;subject:Interview&quot;):
print(thread.normalized_subject, len(thread.messages))
</code></pre></div></td></tr></table></div>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-3-1">1</a></span>
<span class="normal"><a href="#__codelineno-3-2">2</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1"></a><span class="k">for</span> <span class="n">thread</span> <span class="ow">in</span> <span class="n">reader</span><span class="o">.</span><span class="n">iter_threads</span><span class="p">(</span><span class="s2">&quot;subject:Interview&quot;</span><span class="p">):</span>
</span><span id="__span-3-2"><a id="__codelineno-3-2" name="__codelineno-3-2"></a> <span class="nb">print</span><span class="p">(</span><span class="n">thread</span><span class="o">.</span><span class="n">normalized_subject</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">thread</span><span class="o">.</span><span class="n">messages</span><span class="p">))</span>
</span></code></pre></div></td></tr></table></div>
<hr />
<h4 id="mail_intake--architecture">Architecture</h4>
<h3 id="mail_intake--architecture">Architecture</h3>
<p>Mail Intake is designed to be extensible via <strong>public contracts</strong> exposed
through its modules:</p>
<ul>
<li>Users MAY implement their own mail adapters by subclassing <code>adapters.MailIntakeAdapter</code></li>
<li>Users MAY implement their own authentication providers by subclassing <code>auth.MailIntakeAuthProvider[T]</code></li>
<li>Users MAY implement their own credential persistence layers by implementing <code>credentials.CredentialStore[T]</code></li>
<li>Users MAY implement their own mail adapters by subclassing
<code>adapters.MailIntakeAdapter</code>.</li>
<li>Users MAY implement their own authentication providers by subclassing
<code>auth.MailIntakeAuthProvider[T]</code>.</li>
<li>Users MAY implement their own credential persistence layers by implementing
<code>credentials.CredentialStore[T]</code>.</li>
</ul>
<p>Users SHOULD NOT subclass built-in adapter implementations. Built-in
adapters (such as Gmail) are reference implementations and may change
internally without notice.</p>
<p><strong>Design Guarantees:</strong>
- Read-only access: no mutation of provider state
- Provider-agnostic domain models
- Explicit configuration and dependency injection
- No implicit global state or environment reads
- Deterministic, testable behavior
- Distributed-safe authentication design</p>
<p><strong>Design Guarantees:</strong></p>
<ul>
<li>Read-only access: no mutation of provider state.</li>
<li>Provider-agnostic domain models.</li>
<li>Explicit configuration and dependency injection.</li>
<li>No implicit global state or environment reads.</li>
<li>Deterministic, testable behavior.</li>
<li>Distributed-safe authentication design.</li>
</ul>
<p>Mail Intake favors correctness, clarity, and explicitness over convenience
shortcuts.</p>
<p><strong>Core Philosophy:</strong>
<code>Mail Intake</code> is built as a <strong>contract-first ingestion pipeline</strong>:
1. <strong>Layered Decoupling</strong>: Adapters handle transport, Parsers handle format normalization, and Ingestion orchestrates.
2. <strong>Provider Agnosticism</strong>: Domain models and core logic never depend on provider-specific (e.g., Gmail) API internals.
3. <strong>Stateless Workflows</strong>: The library functions as a read-only pipe, ensuring side-effect-free ingestion.</p>
<p><strong>Core Philosophy:</strong></p>
<p><code>Mail Intake</code> is built as a <strong>contract-first ingestion pipeline</strong>:</p>
<ol>
<li><strong>Layered Decoupling</strong>: Adapters handle transport, Parsers handle format
normalization, and Ingestion orchestrates.</li>
<li><strong>Provider Agnosticism</strong>: Domain models and core logic never depend on
provider-specific (e.g., Gmail) API internals.</li>
<li><strong>Stateless Workflows</strong>: The library functions as a read-only pipe, ensuring
side-effect-free ingestion.</li>
</ol>
<hr />
<h4 id="mail_intake--public-api">Public API</h4>
<h3 id="mail_intake--public-api">Public API</h3>
<p>The supported public API consists of the following top-level modules:</p>
<ul>
<li>mail_intake.ingestion</li>
<li>mail_intake.adapters</li>
<li>mail_intake.auth</li>
<li>mail_intake.credentials</li>
<li>mail_intake.parsers</li>
<li>mail_intake.models</li>
<li>mail_intake.config</li>
<li>mail_intake.exceptions</li>
<li><code>mail_intake.ingestion</code></li>
<li><code>mail_intake.adapters</code></li>
<li><code>mail_intake.auth</code></li>
<li><code>mail_intake.credentials</code></li>
<li><code>mail_intake.parsers</code></li>
<li><code>mail_intake.models</code></li>
<li><code>mail_intake.config</code></li>
<li><code>mail_intake.exceptions</code></li>
</ul>
<p>Classes and functions should be imported explicitly from these modules.
No individual symbols are re-exported at the package root.</p>
@@ -1381,9 +1390,7 @@ No individual symbols are re-exported at the package root.</p>
</div>
</div><ul>
<li><a href="mail_intake/">Mail Intake</a></li>
</ul>
</div>

View File

@@ -1182,24 +1182,26 @@
<div class="doc doc-contents first">
<p>Mail ingestion orchestration for Mail Intake.</p>
<hr />
<h4 id="mail_intake.ingestion--summary">Summary</h4>
<h3 id="mail_intake.ingestion--summary">Summary</h3>
<p>Mail ingestion orchestration for Mail Intake.</p>
<p>This package contains <strong>high-level ingestion components</strong> responsible for
coordinating mail retrieval, parsing, normalization, and model construction.</p>
<p>It represents the <strong>top of the ingestion pipeline</strong> and is intended to be the
primary interaction surface for library consumers.</p>
<p>Components in this package:
- Are provider-agnostic
- Depend only on adapter and parser contracts
- Contain no provider-specific API logic
- Expose read-only ingestion workflows</p>
<p>Components in this package:</p>
<ul>
<li>Are provider-agnostic.</li>
<li>Depend only on adapter and parser contracts.</li>
<li>Contain no provider-specific API logic.</li>
<li>Expose read-only ingestion workflows.</li>
</ul>
<p>Consumers are expected to construct a mail adapter and pass it to the
ingestion layer to begin processing messages and threads.</p>
<hr />
<h4 id="mail_intake.ingestion--public-api">Public API</h4>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>MailIntakeReader
</code></pre></div></td></tr></table></div>
<h3 id="mail_intake.ingestion--public-api">Public API</h3>
<ul>
<li><code>MailIntakeReader</code></li>
</ul>
<hr />
@@ -1235,11 +1237,23 @@ ingestion layer to begin processing messages and threads.</p>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is the primary entry point for consumers of the Mail Intake library
- It orchestrates the full ingestion pipeline: Querying the adapter for message references, fetching raw provider messages, parsing and normalizing message data, constructing domain models
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is the primary entry point for consumers of the
Mail Intake library.
- It orchestrates the full ingestion pipeline:
- Querying the adapter for message references.
- Fetching raw provider messages.
- Parsing and normalizing message data.
- Constructing domain models.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is intentionally: Provider-agnostic, stateless beyond iteration scope, read-only
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is intentionally: Provider-agnostic, stateless beyond
iteration scope, read-only.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize the mail reader.</p>
@@ -1259,7 +1273,7 @@ ingestion layer to begin processing messages and threads.</p>
<tr class="doc-section-item">
<td><code>adapter</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.adapters.base.MailIntakeAdapter" href="../mail_intake/adapters/base/#mail_intake.adapters.base.MailIntakeAdapter">MailIntakeAdapter</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.adapters.base.MailIntakeAdapter" href="../adapters/base/#mail_intake.adapters.base.MailIntakeAdapter">MailIntakeAdapter</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1365,7 +1379,7 @@ ingestion layer to begin processing messages and threads.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeParsingError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeParsingError">MailIntakeParsingError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeParsingError" href="../exceptions/#mail_intake.exceptions.MailIntakeParsingError">MailIntakeParsingError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1459,7 +1473,7 @@ ingestion layer to begin processing messages and threads.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeParsingError" href="../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeParsingError">MailIntakeParsingError</a></code>
<code>`MailIntakeParsingError`</code>
</td>
<td>
<div class="doc-md-description">
@@ -1474,7 +1488,9 @@ ingestion layer to begin processing messages and threads.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Messages are grouped by `thread_id` and yielded as complete thread objects containing all associated messages
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Messages are grouped by `thread_id` and yielded as complete
thread objects containing all associated messages.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1320,16 +1320,17 @@
<div class="doc doc-contents first">
<p>High-level mail ingestion orchestration for Mail Intake.</p>
<hr />
<h4 id="mail_intake.ingestion.reader--summary">Summary</h4>
<h3 id="mail_intake.ingestion.reader--summary">Summary</h3>
<p>High-level mail ingestion orchestration for Mail Intake.</p>
<p>This module provides the primary, provider-agnostic entry point for
reading and processing mail data.</p>
<p>It coordinates:
- Mail adapter access
- Message and thread iteration
- Header and body parsing
- Normalization and model construction</p>
<p>It coordinates:</p>
<ul>
<li>Mail adapter access.</li>
<li>Message and thread iteration.</li>
<li>Header and body parsing.</li>
<li>Normalization and model construction.</li>
</ul>
<p>No provider-specific logic or API semantics are permitted in this layer.</p>
@@ -1365,11 +1366,23 @@ reading and processing mail data.</p>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is the primary entry point for consumers of the Mail Intake library
- It orchestrates the full ingestion pipeline: Querying the adapter for message references, fetching raw provider messages, parsing and normalizing message data, constructing domain models
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is the primary entry point for consumers of the
Mail Intake library.
- It orchestrates the full ingestion pipeline:
- Querying the adapter for message references.
- Fetching raw provider messages.
- Parsing and normalizing message data.
- Constructing domain models.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is intentionally: Provider-agnostic, stateless beyond iteration scope, read-only
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This class is intentionally: Provider-agnostic, stateless beyond
iteration scope, read-only.
</code></pre></div></td></tr></table></div>
</details>
<p>Initialize the mail reader.</p>
@@ -1389,7 +1402,7 @@ reading and processing mail data.</p>
<tr class="doc-section-item">
<td><code>adapter</code></td>
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.adapters.base.MailIntakeAdapter" href="../../mail_intake/adapters/base/#mail_intake.adapters.base.MailIntakeAdapter">MailIntakeAdapter</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.adapters.base.MailIntakeAdapter" href="../../adapters/base/#mail_intake.adapters.base.MailIntakeAdapter">MailIntakeAdapter</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1495,7 +1508,7 @@ reading and processing mail data.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeParsingError" href="../../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeParsingError">MailIntakeParsingError</a></code>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeParsingError" href="../../exceptions/#mail_intake.exceptions.MailIntakeParsingError">MailIntakeParsingError</a></code>
</td>
<td>
<div class="doc-md-description">
@@ -1589,7 +1602,7 @@ reading and processing mail data.</p>
<tbody>
<tr class="doc-section-item">
<td>
<code><a class="autorefs autorefs-internal" title="mail_intake.exceptions.MailIntakeParsingError" href="../../mail_intake/exceptions/#mail_intake.exceptions.MailIntakeParsingError">MailIntakeParsingError</a></code>
<code>`MailIntakeParsingError`</code>
</td>
<td>
<div class="doc-md-description">
@@ -1604,7 +1617,9 @@ reading and processing mail data.</p>
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Messages are grouped by `thread_id` and yielded as complete thread objects containing all associated messages
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Messages are grouped by `thread_id` and yielded as complete
thread objects containing all associated messages.
</code></pre></div></td></tr></table></div>
</details>
</div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1344,23 +1344,24 @@
<div class="doc doc-contents first">
<p>Domain models for Mail Intake.</p>
<hr />
<h4 id="mail_intake.models--summary">Summary</h4>
<h3 id="mail_intake.models--summary">Summary</h3>
<p>Domain models for Mail Intake.</p>
<p>This package defines the <strong>canonical, provider-agnostic data models</strong>
used throughout the Mail Intake ingestion pipeline.</p>
<p>Models in this package:
- Represent fully parsed and normalized mail data
- Are safe to persist, serialize, and index
- Contain no provider-specific payloads or API semantics
- Serve as stable inputs for downstream processing and analysis</p>
<p>Models in this package:</p>
<ul>
<li>Represent fully parsed and normalized mail data.</li>
<li>Are safe to persist, serialize, and index.</li>
<li>Contain no provider-specific payloads or API semantics.</li>
<li>Serve as stable inputs for downstream processing and analysis.</li>
</ul>
<p>These models form the core internal data contract of the library.</p>
<hr />
<h4 id="mail_intake.models--public-api">Public API</h4>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>MailIntakeMessage
MailIntakeThread
</code></pre></div></td></tr></table></div>
<h3 id="mail_intake.models--public-api">Public API</h3>
<ul>
<li><code>MailIntakeMessage</code></li>
<li><code>MailIntakeThread</code></li>
</ul>
<hr />
@@ -1400,11 +1401,15 @@ MailIntakeThread
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This model represents a fully parsed and normalized email message
- It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This model represents a fully parsed and normalized email message.
- It is intentionally provider-agnostic and suitable for
persistence, indexing, and downstream processing.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- No provider-specific identifiers, payloads, or API semantics should appear in this model
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- No provider-specific identifiers, payloads, or API semantics
should appear in this model.
</code></pre></div></td></tr></table></div>
</details>
@@ -1662,9 +1667,13 @@ MailIntakeThread
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- A thread groups multiple related messages under a single subject and participant set
- It is designed to support reasoning over conversational context such as job applications, interviews, follow-ups, and ongoing discussions
- This model is provider-agnostic and safe to persist
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><code>- A thread groups multiple related messages under a single subject
and participant set.
- It is designed to support reasoning over conversational context
such as job applications, interviews, follow-ups, and ongoing discussions.
- This model is provider-agnostic and safe to persist.
</code></pre></div></td></tr></table></div>
</details>
@@ -1848,9 +1857,9 @@ MailIntakeThread
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Appends the message to the thread
- Tracks unique participants
- Updates the last activity timestamp
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Appends the message to the thread.
- Tracks unique participants.
- Updates the last activity timestamp.
</code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1428,9 +1428,8 @@
<div class="doc doc-contents first">
<p>Message domain models for Mail Intake.</p>
<hr />
<h4 id="mail_intake.models.message--summary">Summary</h4>
<h3 id="mail_intake.models.message--summary">Summary</h3>
<p>Message domain models for Mail Intake.</p>
<p>This module defines the <strong>canonical, provider-agnostic representation</strong>
of an individual email message as used internally by the Mail Intake
ingestion pipeline.</p>
@@ -1474,11 +1473,15 @@ provider-specific fields or semantics.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This model represents a fully parsed and normalized email message
- It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- This model represents a fully parsed and normalized email message.
- It is intentionally provider-agnostic and suitable for
persistence, indexing, and downstream processing.
</code></pre></div></td></tr></table></div>
<p><strong>Constraints:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- No provider-specific identifiers, payloads, or API semantics should appear in this model
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- No provider-specific identifiers, payloads, or API semantics
should appear in this model.
</code></pre></div></td></tr></table></div>
</details>

View File

@@ -1404,9 +1404,8 @@
<div class="doc doc-contents first">
<p>Thread domain models for Mail Intake.</p>
<hr />
<h4 id="mail_intake.models.thread--summary">Summary</h4>
<h3 id="mail_intake.models.thread--summary">Summary</h3>
<p>Thread domain models for Mail Intake.</p>
<p>This module defines the <strong>canonical, provider-agnostic representation</strong>
of an email thread as used internally by the Mail Intake ingestion pipeline.</p>
<p>Threads group related messages and serve as the primary unit of reasoning
@@ -1450,9 +1449,13 @@ for higher-level correspondence workflows.</p>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- A thread groups multiple related messages under a single subject and participant set
- It is designed to support reasoning over conversational context such as job applications, interviews, follow-ups, and ongoing discussions
- This model is provider-agnostic and safe to persist
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><code>- A thread groups multiple related messages under a single subject
and participant set.
- It is designed to support reasoning over conversational context
such as job applications, interviews, follow-ups, and ongoing discussions.
- This model is provider-agnostic and safe to persist.
</code></pre></div></td></tr></table></div>
</details>
@@ -1636,9 +1639,9 @@ for higher-level correspondence workflows.</p>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Appends the message to the thread
- Tracks unique participants
- Updates the last activity timestamp
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Appends the message to the thread.
- Tracks unique participants.
- Updates the last activity timestamp.
</code></pre></div></td></tr></table></div>
</details>
</div>

Binary file not shown.

View File

@@ -915,6 +915,15 @@
<nav class="md-nav" aria-label="body">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#mail_intake.parsers.body--summary" class="md-nav__link">
<span class="md-ellipsis">
Summary
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#mail_intake.parsers.body-classes" class="md-nav__link">
<span class="md-ellipsis">
@@ -1155,6 +1164,15 @@
<nav class="md-nav" aria-label="body">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#mail_intake.parsers.body--summary" class="md-nav__link">
<span class="md-ellipsis">
Summary
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#mail_intake.parsers.body-classes" class="md-nav__link">
<span class="md-ellipsis">
@@ -1224,7 +1242,8 @@
<div class="doc doc-contents first">
<p>Message body extraction utilities for Mail Intake.</p>
<h3 id="mail_intake.parsers.body--summary">Summary</h3>
<p>Message body extraction utilities for Mail Intake.</p>
<p>This module contains helper functions for extracting a best-effort
plain-text body from provider-native message payloads.</p>
<p>The logic is intentionally tolerant of malformed or partial data and
@@ -1256,11 +1275,13 @@ prefers human-readable text over fidelity to original formatting.</p>
<div class="doc doc-contents ">
<p>Extract the best-effort message body from a Gmail payload.</p>
<p>Priority:
1. text/plain
2. text/html (stripped to text)
3. Single-part body
4. empty string (if nothing usable found)</p>
<p>Priority:</p>
<ol>
<li><code>text/plain</code></li>
<li><code>text/html</code> (stripped to text)</li>
<li>Single-part body</li>
<li>Empty string (if nothing usable found)</li>
</ol>
<p><span class="doc-section-title">Parameters:</span></p>
@@ -1296,13 +1317,13 @@ prefers human-readable text over fidelity to original formatting.</p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Name</th> <th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<td><code>str</code></td> <td>
<code>str</code>
</td>
<td>

View File

@@ -1242,9 +1242,8 @@
<div class="doc doc-contents first">
<p>Message header parsing utilities for Mail Intake.</p>
<hr />
<h4 id="mail_intake.parsers.headers--summary">Summary</h4>
<h3 id="mail_intake.parsers.headers--summary">Summary</h3>
<p>Message header parsing utilities for Mail Intake.</p>
<p>This module provides helper functions for normalizing and extracting
useful information from provider-native message headers.</p>
<p>The functions here are intentionally simple and tolerant of malformed
@@ -1296,7 +1295,7 @@ or incomplete header data.</p>
</td>
<td>
<div class="doc-md-description">
<p>Normalized header dictionary as returned by :func:<code>parse_headers</code>.</p>
<p>Normalized header dictionary as returned by <code>parse_headers()</code>.</p>
</div>
</td>
<td>
@@ -1323,7 +1322,8 @@ or incomplete header data.</p>
<td>
<div class="doc-md-description">
<p>Tuple[str, Optional[str]]:
A tuple <code>(email, name)</code> where <code>email</code> is the sender email address and <code>name</code> is the display name, or <code>None</code> if unavailable.</p>
A tuple <code>(email, name)</code> where <code>email</code> is the sender email address
and <code>name</code> is the display name, or <code>None</code> if unavailable.</p>
</div>
</td>
</tr>
@@ -1334,17 +1334,19 @@ A tuple <code>(email, name)</code> where <code>email</code> is the sender email
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function parses the ``From`` header and attempts to extract sender email address and optional human-readable display name
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function parses the `From` header and attempts to extract
sender email address and optional human-readable display name.
</code></pre></div></td></tr></table></div>
</details>
<details class="example" open>
<summary>Example</summary>
<p>Typical values:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>``&quot;John Doe &lt;john@example.com&gt;&quot;`` -&gt; ``(&quot;john@example.com&quot;, &quot;John Doe&quot;)``
``&quot;john@example.com&quot;`` -&gt; ``(&quot;john@example.com&quot;, None)``
</code></pre></div></td></tr></table></div>
<ul>
<li><code>"John Doe &lt;john@example.com&gt;"</code> -&gt; <code>("john@example.com", "John Doe")</code></li>
<li><code>"john@example.com"</code> -&gt; <code>("john@example.com", None)</code></li>
</ul>
</details>
</div>
@@ -1423,36 +1425,40 @@ Dictionary mapping lowercase header names to stripped values.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Provider payloads (such as Gmail) typically represent headers as a list of name/value mappings
- This function normalizes them into a case-insensitive dictionary keyed by lowercase header names
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Provider payloads (such as Gmail) typically represent headers as a
list of name/value mappings.
- This function normalizes them into a case-insensitive dictionary
keyed by lowercase header names.
</code></pre></div></td></tr></table></div>
</details>
<details class="example" open>
<summary>Example</summary>
<p>Typical usage:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span></pre></div></td><td class="code"><div><pre><span></span><code>Input:
[
{&quot;name&quot;: &quot;From&quot;, &quot;value&quot;: &quot;John Doe &lt;john@example.com&gt;&quot;},
{&quot;name&quot;: &quot;Subject&quot;, &quot;value&quot;: &quot;Re: Interview Update&quot;},
]
Output:
{
&quot;from&quot;: &quot;John Doe &lt;john@example.com&gt;&quot;,
&quot;subject&quot;: &quot;Re: Interview Update&quot;,
}
</code></pre></div></td></tr></table></div>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1"> 1</a></span>
<span class="normal"><a href="#__codelineno-0-2"> 2</a></span>
<span class="normal"><a href="#__codelineno-0-3"> 3</a></span>
<span class="normal"><a href="#__codelineno-0-4"> 4</a></span>
<span class="normal"><a href="#__codelineno-0-5"> 5</a></span>
<span class="normal"><a href="#__codelineno-0-6"> 6</a></span>
<span class="normal"><a href="#__codelineno-0-7"> 7</a></span>
<span class="normal"><a href="#__codelineno-0-8"> 8</a></span>
<span class="normal"><a href="#__codelineno-0-9"> 9</a></span>
<span class="normal"><a href="#__codelineno-0-10">10</a></span>
<span class="normal"><a href="#__codelineno-0-11">11</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="n">Input</span><span class="p">:</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2"></a> <span class="p">[</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3"></a> <span class="p">{</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;From&quot;</span><span class="p">,</span> <span class="s2">&quot;value&quot;</span><span class="p">:</span> <span class="s2">&quot;John Doe &lt;john@example.com&gt;&quot;</span><span class="p">},</span>
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4"></a> <span class="p">{</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Subject&quot;</span><span class="p">,</span> <span class="s2">&quot;value&quot;</span><span class="p">:</span> <span class="s2">&quot;Re: Interview Update&quot;</span><span class="p">},</span>
</span><span id="__span-0-5"><a id="__codelineno-0-5" name="__codelineno-0-5"></a> <span class="p">]</span>
</span><span id="__span-0-6"><a id="__codelineno-0-6" name="__codelineno-0-6"></a>
</span><span id="__span-0-7"><a id="__codelineno-0-7" name="__codelineno-0-7"></a><span class="n">Output</span><span class="p">:</span>
</span><span id="__span-0-8"><a id="__codelineno-0-8" name="__codelineno-0-8"></a> <span class="p">{</span>
</span><span id="__span-0-9"><a id="__codelineno-0-9" name="__codelineno-0-9"></a> <span class="s2">&quot;from&quot;</span><span class="p">:</span> <span class="s2">&quot;John Doe &lt;john@example.com&gt;&quot;</span><span class="p">,</span>
</span><span id="__span-0-10"><a id="__codelineno-0-10" name="__codelineno-0-10"></a> <span class="s2">&quot;subject&quot;</span><span class="p">:</span> <span class="s2">&quot;Re: Interview Update&quot;</span><span class="p">,</span>
</span><span id="__span-0-11"><a id="__codelineno-0-11" name="__codelineno-0-11"></a> <span class="p">}</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1170,31 +1170,32 @@
<div class="doc doc-contents first">
<p>Message parsing utilities for Mail Intake.</p>
<hr />
<h4 id="mail_intake.parsers--summary">Summary</h4>
<h3 id="mail_intake.parsers--summary">Summary</h3>
<p>Message parsing utilities for Mail Intake.</p>
<p>This package contains <strong>provider-aware but adapter-agnostic parsing helpers</strong>
used to extract and normalize structured information from raw mail payloads.</p>
<p>Parsers in this package are responsible for:
- Interpreting provider-native message structures
- Extracting meaningful fields such as headers, body text, and subjects
- Normalizing data into consistent internal representations</p>
<p>This package does not:
- Perform network or IO operations
- Contain provider API logic
- Construct domain models directly</p>
<p>Parsers in this package are responsible for:</p>
<ul>
<li>Interpreting provider-native message structures.</li>
<li>Extracting meaningful fields such as headers, body text, and subjects.</li>
<li>Normalizing data into consistent internal representations.</li>
</ul>
<p>This package does not:</p>
<ul>
<li>Perform network or IO operations.</li>
<li>Contain provider API logic.</li>
<li>Construct domain models directly.</li>
</ul>
<p>Parsing functions are designed to be composable and are orchestrated by the
ingestion layer.</p>
<hr />
<h4 id="mail_intake.parsers--public-api">Public API</h4>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>extract_body
parse_headers
extract_sender
normalize_subject
</code></pre></div></td></tr></table></div>
<h3 id="mail_intake.parsers--public-api">Public API</h3>
<ul>
<li><code>extract_body</code></li>
<li><code>parse_headers</code></li>
<li><code>extract_sender</code></li>
<li><code>normalize_subject</code></li>
</ul>
<hr />
@@ -1223,11 +1224,13 @@ normalize_subject
<div class="doc doc-contents ">
<p>Extract the best-effort message body from a Gmail payload.</p>
<p>Priority:
1. text/plain
2. text/html (stripped to text)
3. Single-part body
4. empty string (if nothing usable found)</p>
<p>Priority:</p>
<ol>
<li><code>text/plain</code></li>
<li><code>text/html</code> (stripped to text)</li>
<li>Single-part body</li>
<li>Empty string (if nothing usable found)</li>
</ol>
<p><span class="doc-section-title">Parameters:</span></p>
@@ -1263,13 +1266,13 @@ normalize_subject
<table>
<thead>
<tr>
<th>Type</th>
<th>Name</th> <th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<td><code>str</code></td> <td>
<code>str</code>
</td>
<td>
@@ -1319,7 +1322,7 @@ normalize_subject
</td>
<td>
<div class="doc-md-description">
<p>Normalized header dictionary as returned by :func:<code>parse_headers</code>.</p>
<p>Normalized header dictionary as returned by <code>parse_headers()</code>.</p>
</div>
</td>
<td>
@@ -1346,7 +1349,8 @@ normalize_subject
<td>
<div class="doc-md-description">
<p>Tuple[str, Optional[str]]:
A tuple <code>(email, name)</code> where <code>email</code> is the sender email address and <code>name</code> is the display name, or <code>None</code> if unavailable.</p>
A tuple <code>(email, name)</code> where <code>email</code> is the sender email address
and <code>name</code> is the display name, or <code>None</code> if unavailable.</p>
</div>
</td>
</tr>
@@ -1357,17 +1361,19 @@ A tuple <code>(email, name)</code> where <code>email</code> is the sender email
<details class="notes" open>
<summary>Notes</summary>
<p><strong>Responsibilities:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function parses the ``From`` header and attempts to extract sender email address and optional human-readable display name
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function parses the `From` header and attempts to extract
sender email address and optional human-readable display name.
</code></pre></div></td></tr></table></div>
</details>
<details class="example" open>
<summary>Example</summary>
<p>Typical values:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>``&quot;John Doe &lt;john@example.com&gt;&quot;`` -&gt; ``(&quot;john@example.com&quot;, &quot;John Doe&quot;)``
``&quot;john@example.com&quot;`` -&gt; ``(&quot;john@example.com&quot;, None)``
</code></pre></div></td></tr></table></div>
<ul>
<li><code>"John Doe &lt;john@example.com&gt;"</code> -&gt; <code>("john@example.com", "John Doe")</code></li>
<li><code>"john@example.com"</code> -&gt; <code>("john@example.com", None)</code></li>
</ul>
</details>
</div>
@@ -1447,13 +1453,15 @@ A tuple <code>(email, name)</code> where <code>email</code> is the sender email
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``
- Repeats prefix stripping to handle stacked prefixes
- Collapses excessive whitespace
- Preserves original casing (no lowercasing)
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Strips common prefixes such as `Re:`, `Fwd:`, and `FW:`.
- Repeats prefix stripping to handle stacked prefixes.
- Collapses excessive whitespace.
- Preserves original casing (no lowercasing).
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function is intentionally conservative and avoids aggressive transformations that could alter the semantic meaning of the subject
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function is intentionally conservative and avoids aggressive
transformations that could alter the semantic meaning of the subject.
</code></pre></div></td></tr></table></div>
</details>
</div>
@@ -1533,36 +1541,40 @@ Dictionary mapping lowercase header names to stripped values.</p>
<summary>Notes</summary>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Provider payloads (such as Gmail) typically represent headers as a list of name/value mappings
- This function normalizes them into a case-insensitive dictionary keyed by lowercase header names
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Provider payloads (such as Gmail) typically represent headers as a
list of name/value mappings.
- This function normalizes them into a case-insensitive dictionary
keyed by lowercase header names.
</code></pre></div></td></tr></table></div>
</details>
<details class="example" open>
<summary>Example</summary>
<p>Typical usage:</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span></pre></div></td><td class="code"><div><pre><span></span><code>Input:
[
{&quot;name&quot;: &quot;From&quot;, &quot;value&quot;: &quot;John Doe &lt;john@example.com&gt;&quot;},
{&quot;name&quot;: &quot;Subject&quot;, &quot;value&quot;: &quot;Re: Interview Update&quot;},
]
Output:
{
&quot;from&quot;: &quot;John Doe &lt;john@example.com&gt;&quot;,
&quot;subject&quot;: &quot;Re: Interview Update&quot;,
}
</code></pre></div></td></tr></table></div>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1"> 1</a></span>
<span class="normal"><a href="#__codelineno-0-2"> 2</a></span>
<span class="normal"><a href="#__codelineno-0-3"> 3</a></span>
<span class="normal"><a href="#__codelineno-0-4"> 4</a></span>
<span class="normal"><a href="#__codelineno-0-5"> 5</a></span>
<span class="normal"><a href="#__codelineno-0-6"> 6</a></span>
<span class="normal"><a href="#__codelineno-0-7"> 7</a></span>
<span class="normal"><a href="#__codelineno-0-8"> 8</a></span>
<span class="normal"><a href="#__codelineno-0-9"> 9</a></span>
<span class="normal"><a href="#__codelineno-0-10">10</a></span>
<span class="normal"><a href="#__codelineno-0-11">11</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="n">Input</span><span class="p">:</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2"></a> <span class="p">[</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3"></a> <span class="p">{</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;From&quot;</span><span class="p">,</span> <span class="s2">&quot;value&quot;</span><span class="p">:</span> <span class="s2">&quot;John Doe &lt;john@example.com&gt;&quot;</span><span class="p">},</span>
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4"></a> <span class="p">{</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Subject&quot;</span><span class="p">,</span> <span class="s2">&quot;value&quot;</span><span class="p">:</span> <span class="s2">&quot;Re: Interview Update&quot;</span><span class="p">},</span>
</span><span id="__span-0-5"><a id="__codelineno-0-5" name="__codelineno-0-5"></a> <span class="p">]</span>
</span><span id="__span-0-6"><a id="__codelineno-0-6" name="__codelineno-0-6"></a>
</span><span id="__span-0-7"><a id="__codelineno-0-7" name="__codelineno-0-7"></a><span class="n">Output</span><span class="p">:</span>
</span><span id="__span-0-8"><a id="__codelineno-0-8" name="__codelineno-0-8"></a> <span class="p">{</span>
</span><span id="__span-0-9"><a id="__codelineno-0-9" name="__codelineno-0-9"></a> <span class="s2">&quot;from&quot;</span><span class="p">:</span> <span class="s2">&quot;John Doe &lt;john@example.com&gt;&quot;</span><span class="p">,</span>
</span><span id="__span-0-10"><a id="__codelineno-0-10" name="__codelineno-0-10"></a> <span class="s2">&quot;subject&quot;</span><span class="p">:</span> <span class="s2">&quot;Re: Interview Update&quot;</span><span class="p">,</span>
</span><span id="__span-0-11"><a id="__codelineno-0-11" name="__codelineno-0-11"></a> <span class="p">}</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>

View File

@@ -1224,9 +1224,8 @@
<div class="doc doc-contents first">
<p>Subject line normalization utilities for Mail Intake.</p>
<hr />
<h4 id="mail_intake.parsers.subject--summary">Summary</h4>
<h3 id="mail_intake.parsers.subject--summary">Summary</h3>
<p>Subject line normalization utilities for Mail Intake.</p>
<p>This module provides helper functions for normalizing email subject lines
to enable reliable thread-level comparison and grouping.</p>
<p>Normalization is intentionally conservative to avoid altering semantic
@@ -1318,13 +1317,15 @@ meaning while removing common reply and forward prefixes.</p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``
- Repeats prefix stripping to handle stacked prefixes
- Collapses excessive whitespace
- Preserves original casing (no lowercasing)
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Strips common prefixes such as `Re:`, `Fwd:`, and `FW:`.
- Repeats prefix stripping to handle stacked prefixes.
- Collapses excessive whitespace.
- Preserves original casing (no lowercasing).
</code></pre></div></td></tr></table></div>
<p><strong>Guarantees:</strong></p>
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function is intentionally conservative and avoids aggressive transformations that could alter the semantic meaning of the subject
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- This function is intentionally conservative and avoids aggressive
transformations that could alter the semantic meaning of the subject.
</code></pre></div></td></tr></table></div>
</details>
</div>

File diff suppressed because one or more lines are too long

Binary file not shown.