Files

1140 lines
35 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="../../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.23">
<title>Pipeline - Khata App — Library Reference</title>
<link rel="stylesheet" href="../../../../assets/stylesheets/main.84d31ad4.min.css">
<link rel="stylesheet" href="../../../../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,700,700i%7CJetBrains+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Inter";--md-code-font:"JetBrains Mono"}</style>
<link rel="stylesheet" href="../../../../assets/_mkdocstrings.css">
<link rel="stylesheet" href="https://unpkg.com/dracula-prism/dist/css/dracula-prism.css">
<script>__md_scope=new URL("../../../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#pipeline" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../../../.." title="Khata App — Library Reference" class="md-header__button md-logo" aria-label="Khata App — Library Reference" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 8c0 2.21-1.79 4-4 4s-4-1.79-4-4 1.79-4 4-4 4 1.79 4 4m0 6.72V20H0v-2c0-2.21 3.13-4 7-4 1.5 0 2.87.27 4 .72M24 20H13V3h11zm-8-8.5a2.5 2.5 0 0 1 5 0 2.5 2.5 0 0 1-5 0M22 7a2 2 0 0 1-2-2h-3c0 1.11-.89 2-2 2v9a2 2 0 0 1 2 2h3c0-1.1.9-2 2-2z"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Khata App — Library Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Pipeline
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan" aria-hidden="true" type="radio" name="__palette" id="__palette_0">
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<a href="javascript:void(0)" class="md-search__icon md-icon" title="Share" aria-label="Share" data-clipboard data-clipboard-text="" data-md-component="search-share" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.15c-.05.21-.08.43-.08.66 0 1.61 1.31 2.91 2.92 2.91s2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08"/></svg>
</a>
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../../../.." title="Khata App — Library Reference" class="md-nav__button md-logo" aria-label="Khata App — Library Reference" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 8c0 2.21-1.79 4-4 4s-4-1.79-4-4 1.79-4 4-4 4 1.79 4 4m0 6.72V20H0v-2c0-2.21 3.13-4 7-4 1.5 0 2.87.27 4 .72M24 20H13V3h11zm-8-8.5a2.5 2.5 0 0 1 5 0 2.5 2.5 0 0 1-5 0M22 7a2 2 0 0 1-2-2h-3c0 1.11-.89 2-2 2v9a2 2 0 0 1 2 2h3c0-1.1.9-2 2-2z"/></svg>
</a>
Khata App — Library Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../../.." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
<div class="md-nav__link md-nav__container">
<a href="../../../" class="md-nav__link ">
<span class="md-ellipsis">
Domain
</span>
</a>
<label class="md-nav__link " for="__nav_2" id="__nav_2_label" tabindex="">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Domain
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../../enrichment/" class="md-nav__link">
<span class="md-ellipsis">
Enrichment
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../" class="md-nav__link">
<span class="md-ellipsis">
Fetch Pipeline
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../../fetch_request/" class="md-nav__link">
<span class="md-ellipsis">
Fetch Request
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
<div class="md-nav__link md-nav__container">
<a href="../../../../infra/" class="md-nav__link ">
<span class="md-ellipsis">
Infra
</span>
</a>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Infra
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
<div class="md-nav__link md-nav__container">
<a href="../../../../interfaces/" class="md-nav__link ">
<span class="md-ellipsis">
Interfaces
</span>
</a>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Interfaces
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
<div class="md-nav__link md-nav__container">
<a href="../../../../pipelines/" class="md-nav__link ">
<span class="md-ellipsis">
Pipelines
</span>
</a>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Pipelines
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#domain.fetch_pipeline.utils.pipeline" class="md-nav__link">
<span class="md-ellipsis">
pipeline
</span>
</a>
<nav class="md-nav" aria-label="pipeline">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#domain.fetch_pipeline.utils.pipeline--summary" class="md-nav__link">
<span class="md-ellipsis">
Summary
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#domain.fetch_pipeline.utils.pipeline--notes" class="md-nav__link">
<span class="md-ellipsis">
Notes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#domain.fetch_pipeline.utils.pipeline-classes" class="md-nav__link">
<span class="md-ellipsis">
Classes
</span>
</a>
<nav class="md-nav" aria-label="Classes">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator" class="md-nav__link">
<span class="md-ellipsis">
PipelineOrchestrator
</span>
</a>
<nav class="md-nav" aria-label="PipelineOrchestrator">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator-functions" class="md-nav__link">
<span class="md-ellipsis">
Functions
</span>
</a>
<nav class="md-nav" aria-label="Functions">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.run_pipeline" class="md-nav__link">
<span class="md-ellipsis">
run_pipeline
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#domain.fetch_pipeline.utils.pipeline-functions" class="md-nav__link">
<span class="md-ellipsis">
Functions
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="pipeline">Pipeline</h1>
<div class="doc doc-object doc-module">
<h2 id="domain.fetch_pipeline.utils.pipeline" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">domain.fetch_pipeline.utils.pipeline</span>
</h2>
<div class="doc doc-contents first">
<h3 id="domain.fetch_pipeline.utils.pipeline--summary">Summary</h3>
<p>Pipeline orchestration for fetch requests.</p>
<p>Drives extraction stages (pdf, email, tabular, llama), persists partial
output on every stage, pauses on ambiguity, enriches raw expenses, saves
expense documents, and emits SSE progress events. The orchestrator
depends on injected services and the fetch pipeline ports.</p>
<hr />
<h3 id="domain.fetch_pipeline.utils.pipeline--notes">Notes</h3>
<p><strong>Guarantees:</strong></p>
<ul>
<li>The orchestrator never touches I/O infrastructure directly; fetch,
persistence, enrichment and messaging all flow through the injected
services and ports.</li>
</ul>
<p><strong>Lifecycle:</strong></p>
<ul>
<li>A pause re-raises <code>PauseForResolution</code> after saving the paused
request state; the caller decides whether to resume later.</li>
</ul>
<div class="doc doc-children">
<h3 id="domain.fetch_pipeline.utils.pipeline-classes">Classes</h3>
<div class="doc doc-object doc-class">
<h4 id="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">PipelineOrchestrator</span>
</h4>
<div class="language-python doc-signature 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>
<span class="normal"><a href="#__codelineno-0-12">12</a></span>
<span class="normal"><a href="#__codelineno-0-13">13</a></span>
<span class="normal"><a href="#__codelineno-0-14">14</a></span>
<span class="normal"><a href="#__codelineno-0-15">15</a></span>
<span class="normal"><a href="#__codelineno-0-16">16</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="nf">PipelineOrchestrator</span><span class="p">(</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2"></a> <span class="n">fr_svc</span><span class="p">,</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3"></a> <span class="n">ambiguity_svc</span><span class="p">,</span>
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4"></a> <span class="n">expense_svc</span><span class="p">,</span>
</span><span id="__span-0-5"><a id="__codelineno-0-5" name="__codelineno-0-5"></a> <span class="n">pdf_fetcher</span><span class="p">:</span> <span class="n">PdfFetcher</span><span class="p">,</span>
</span><span id="__span-0-6"><a id="__codelineno-0-6" name="__codelineno-0-6"></a> <span class="n">email_fetcher</span><span class="p">:</span> <span class="n">EmailFetcher</span><span class="p">,</span>
</span><span id="__span-0-7"><a id="__codelineno-0-7" name="__codelineno-0-7"></a> <span class="n">xlsx_fetcher</span><span class="p">:</span> <span class="n">XlsxFetcher</span><span class="p">,</span>
</span><span id="__span-0-8"><a id="__codelineno-0-8" name="__codelineno-0-8"></a> <span class="n">csv_fetcher</span><span class="p">:</span> <span class="n">CsvFetcher</span><span class="p">,</span>
</span><span id="__span-0-9"><a id="__codelineno-0-9" name="__codelineno-0-9"></a> <span class="n">sse</span><span class="p">:</span> <span class="n">ProgressEventBus</span><span class="p">,</span>
</span><span id="__span-0-10"><a id="__codelineno-0-10" name="__codelineno-0-10"></a> <span class="n">pause_on_ambiguity</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
</span><span id="__span-0-11"><a id="__codelineno-0-11" name="__codelineno-0-11"></a> <span class="n">resolver</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Callable</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
</span><span id="__span-0-12"><a id="__codelineno-0-12" name="__codelineno-0-12"></a> <span class="n">resolved_choices</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">dict</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
</span><span id="__span-0-13"><a id="__codelineno-0-13" name="__codelineno-0-13"></a> <span class="n">entity_svc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
</span><span id="__span-0-14"><a id="__codelineno-0-14" name="__codelineno-0-14"></a> <span class="n">tag_svc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
</span><span id="__span-0-15"><a id="__codelineno-0-15" name="__codelineno-0-15"></a> <span class="n">cache_store</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
</span><span id="__span-0-16"><a id="__codelineno-0-16" name="__codelineno-0-16"></a><span class="p">)</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Orchestrate extraction, enrichment and persistence for a fetch request.</p>
<p>Drives the extraction root over fetched content, persists partial
stage output, pauses on ambiguity, enriches raw expenses, saves
expense documents through the injected services, and streams progress
events via the SSE bus.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.fr_svc">fr_svc</span></code></td>
<td>
</td>
<td>
<div class="doc-md-description">
<p>Fetch request service used to read and save the request.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.ambiguity_svc">ambiguity_svc</span></code></td>
<td>
</td>
<td>
<div class="doc-md-description">
<p>Service persisting ambiguity records.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.expense_svc">expense_svc</span></code></td>
<td>
</td>
<td>
<div class="doc-md-description">
<p>Service creating expense documents.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.pdf_fetcher">pdf_fetcher</span></code></td>
<td>
<code><a class="autorefs autorefs-internal" title="domain.fetcher.ports.pdf.PdfFetcher" href="../../../fetcher/ports/pdf/#domain.fetcher.ports.pdf.PdfFetcher">PdfFetcher</a></code>
</td>
<td>
<div class="doc-md-description">
<p>Fetcher for PDF sources.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.email_fetcher">email_fetcher</span></code></td>
<td>
<code><a class="autorefs autorefs-internal" title="domain.fetcher.ports.email.EmailFetcher" href="../../../fetcher/ports/email/#domain.fetcher.ports.email.EmailFetcher">EmailFetcher</a></code>
</td>
<td>
<div class="doc-md-description">
<p>Fetcher for email sources.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.xlsx_fetcher">xlsx_fetcher</span></code></td>
<td>
<code><a class="autorefs autorefs-internal" title="domain.fetcher.ports.file.XlsxFetcher" href="../../../fetcher/ports/file/#domain.fetcher.ports.file.XlsxFetcher">XlsxFetcher</a></code>
</td>
<td>
<div class="doc-md-description">
<p>Fetcher for xlsx sources.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.csv_fetcher">csv_fetcher</span></code></td>
<td>
<code><a class="autorefs autorefs-internal" title="domain.fetcher.ports.file.CsvFetcher" href="../../../fetcher/ports/file/#domain.fetcher.ports.file.CsvFetcher">CsvFetcher</a></code>
</td>
<td>
<div class="doc-md-description">
<p>Fetcher for csv sources.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.sse">sse</span></code></td>
<td>
<code><a class="autorefs autorefs-internal" title="domain.fetch_pipeline.ports.messaging.ProgressEventBus" href="../../ports/messaging/#domain.fetch_pipeline.ports.messaging.ProgressEventBus">ProgressEventBus</a></code>
</td>
<td>
<div class="doc-md-description">
<p>Bus streaming progress events.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.pause_on_ambiguity">pause_on_ambiguity</span></code></td>
<td>
<code>bool</code>
</td>
<td>
<div class="doc-md-description">
<p>Whether ambiguity is paused for resolution.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.resolver">resolver</span></code></td>
<td>
</td>
<td>
<div class="doc-md-description">
<p>Optional ambiguity resolver callback.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.resolved_choices">resolved_choices</span></code></td>
<td>
<code>dict</code>
</td>
<td>
<div class="doc-md-description">
<p>Pre-chosen ambiguity resolutions.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.entity_svc">entity_svc</span></code></td>
<td>
</td>
<td>
<div class="doc-md-description">
<p>Optional entity service used for expense creation.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.tag_svc">tag_svc</span></code></td>
<td>
</td>
<td>
<div class="doc-md-description">
<p>Optional tag service used for expense creation.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.cache_store">cache_store</span></code></td>
<td>
</td>
<td>
<div class="doc-md-description">
<p>Optional read-cache store invalidated after saving.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
<h5 id="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator-functions">Functions</h5>
<div class="doc doc-object doc-function">
<h6 id="domain.fetch_pipeline.utils.pipeline.PipelineOrchestrator.run_pipeline" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">run_pipeline</span>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-async"><code>async</code></small>
</span>
</h6>
<div class="language-python doc-signature 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><span class="nf">run_pipeline</span><span class="p">(</span><span class="n">fr_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Run the full fetch pipeline for a request.</p>
<p>Reads the request, builds the extractor, fetches content, extracts
raw expenses, enriches them, and persists expense documents.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>fr_id</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Fetch request id.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Name</th> <th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>None</code></td> <td>
<code>None</code>
</td>
<td>
<div class="doc-md-description">
<p>Nothing.</p>
</div>
</td>
</tr>
</tbody>
</table>
<details class="notes" open>
<summary>Notes</summary>
<p>An ambiguity pause is re-raised as <code>PauseForResolution</code>
after the paused state has been saved.</p>
</details>
</div>
</div>
</div>
</div>
</div>
<h3 id="domain.fetch_pipeline.utils.pipeline-functions">Functions</h3>
</div>
</div>
</div>
</article>
</div>
<script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
Back to top
</button>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../../../..", "features": ["navigation.sections", "navigation.expand", "navigation.top", "navigation.instant", "navigation.tracking", "navigation.indexes", "content.code.copy", "content.code.annotate", "content.tabs.link", "content.action.edit", "search.highlight", "search.share", "search.suggest"], "search": "../../../../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script src="../../../../assets/javascripts/bundle.f55a23d4.min.js"></script>
</body>
</html>