Standalone Lark based Beancount syntax parser (not relying on Beancount library), MIT license
Reason this release was yanked:
It changes the grammar a bit might breaks deps, so should be 0.2.0 instead
Project description
beancount-parser ![CircleCI](https://pypi-camo.freetls.fastly.net/7c98ce7941776834a4faf2c75fb8884ea8457ef4/68747470733a2f2f636972636c6563692e636f6d2f67682f4c61756e6368506c6174666f726d2f6265616e636f756e742d7061727365722f747265652f6d61737465722e7376673f7374796c653d737667)
Standalone Lark LALR(1) based Beancount syntax parser (not relying on Beancount library), MIT license
Please also checkout out beancount-black, an opinionated beancount code formatter based on beancount-parser.
Features
- MIT licensed - the only dependency is Lark
- Extremely fast - LALR(1) is used
- Section awareness - emac org symbol mark
*
will be parsed - Comment awareness - comments will be parsed
- Not a validator - it does not validate beancount syntax, invalid beancount syntax may still pass the parsing
Sponsor
The original project beancount-parser was meant to be an internal tool built by Launch Platform LLC for
A modern accounting book service based on the most popular open source version control system Git and text-based double entry accounting book software Beancount. We realized adding new entries with BeanHub automatically over time makes beancount file a mess. So obviously, a strong code formatter is needed. And to deal with comments and other corner cases, it's easier to build a parser from ground up without relying on Beancount. While SaaS businesses won't be required to open source an internal tool like this, we still love that the service is only possible because of the open-source tool we are using. We think it would be greatly beneficial for the community to access a tool like this, so we've decided to open source it under MIT license, hope you find this tool useful 😄
Install
To install the parser, simply run
pip install beancount-parser
Usage
If you want to run the parse beancount code, you can do this
import io
from beancount_parser.parser import make_parser
parser = make_parser()
tree = parser.parse(beancount_content)
# do whatever you want with the tree here
Feedbacks
Feedbacks, bugs reporting or feature requests are welcome 🙌, just please open an issue. No guarantee we have time to deal with them, but will see what we can do.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for beancount_parser-0.1.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44fc36b50b8e8c55bdf84c40d0af5040c44a52d9c68f210286a470907f423c39 |
|
MD5 | d645ecb42ddd9acf09dc2370ebc3c8bf |
|
BLAKE2b-256 | 50271502005e084370579fdfe540664e481ad0b6edbdcd5577d421f6236776a2 |