Skip to main content

cashier-server-python

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.

Installation

  1. Install uv
  2. Install uv tool install cashier-server

Configure Backend

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.

Configure Certificates

Create a self-signed certificate with OpenSSL.

Add CASHIER_SSL_KEY and CASHIER_SSL_CERT paths to .env file, pointing to generated key.pem and cert.pem.

Android

On Android, import the cert.pem. Usually Settings -> Security -> Install certificate -> CA Certificate.

Then, open the Cashier Server URL in the browser and accept the self-signed certificate.

Run

Execute cashier-server-py script provided by the cashier-server package.

The server runs on 0.0.0.0:3000, matching the Rust implementation.

API Endpoints

  • / - Execute a ledger command
  • /hello - Return a base64-encoded image
  • /ping - Simple health check
  • /reload - Reload the Beancout data
  • /shutdown - Request server shutdown
  • /infrastructure/config - Return the Beancount config file content
  • /infrastructure/accounts - Return the Beancount accounts file content
  • /infrastructure/commodities - Return the Beancount commodities file content

CORS is enabled for all origins, similar to the Rust implementation.

Development

VSCode recommended. Run the run.cmd script to start the server. Or run from VSCode to debug.

Debug

Make sure that Beancount 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

Notes on the Implementation

  • Logging is configured to output to the console.
  • For the /hello endpoint, you would need to provide an actual image file named "hello.png" in the same directory as the app.py file.

Metadata

Release files for cashier-server 0.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cashier-server 0.13.0
File Size Uploaded Provenance
cashier_server-0.13.0.tar.gz 34.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cashier-server 0.13.0
File Interpreter ABI Platform
cashier_server-0.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.6 kB

Release files / cashier_server-0.13.0.tar.gz

Download URL cashier_server-0.13.0.tar.gz
Size 34.8 kB
Tags Source
SHA-256 checksum
How to use checksums
25d640e68071f3c6ee4d221981baedfc3011a8fea881925bedcc3f130b1deacc
BLAKE2b-256 checksum
How to use checksums
4fe76a9d627328b636597348f1627683b490940f5f265d64965ce50e88863074
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cashier_server-0.13.0-py3-none-any.whl

Download URL cashier_server-0.13.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3634ddae57f8be68ed86872c4c96c37899d467bc63f1df944d79208ed14f185f
BLAKE2b-256 checksum
How to use checksums
3a958646301c604eb069d252a6c45d03127d509379ee39a8405a1921ade1ecb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cashier-server 0.13.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page