Hi,
I'm looking at some specific cases for importers and wondering what the
best way to tackle this is:
-API based import
For some transactions there's a REST api I can use to fetch the
transactions.
So there is no file to use with the bean-extract framework.
I currently created a custom script which works but I would like to
unify the different importers if possible.
- Using prices in imports
For some imports I would like to enhance the transactions with prices
based on current/daily price, I'm currently fetching and storing prices
in beancount, so prices are available in the beancount file but I'm not
sure what the best way to hook this into the importer framework is
How do you deal with things like that? Do you ignore bean-extract tools
and just create independent scripts?
Regards,
Patrick
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/29e70aca-b985-5291-38fc-93c2d80956d4%40ch.tario.org.
For more options, visit https://groups.google.com/d/optout.
Just got an idea for the api import (always getting those ideas after asking about it on a mailing list).
I just create a dummy file for the importer, this file can actually even be the config with api key and so on for doing the import
On Saturday, February 3, 2018 at 6:21:14 PM UTC+1, Patrick Ruckstuhl wrote:Hi,
I'm looking at some specific cases for importers and wondering what the
best way to tackle this is:
-API based import
For some transactions there's a REST api I can use to fetch the
transactions.
So there is no file to use with the bean-extract framework.
I currently created a custom script which works but I would like to
unify the different importers if possible.
- Using prices in imports
For some imports I would like to enhance the transactions with prices
based on current/daily price, I'm currently fetching and storing prices
in beancount, so prices are available in the beancount file but I'm not
sure what the best way to hook this into the importer framework is
How do you deal with things like that? Do you ignore bean-extract tools
and just create independent scripts?
Regards,
Patrick
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/718b5cc7-7298-4b42-8a48-28cca610f4f3%40googlegroups.com.
>- Using prices in imports
>>
>> For some imports I would like to enhance the transactions with prices
>> based on current/daily price, I'm currently fetching and storing
>prices
>> in beancount, so prices are available in the beancount file but I'm
>not
>> sure what the best way to hook this into the importer framework is
>>
>
>Fetching prices automatically /is/ OTOH intended to be automated.
>(Note that we're in a funny situation right now with both Yahoo and
>Finance APIs disabled.)
>
>These are two separate processes at the moment; run one, then the
>other.
>Concatenate to a file if you want to.
That's what I'm doing. What I'm looking is how to access the prices from the beancount file in the importer, do I have to parse/load the beancount file o my own?
>
>How do you deal with things like that? Do you ignore bean-extract tools
>> and just create independent scripts?
>>
>
>Yep.
>In any case you'll end up with a patchwork of scripts for part of the
>job,
>I just don't believe there's any way around it.
>You're welcome to try your hand at creating reusable code to do this,
>but
>IMO it's all over the place and would be very difficult.
>
>Another idea would be to reuse other people's work in automating
>fetching
>and converting to another common data format, e.g. Yodlee (costs money)
>or
>convert from a Mint download.
>
>
Yeah I see that. The concept of the common importer api is what makes sense for me. As this is then usable from fava and allows to avoid having to reimplement things like duplicate detection and auto discover of counter accounts
https://github.com/johannesjh/smart_importer
>
>> Regards,
>>
>> Patrick
>>
>>
>> --
>> 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+unsubscribe@googlegroups.com.
>> To post to this group, send email to bean...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/beancount/29e70aca-b985-5291-38fc-93c2d80956d4%40ch.tario.org.
>> For more options, visit https://groups.google.com/d/optout.
>>
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/5F43ED0D-F4AC-4445-8FC9-1E234E972994%40ch.tario.org.
>- Using prices in imports>>
>> For some imports I would like to enhance the transactions with prices
>> based on current/daily price, I'm currently fetching and storing
>prices
>> in beancount, so prices are available in the beancount file but I'm
>not
>> sure what the best way to hook this into the importer framework is
>>
>
>Fetching prices automatically /is/ OTOH intended to be automated.
>(Note that we're in a funny situation right now with both Yahoo and
>Finance APIs disabled.)
>
>These are two separate processes at the moment; run one, then the
>other.
>Concatenate to a file if you want to.
That's what I'm doing. What I'm looking is how to access the prices from the beancount file in the importer, do I have to parse/load the beancount file o my own?Yes.You'd call beancount.loader.load_file() on your existing file, and then build a price_map dict.Grep for "price_map" in the source code, you'll find several examples of doing that.