tariochbctools.importers.quickfile package

Submodules

tariochbctools.importers.quickfile.importer module

class tariochbctools.importers.quickfile.importer.Importer[source]

Bases: ImporterProtocol

An importer for QuickFile

extract(file, existing_entries=None)[source]

Extract transactions from a file.

If the importer would like to flag a returned transaction as a known duplicate, it may opt to set the special flag “__duplicate__” to True, and the transaction should be treated as a duplicate by the extraction code. This is a way to let the importer use particular information about previously imported transactions in order to flag them as duplicates. For example, if an importer has a way to get a persistent unique id for each of the imported transactions. (See this discussion for context: https://groups.google.com/d/msg/beancount/0iV-ipBJb8g/-uk4wsH2AgAJ)

Parameters:
  • file – A cache.FileMemo instance.

  • existing_entries – An optional list of existing directives loaded from the ledger which is intended to contain the extracted entries. This is only provided if the user provides them via a flag in the extractor program.

Returns:

A list of new, imported directives (usually mostly Transactions) extracted from the file.

file_account(file)[source]

Return an account associated with the given file.

Note: If you don’t implement this method you won’t be able to move the files into its preservation hierarchy; the bean-file command won’t work.

Also, normally the returned account is not a function of the input file–just of the importer–but it is provided anyhow.

Parameters:

file – A cache.FileMemo instance.

Returns:

The name of the account that corresponds to this importer.

identify(file)[source]

Return true if this importer matches the given file.

Parameters:

file – A cache.FileMemo instance.

Returns:

A boolean, true if this importer can handle this file.

class tariochbctools.importers.quickfile.importer.QuickFile(account_number, api_key, app_id)[source]

Bases: object

Encapsulate QuickFile API protocol and data types

API_VERSION_SLUG = '1_2'
DOMAIN = 'quickfile.co.uk'
static auth_md5(account_number, api_key, submission_number)[source]
request_header()[source]
class tariochbctools.importers.quickfile.importer.QuickFileBankSearch(MetaData, Transactions)[source]

Bases: NamedTuple

MetaData: QuickFileResponseMetaData

Alias for field number 0

Transactions: Dict[str, List[QuickFileTransaction]]

Alias for field number 1

class tariochbctools.importers.quickfile.importer.QuickFileResponseMetaData(RecordsetCount, ReturnCount, BankName, BankType, AccountNo, SortCode, Currency, CurrentBalance)[source]

Bases: NamedTuple

AccountNo: str

Alias for field number 4

BankName: str

Alias for field number 2

BankType: str

Alias for field number 3

Currency: str

Alias for field number 6

CurrentBalance: str

Alias for field number 7

RecordsetCount: int

Alias for field number 0

ReturnCount: int

Alias for field number 1

SortCode: str

Alias for field number 5

class tariochbctools.importers.quickfile.importer.QuickFileTransaction(TransactionDate: str, Reference: str, Amount: str, TagStatus: str, TransactionId: str)[source]

Bases: NamedTuple

Transaction data from QuickFile transaction API

Amount: str

Alias for field number 2

Reference: str

Alias for field number 1

TagStatus: str

Alias for field number 3

TransactionDate: str

Alias for field number 0

TransactionId: str

Alias for field number 4

to_beancount_transaction(local_account, currency, invert_sign=False)[source]

Module contents