tariochbctools.importers.general package
Submodules
tariochbctools.importers.general.deduplication module
tariochbctools.importers.general.mailAdapterImporter module
- class tariochbctools.importers.general.mailAdapterImporter.MailAdapterImporter(importers: list[Importer])[source]
Bases:
Importer
An importer adapter that fetches file from mails and then calls another importer.
- account(filepath: str) str [source]
Return the account associated with the given file.
The account is used to determine the archival folder for the document. While the interface allows returning different accounts for different documents, normally the returned account is a just a function of the importer instance.
- Parameters:
filepath – Filesystem path to the document being imported.
- Returns:
An account name.
- extract(filepath: str, existing: list[Open | Close | Commodity | Pad | Balance | Transaction | Note | Event | Query | Price | Document | Custom]) list[Open | Close | Commodity | Pad | Balance | Transaction | Note | Event | Query | Price | Document | Custom] [source]
Extract transactions and other directives from a document.
The existing entries list is loaded from the existing ledger file, if the user specified one on the command line. It can be used to supplement the information provided by the document being processed to drive the extraction. For example to derive the prior state of the inventory.
- Parameters:
filepath – Filesystem path to the document being imported.
existing – Entries loaded from the existing ledger.
- Returns:
A list of imported directives extracted from the document.
tariochbctools.importers.general.mt940importer module
- class tariochbctools.importers.general.mt940importer.Importer(filepattern: str, account: str)[source]
Bases:
Importer
An importer for MT940 files.
- account(filepath: str) str [source]
Return the account associated with the given file.
The account is used to determine the archival folder for the document. While the interface allows returning different accounts for different documents, normally the returned account is a just a function of the importer instance.
- Parameters:
filepath – Filesystem path to the document being imported.
- Returns:
An account name.
- cmp = <tariochbctools.importers.general.deduplication.ReferenceDuplicatesComparator object>
- extract(filepath: str, existing: list[Open | Close | Commodity | Pad | Balance | Transaction | Note | Event | Query | Price | Document | Custom]) list[Open | Close | Commodity | Pad | Balance | Transaction | Note | Event | Query | Price | Document | Custom] [source]
Extract transactions and other directives from a document.
The existing entries list is loaded from the existing ledger file, if the user specified one on the command line. It can be used to supplement the information provided by the document being processed to drive the extraction. For example to derive the prior state of the inventory.
- Parameters:
filepath – Filesystem path to the document being imported.
existing – Entries loaded from the existing ledger.
- Returns:
A list of imported directives extracted from the document.