On Sunday, April 8, 2018 at 10:46:30 AM UTC+2, Martin Blais wrote:
>
> On Sun, Apr 8, 2018 at 3:17 AM, viq <vic...@gmail.com <javascript:>> 
> wrote:
>
>>
>>
>> On Sunday, April 8, 2018 at 1:55:42 AM UTC+2, Michael Droogleever wrote:
>>>
>>> I think it is this, but I have not tried running your code:
>>>  
>>>
>>>> sys.path.insert(0, path.join(path.dirname(__file__))) 
>>>
>>>
>>> is what adds the path to your importers package, to the system path. So 
>>> the
>>>
>>> import importers.mybank
>>>>
>>>
>>> Needs to be after it. It is admittedly not correct python style, as 
>>> imports should always come first, but it is a workaround beancount uses to 
>>> be able to read your custom code. 
>>>
>>
>>> Good luck.
>>>
>>
>> Indeed, with that change it doesn't complain about imports now, thank 
>> you! Apparently the same can be achieved by setting PYTHONPATH.
>>
>
> Yes.
>
> I think we talked about adding the importer file's location automatically 
> to PYTHONPATH, here:
>
> https://bitbucket.org/blais/beancount/issues/214/add-top-level-directory-to-syspath
> Not done yet
>
>  
>
>>
>> Now to figure out why nothing happens when I run bean-extract 
>>
>
> Run bean-identify first. If it doesn't list the file, it hasn't identified 
> it as  something the importer can extract from.
>
> It uses the regexps you provide to match against the contents of the CSV 
> file.
> I see a typo in your code, which probably explains why it doesn't match it:
>  
> Transacton Date
>

Thanks, fixed, didn't seem to help though. bean-identify seems to work fine:
$ bean-identify test.config.py bank_history_sample.csv
**** /home/viq/Work/Own/beancount/bank_history_sample.csv
yet bean-extract does nothing:
$ bean-extract test.config.py bank_history_sample.csv
;; -*- mode: beancount -*-
**** /home/viq/Work/Own/beancount/bank_history_sample.csv

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/163c3c90-1c68-4e46-bcfc-96351f2bd688%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to