csb43.ofx¶
Partial implementation of a OFX file writer.
This package is not intended to fully implement the OFX Spec. Its final purpose is the conversion from CSB43 (norma 43 del Consejo Superior Bancario). That is, only transaction response is (partially) implemented.
References
- class csb43.ofx.Balance(tag_name='bal', sgml=False, _elem_f=<function xml_element>, _aggr_f=<function xml_aggregate>, amount=None, date=None)¶
A balance.
See [OFX] 11.4.4.1
- Parameters:
tag_name (str)
sgml (bool)
_elem_f (Callable[[str, Any | None], str])
_aggr_f (Callable[[str, Any | None], str])
amount (int | float | Decimal | None)
date (datetime | date | None)
- __str__()¶
Return the XML representation of the object.
- Return type:
str
- amount: int | float | Decimal | None = None¶
field <BALAMT>
- date: datetime | date | None = None¶
field <DTASOF>
- sgml: bool = False¶
convert to SGML instead of XML
- tag_name: str = 'bal'¶
name for the XML tag
- class csb43.ofx.BankAccount(tag_name='bankaccfrom', sgml=False, _elem_f=<function xml_element>, _aggr_f=<function xml_aggregate>, bank_id=None, branch_id=None, id=None, type='SAVINGS', key=None)¶
A bank account.
See [OFX] 11.3.1 Banking Account
- Parameters:
tag_name (str)
sgml (bool)
_elem_f (Callable[[str, Any | None], str])
_aggr_f (Callable[[str, Any | None], str])
bank_id (str | None)
branch_id (str | None)
id (str | None)
type (str)
key (str | None)
- __str__()¶
Return the XML representation of the object.
- Return type:
str
- bank_id: str | None = None¶
banco, entidad)
- Type:
BANKID bank identifier (Spain
- branch_id: str | None = None¶
sucursal, oficina)
- Type:
BRANCHID branch identifier (Spain
- id: str | None = None¶
ACCTID account identifier
- key: str | None = None¶
digitos de control)
- Type:
ACCTKEY checksum (Spain
- sgml: bool = False¶
convert to SGML instead of XML
- tag_name: str = 'bankaccfrom'¶
name for the XML tag
- type: str = 'SAVINGS'¶
ACCTTYPE type of account.
- class csb43.ofx.File(tag_name='ofx', sgml=False, _elem_f=<function xml_element>, _aggr_f=<function xml_aggregate>, responses=<factory>)¶
An OFX file.
See [OFX] 2.4.1
- Parameters:
tag_name (str)
sgml (bool)
_elem_f (Callable[[str, Any | None], str])
_aggr_f (Callable[[str, Any | None], str])
responses (list[Response])
- __str__()¶
Return the XML representation of the object.
- Return type:
str
- sgml: bool = False¶
convert to SGML instead of XML
- tag_name: str = 'ofx'¶
name for the XML tag
- class csb43.ofx.Payee(tag_name='payeeid', sgml=False, _elem_f=<function xml_element>, _aggr_f=<function xml_aggregate>, name=None, payee=None, extended_name=None)¶
Payee info.
- Parameters:
tag_name (str)
sgml (bool)
_elem_f (Callable[[str, Any | None], str])
_aggr_f (Callable[[str, Any | None], str])
name (str | None)
payee (str | None)
extended_name (str | None)
- __str__()¶
Return the XML representation of the object.
- Return type:
str
- extended_name: str | None = None¶
field <EXTDNAME>
- name: str | None = None¶
field <NAME>
- payee: str | None = None¶
field <PAYEE>
- sgml: bool = False¶
convert to SGML instead of XML
- tag_name: str = 'payeeid'¶
name for the XML tag
- class csb43.ofx.Response(tag_name='stmtrs', sgml=False, _elem_f=<function xml_element>, _aggr_f=<function xml_aggregate>, currency=None, account_from=None, transaction_list=None, ledger_balance=None, available_balance=None, balances=<factory>, mktginfo=None)¶
A response object.
STMTRS
See [OFX] 11.4.2.2 Response
- Parameters:
tag_name (str)
sgml (bool)
_elem_f (Callable[[str, Any | None], str])
_aggr_f (Callable[[str, Any | None], str])
currency (AnyCurrency | None)
account_from (BankAccount | None)
transaction_list (TransactionList | None)
ledger_balance (Balance | None)
available_balance (Balance | None)
balances (list[Balance])
mktginfo (Any | None)
- __str__()¶
Return the XML representation of the object.
- Return type:
str
- sgml: bool = False¶
convert to SGML instead of XML
- tag_name: str = 'stmtrs'¶
name for the XML tag
- class csb43.ofx.SignOnResponse(tag_name='sonrs', sgml=False, _elem_f=<function xml_element>, _aggr_f=<function xml_aggregate>)¶
A SignOnResponse object.
SONRS
See [OFX] 2.5.1
- Parameters:
tag_name (str)
sgml (bool)
_elem_f (Callable[[str, Any | None], str])
_aggr_f (Callable[[str, Any | None], str])
- __str__()¶
Return the XML representation of the object.
- Return type:
str
- sgml: bool = False¶
convert to SGML instead of XML
- tag_name: str = 'sonrs'¶
name for the XML tag
- class csb43.ofx.Transaction(tag_name='stmttrn', sgml=False, _elem_f=<function xml_element>, _aggr_f=<function xml_aggregate>, type='OTHER', date_posted=None, date_initiated=None, date_available=None, amount=None, transaction_id=None, correct_fit_id=None, correct_action=None, server_tid=None, check_num=None, ref_num=None, standard_industrial_code=None, payee=None, bank_account_to=None, cc_account_to=None, memo=None, image_data=None, origin_currency=None, origin_amount=None, inv401ksource=None, payeeid=None, name=None, extended_name=None)¶
An OFX transaction.
See [OFX] 11.4.4.1
- Parameters:
tag_name (str)
sgml (bool)
_elem_f (Callable[[str, Any | None], str])
_aggr_f (Callable[[str, Any | None], str])
type (str)
date_posted (datetime | date | None)
date_initiated (datetime | date | None)
date_available (datetime | date | None)
amount (int | float | Decimal | None)
transaction_id (str | None)
correct_fit_id (str | None)
correct_action (str | None)
server_tid (str | None)
check_num (str | None)
ref_num (str | None)
standard_industrial_code (str | None)
payee (Payee | None)
bank_account_to (BankAccount | None)
cc_account_to (BankAccount | None)
memo (str | None)
image_data (Any | None)
origin_currency (AnyCurrency | None)
origin_amount (int | float | Decimal | None)
inv401ksource (Any | str)
payeeid (str | None)
name (str | None)
extended_name (str | None)
- __str__()¶
Return the XML representation of the object.
- Return type:
str
- sgml: bool = False¶
convert to SGML instead of XML
- tag_name: str = 'stmttrn'¶
name for the XML tag
- class csb43.ofx.TransactionList(tag_name='banktranlist', sgml=False, _elem_f=<function xml_element>, _aggr_f=<function xml_aggregate>, date_start=None, date_end=None, transactions=<factory>)¶
Transaction list aggregate.
- Parameters:
tag_name (str)
sgml (bool)
_elem_f (Callable[[str, Any | None], str])
_aggr_f (Callable[[str, Any | None], str])
date_start (datetime | date | None)
date_end (datetime | date | None)
transactions (list[Transaction])
- __str__()¶
Return the XML representation of the object.
- Return type:
str
- sgml: bool = False¶
convert to SGML instead of XML
- tag_name: str = 'banktranlist'¶
name for the XML tag
Converter¶
Conversion from AEB43 to OFX.
- csb43.ofx.converter.convert_from_aeb43(batch, sgml=False)¶
Convert an AEB43 batch to OFX.
Use sgml=True in order to generate SGML instead of XML
- csb43.ofx.converter.PAYMODES = {1: TransactionType.CHECK, 2: TransactionType.CREDIT, 3: TransactionType.SRVCHG, 4: TransactionType.XFER, 5: TransactionType.DIV, 7: TransactionType.REPEATPMT, 8: TransactionType.FEE, 9: TransactionType.DIV, 10: TransactionType.CHECK, 11: TransactionType.ATM, 12: TransactionType.POS, 15: TransactionType.XFER, 17: TransactionType.INT, 99: TransactionType.OTHER}¶
conversion table OFX - Homebank for pay modes