Skip to content
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

Import beancount metadata #20

Open
vikasrawal opened this issue May 16, 2024 · 3 comments
Open

Import beancount metadata #20

vikasrawal opened this issue May 16, 2024 · 3 comments

Comments

@vikasrawal
Copy link

Is there support for reading metadata? I can't see the metadata in the beancount file I am reading with ledger. Unless I am missing something.

@trevorld
Copy link
Owner

  • Currently there is no support for reading metadata. Currently we simply generate a csv file using a tuned bean-query command and import that csv data as a data frame.
  • What metadata are you interested in?
  • Does beancount have a command-line program that outputs that metadata in an easy machine-readable format?

@trevorld trevorld changed the title Metadata Import beancount metadata May 16, 2024
@vikasrawal
Copy link
Author

The beancount query can be modified to read the metadata. For example, the following query, reads "document" metadata. Since each user is expected to have have custom metadata tags, it would be desirable to get the user to specify which metadata tags the user wants to import.

paste("select date, flag as mark, account, payee,",
"narration as description,",
"number as amount, currency as commodity,",
"tags,","id,","any_meta('document')")->query

@trevorld
Copy link
Owner

  • Looks like the any_meta("requested_metadata") functionality was added a while ago but isn't documented in the Beancount Query Language document.
  • Some examples in this commit: beancount/beancount@30c2b4d .
  • If we were to support this the user may need to specify the tags to grab and possibly what column name to save them to (and check they don't conflict with any existing columns).
  • We'd also need to update the unit tests to add and test this metadata feature.
  • What happens if the key argument for any_meta() is left blank?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants