Skip to content
/ bapi Public

The Beancount API (bapi) provides an HTTP API for interacting with a Beancount ledger file

License

Notifications You must be signed in to change notification settings

jmgilman/bapi

Repository files navigation

Beancount API (bapi)

An HTTP API for serving up data contained within a Beancount ledger file.

The Beancount API is an HTTP API built on FastAPI and provides programmatic access to a Beancount ledger. It is OpenAPI compliant and provides rich access to the data contained within a ledger.

Usage

The quickest way to deploy the API is via a container:

docker run \
    -v $(pwd)/testing/static.beancount:/run/beancount/main.beancount \
    -p 8080:8080 \
    ghcr.io/jmgilman/bapi

It can then be queried:

curl http://localhost:8080/v1/directive

The API provides several configuration options for securing access as well as automatically fetching ledger files from remote sources. See the docs for more in-depth usage and configuration information.

Endpoints

Endpoint Description
/v1/account Fetch, list, and realize all accounts in the ledger
/v1/directive Fetch all directives by type or generate Beancount syntax for each directive type
/v1/file Fetch the entire contents of the ledger file
/v1/query Fetch the results of querying the Beancount data using a BQL query
/v1/realize Performs a realization against the ledger

About

The Beancount API (bapi) provides an HTTP API for interacting with a Beancount ledger file

Resources

License

Stars

Watchers

Forks

Packages