Cashier synchronization server, in Python
Ledger-cli REST server for Cashier PWA, implemented in Python with FastAPI.
Cashier Server acts as a mediator between Cashier PWA and Ledger CLI, forwarding queries to Ledger and the results to Cashier. Used for synchronizing the ledger data in Cashier.
This is a Python implementation of the Cashier Server using FastAPI.
- Install
uv - Install
uv tool install cashier-server
To use Beancount as a back-end, set the BEANCOUNT_FILE environment variable.
The easiest way is by creating an .env file containing this variable,
which should point to your Beancount book.
Otherwise, Cashier Server will use Ledger as the backend.
Execute cashier-server-py script provided by the cashier-server package.
The server runs on 0.0.0.0:3000, matching the Rust implementation.
/- Execute a ledger command/hello- Return a base64-encoded image/ping- Simple health check/shutdown- Request server shutdown
CORS is enabled for all origins, similar to the Rust implementation.
VSCode recommended.
Run the run.cmd script to start the server.
Or run from VSCode to debug.
Make sure that Ledger CLI is configured and can be called from the current directory. Then run:
run.cmd
# or
uv run python app.py
# Or uvicorn directly:
uvicorn app:app --host 0.0.0.0 --port 3000-
Logging is configured to output to the console.
-
For the
/helloendpoint, you would need to provide an actual image file named "hello.png" in the same directory as the app.py file.