-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from dumbPy/documentation/importer-source
Add ImporterSource to Readme and examples
- Loading branch information
Showing
10 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"Date","Description","Amount" | ||
2020-01-01,by debit card-OTHPG 063441 GOOGLE CLOUD,-1 | ||
2020-01-01,by debit card-OTHPG 063444 GOOGLE CLOUD,-1 | ||
2020-01-02,BULK POSTING- 00000008237 250120 GOOGLE,1 | ||
2020-01-02,ATM-WD Some Random ATM Machine,-500 | ||
2020-01-02,BULK POSTING- 00000008237 250120 GOOGLE,1 | ||
2020-01-05,Transfer to 1234567890123,300 | ||
2020-01-14,Transfer to Amex 431145642232,-30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Credit Card Number: 1234XXXXXXXX7890 | ||
Date,Description,Amount,Balance | ||
2020-01-10,Amazon Order 54429302,-15.5,-35.5 | ||
2020-01-15,Payment Received,30,-5.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
This config is where you would initialize your importers with personal info | ||
like account number or credit card last4 digit. | ||
you may also define CONFIG:List[ImporterProtocol] for other beancount tools like | ||
bean-identify, bean-file, and other beancount scripts to use | ||
eg. `bean-identify _config.py ~/Downloads` | ||
to identify the files that importers defined here can process | ||
beancount-import should have it's own run.py where you invoke the | ||
`beancount_import.webserver.main` but import the Importer objects from this config | ||
This is the way!! | ||
""" | ||
from beancount.ingest.importers.csv import Importer as CSVImporter, Col | ||
|
||
my_foobar_bank_importer = CSVImporter({ | ||
Col.DATE: 'Date', | ||
Col.NARRATION1: 'Description', | ||
Col.AMOUNT: 'Amount', | ||
}, | ||
'Assets:FooBarBank', # account | ||
'EUR', # currency | ||
# regexps used by ImporterProtocol.identify() to identify the correct file | ||
'"Date","Description","Amount"', | ||
) | ||
|
||
my_amex_cc_importer = CSVImporter({ | ||
Col.DATE: 'Date', | ||
Col.NARRATION1: 'Description', | ||
Col.AMOUNT: 'Amount', | ||
Col.BALANCE:'Balance' | ||
}, | ||
'Liabilities:Amex-Credit-Card', # account | ||
'EUR', # currency | ||
# regexps used by ImporterProtocol.identify() to identify the correct file | ||
('Date,Description,Amount,Balance', | ||
'Credit.*7890' | ||
), | ||
skip_lines=1 | ||
) | ||
|
||
# beancount's scripts use this | ||
CONFIG = [my_foobar_bank_importer, my_amex_cc_importer] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
""" | ||
This config is where you would initialize your importers with personal info | ||
like account number or credit card last4 digit. | ||
you may also define CONFIG:List[ImporterProtocol] for other beancount tools like | ||
bean-identify, bean-file, and other beancount scripts to use | ||
eg. `bean-identify _config.py ~/Downloads` | ||
to identify the files that importers defined here can process | ||
beancount-import should have it's own run.py where you invoke the | ||
`beancount_import.webserver.main` but import the Importer objects from this config | ||
This is the way!! | ||
""" | ||
from beancount.ingest.importers.csv import Importer as CSVImporter, Col | ||
|
||
my_foobar_bank_importer = CSVImporter({ | ||
Col.DATE: 'Date', | ||
Col.NARRATION1: 'Description', | ||
Col.AMOUNT: 'Amount', | ||
}, | ||
'Assets:FooBarBank', # account | ||
'EUR', # currency | ||
# regexps used by ImporterProtocol.identify() to identify the correct file | ||
'"Date","Description","Amount"', | ||
) | ||
|
||
my_amex_cc_importer = CSVImporter({ | ||
Col.DATE: 'Date', | ||
Col.NARRATION1: 'Description', | ||
Col.AMOUNT: 'Amount', | ||
Col.BALANCE:'Balance' | ||
}, | ||
'Liabilities:Amex-Credit-Card', # account | ||
'EUR', # currency | ||
# regexps used by ImporterProtocol.identify() to identify the correct file | ||
('Date,Description,Amount,Balance', | ||
'Credit.*7890' | ||
), | ||
skip_lines=1 | ||
) | ||
# beancount's scripts use this | ||
CONFIG = [my_foobar_bank_importer, my_amex_cc_importer] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters