New issue 200: Expose csv.Dialect in beancount.ingest.importers.csv.Importer
https://bitbucket.org/blais/beancount/issues/200/expose-csvdialect-in

Johannes Harms:

I have been playing around with the CSV importer provided in 
`beancount.ingest.importers.csv.Importer`, trying to import CSV like the 
following example data mimicking by bank's csv format:

```
DE40100100100000012345;Paying the rent;04.09.2017;04.09.2017;-800,00;EUR
DE40100100100000012345;Transfering accumulated savings to other 
account;05.09.2017;05.09.2017;-2500,00;EUR
DE40100100100000012345;Payroll;04.09.2017;04.09.2017;2000,00;EUR
```

One specialty of the above CSV is that it uses semicolons instead of commas as 
column separators. My suggestion is: This could easily be configured by passing 
a `csv.Dialect` to the beancount csv importer. E.g., by adding an additional 
parameter to its `__init__` method, as follows

```python
class Importer(regexp.RegexpImporterMixin, importer.ImporterProtocol):

    def __init__(self, config, account, currency, regexps,
                 institution=None,
                 debug=False,
                 csv_dialect : Union[str, csv.Dialect] ='excel'):
```

I have tried it out already, which means I can contribute a merge request. 
(I'll push it in a few minutes).

Responsible: blais

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20171112223018.14302.93574%40celery-worker-107.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to