Open mbkamble opened 6 years ago
Hi Milind,
here is my import configuration file (with some private info blanked out). I hope it can help,
fxt
"""Import configuration."""
from beancount import loader from beancount.ingest import extract from beancount.ingest.importers import ofx from beansoup import transactions from beansoup.importers import amex, filing, mixins, td
existingentries, , _ = loader.load_file('my.beancount')
min_score, max_age, interpolated = 0.5, None, False
class OfxImporter(mixins.FilterChain, ofx.Importer): pass
class TDImporter(mixins.FilterChain, td.Importer): pass
CONFIG = [
TDImporter("Assets:CA:Banking:TD:BusinessChequing",
"CAD",
"td-biz-checking",
first_day=1,
filename_regexp="TD-service-plan-1-\d{4}.csv",
filters=[transactions.TransactionCompleter(
existing_entries,
"Assets:CA:Banking:TD:BusinessChequing",
min_score, max_age, interpolated)]),
TDImporter("Liabilities:CA:CreditCards:TD:Visa",
"CAD",
"td-visa",
first_day=12,
filename_regexp="TD-(gold-select-)?visa-\d{4}.csv",
filters=[transactions.TransactionCompleter(
existing_entries,
"Liabilities:CA:CreditCards:TD:Visa",
min_score, max_age, interpolated)]),
OfxImporter("1234567",
"Assets:CA:Banking:TD:AllInclusive",
"td-all-inclusive",
filters=[transactions.TransactionCompleter(
existing_entries,
"Assets:CA:Banking:TD:AllInclusive",
min_score, max_age, interpolated)]),
filing.Importer("Assets:CA:Banking:TD:AllInclusive",
"td-all-inclusive",
first_day=1,
filename_regexp='^TD_ALL-INCLUSIVE_BANKINGPLAN
1234567\w{3}\d{1,2}-(?P
extract.HEADER = ';; -- mode: org; mode: beancount; coding: utf-8; --\n'
On Tue, Jan 16, 2018 at 12:15 PM, Milind Kamble notifications@github.com wrote:
Hi. I am noob with Python class inheritance. I read about mixins and got a beginner level understanding. But I am having trouble integrating your mixin.FilterChain class with the ofx importert from beancount. Could you show me a sample config file to use with bean-extract to use the transactions.TransactionCompleter filter?
Thanks, Milind
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fxtlabs/beansoup/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AAt91jk4mdM5IppwZX-oMO7QZLgCrmTaks5tLNkqgaJpZM4RgH0Z .
Hi fxt. Sorry for such a huge delay in responding. I had no idea that you had responded promptly. Thanks for sharing a sample config file. It improves my understanding of python and the use of filterchain mixin in a big way.
Regards, Milind
Hi Filipp.
I reopened this issue to discuss/mention that I find the filterchain concept very useful in the manner you have articulated as a transaction completer. Have you reached out to the beancount maintainer (Martin Blais) to include it in codebase?
I have extended the usage mode of this concept to handle the case when bean-extract is run with the -f
In summary, I do like the idea of providing a transaction completer in form of a filterchain element because extract(fromnewfile) should only do the extraction without having to consider existing_entries.
I can share my changes with you if you want to see/review them.
Regards, Milind
Hi. I am noob with Python class inheritance. I read about mixins and got a beginner level understanding. But I am having trouble integrating your mixin.FilterChain class with the ofx importert from beancount. Could you show me a sample config file to use with bean-extract to use the transactions.TransactionCompleter filter?
Thanks, Milind