Hi Alessandro,
On 26-11-2018 16:03,
alessandr...@runbox.com wrote:
> I'm in the process of writing an importer for a CSV obtained from a bank. While I don't have a problem handling most of the transaction information, the file also contains some extra data that I would like to keep as metadata (for the relevant transactions). However, I can't seem to find a way to do this. Does the importer framework from beancount.ingest allow to include metadata with parsed transactions?
The constructor for a transactions (and most other directives) takes a
dictionary as a `meta` parameter. All keys in this dictionary (except
'filename' and 'lineno') are translated into metadata attached to the
directive. For example I use this to record an unique identifier for
each transaction, using the "transaction id" assigned to the transaction
by the bank, or similar mechanism.
> Also, could you explain to me which data is better represented as a tag, and which as a link? I'm sure this should have popped up time and again, but I couldn't find a satisfactory answer after looking through the documentation and the mailing list archives.
There are some hints on how to use those features in the Tags ans Links
sections of the Language Syntax document:
http://furius.ca/beancount/doc/syntax.
There is not an unique way of using links and tags (as is the case with
other pieces of information attached to transactions). Links are more
appropriate to link a set of transactions together, while tags are more
of a categorization feature.
In general I would not worry too much about how you record (or don't)
the information. It is very easy to refactor the input files at a later
stage if you will find that initial choices will not allow to perform
some operation in the future. Just start using the basic features and
evolve over time.
Cheers,
Dan