While working on an HTTP API backend for beancount, I decided to extract my Pydantic models out into their own package since I believe some people may find it useful to represent core beancount types as Pydantic models.
bdantic: https://github.com/jmgilman/bdantic Probably the most useful thing out of the box is you can represent your entire ledger as JSON: from beancount import loaderfrom bdantic import parse_loader result = parse_loader(*loader.load_file("testing/static.beancount")) print(result.json()) While every model is heavily tested with hypothesis, I've only ingested a few generated beancount ledgers and my own personal one, so there may be additional kinks that need working out. Additionally, in tandem with the above, I started working out some type stub files for beancount: https://github.com/jmgilman/beancount-stubs. It's still very incomplete but I tried at least getting the core package stubbed out. PRs are welcome for either package :) -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAJuQ%3DO0Mj31fONx95qy71vNEij0Uw65%3D-MebhQdeEBrqDQc_%3Dg%40mail.gmail.com.
