Hi all,
I am wiriting an importer using the shipped CSV one. I wonder what's the
proper way to read the row in the categorizer. Here is my current method:
def categorizer(txn, row) -> Transaction:
# Fees column must be included to get correct balance
if self.parse_amount(row[17]): # Fee
create_simple_posting(
entry=txn,
account='Expenses:Financial:Fees',
number=-(self.parse_amount(row[17])),
currency=currency
)
create_simple_posting(
entry=txn,
account=account,
number=self.parse_amount(row[17]),
currency=currency
)
# Balancing entry TODO: categorize
create_simple_posting(
entry=txn,
account='Equity:Opening-Balances',
number=None,
currency=None
)
return txn
You need column index. Currently I can only hardcode it, which is not
great. I could get it mapped in `iconfig`, simply pass something like
`{ExtCol.Fee: fee_column_name}` in `config`, but I cannot get to `iconfig`
in my class.
Is there currently any alternative?
Thanks,
Vlad
--
You received this message because you are subscribed to the Google Groups
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/ccec3237-7aed-49d3-8335-e9ed1ea27d64n%40googlegroups.com.