-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let CSV importer support tab-separated files #85
Comments
There is an argument to CSV importer - csv_dialect. It allows you to define your own way to parse your csv file (on the positive side, it is the part of the Python standard library), see https://docs.python.org/3/library/csv.html#csv-fmt-params . Simple example of the configuration file from beancount.ingest.importers import csv
from csv import register_dialect
register_dialect('own', 'excel', delimiter='\t')
CONFIG = [csv.Importer({csv.Col.DATE: 'Booking Date',
csv.Col.PAYEE: 'Beneficiary',
csv.Col.AMOUNT:'Amount'},
'Assets:CZ:Unicredit:Current', 'CZK',
csv_dialect='own')] |
This issue should be moved to beangulp. |
@jarifuri, I don't think this problem can be solved by passing beangulp/beangulp/importers/csv.py Line 181 in 44d235b
|
I don't see anything wrong with overriding the mime type matching in a subclass. Anyhow, the this CSV importer is deprecated and replaced by |
Would it be possible for the CSV importer to support tab-separated files as well? Currently the 'text/csv' MIME type seems hardcoded.
While I could monkey patch it with
self.remap['mime'] = [re.compile('text/tab-separated-values')]
in my subclass'__init__()
, it'd be rather ugly.The text was updated successfully, but these errors were encountered: