jcornaz / beancount-parser

A beancount file parser library for rust
The Unlicense
21 stars 7 forks source link

Support Multi-Currency Postings #2

Closed TTWNO closed 2 years ago

TTWNO commented 2 years ago

I have a lot of postings like the following, due to not being in the U.S.

2022-09-09 "SR.HT" "Git hosting"
    Expenses:Tech:Services:Git    50.00 USD @@ 67.98 CAD
    Liabilities:Amex

I'm not sure if your parser supports this syntax. I don't see a test for it.

Also, if it does, this would be a great library to build on top of for a higher level ledger with web views, and digest tools.

Thanks for all the hard work! And to do it with no terms under to Unlicense; just amazing!

jcornaz commented 2 years ago

Hi,

As I live in Switzerland, a small country with its own currency that is surrounded by the European Union, I do understand that use-case quite well :smile:

That syntax is already supported, though there is no explicit acceptance test for it at the crate level. But I do have unit tests for the posting parser: https://github.com/jcornaz/beancount-parser/blob/v1.0.0-alpha.4/src/transaction/posting.rs#L167-L175

Also, if it does, this would be a great library to build on top of for a higher level ledger with web views, and digest tools.

Yes, that's the intent. I make this parser to support a digest tool I want to make. But I'd be especially happy to find out people are using the parser for their own projects :-)

Thanks for all the hard work! And to do it with no terms under to Unlicense; just amazing!

Thanks to you for you gratitude! I'm glad to see people interested by this parser. If you build anything with it, please let me know :wink: