Enrichment
domain.fetch_pipeline.ports.enrichment
Summary
Enrichment port for the fetch pipeline: orchestrates entity and tag pipelines over raw expenses.
Adapts the domain fetch-request models to the enrichment pipeline state payloads and back to enriched expenses.
Classes
EnrichmentOrchestratorAdaptor
Drive entity and tag enrichment for raw expenses.
Runs the entity pipeline over a raw expense state payload, builds an
EnrichedExpense, then runs the tags pipeline over its payload and
fills the tag list.
Attributes:
| Name | Type | Description |
|---|---|---|
entity_pipeline |
Pipeline resolving the payee entity; defaults to the cached entity pipeline. |
|
tags_pipeline |
Pipeline resolving tags; defaults to the cached tags pipeline. |
Functions
enrich
async
Enrich a raw expense into an enriched expense.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw |
RawExpense
|
Raw expense parsed from the statement. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
EnrichedExpense |
EnrichedExpense
|
The enriched expense with payee, entity |
EnrichedExpense
|
metadata and tags. |
Functions
get_enrichment_orchestrator
Build an enrichment orchestrator adaptor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs |
Optional |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
EnrichmentOrchestratorAdaptor |
EnrichmentOrchestratorAdaptor
|
A configured orchestrator. |