Skip to main content

budget-analytics

Pure budget maths for Python. It has no database and no web framework, and no dependencies outside the standard library.

Every amount is in whole cents (6435 means 64.35), so there are no float rounding errors. A transaction is a plain dict:

{"date": "2026-11-14", "description": "Tesco", "amount_cents": 6435, "type": "expense", "category_id": 1}

Install

pip install budget-analytics

Functions

Function What it gives back
monthly_totals(transactions) {"income_cents", "expenses_cents", "balance_cents"}
spending_by_category(transactions) {category_id: cents spent}; income isn't counted
budget_status(limit_cents, spent_cents) limit_cents, spent_cents, left_cents (negative when over), percent_used, and status: ok under 80%, warning from 80% to 100%, over above 100%
find_recurring(transactions, min_months=3, tolerance_percent=10) payments with the same description in at least 3 different months, each within 10% of the typical amount; biggest first
normalise_description(text) "NETFLIX.COM 8472" → "netflix com", used to match bank descriptions

Example

from budget_analytics import budget_status, spending_by_category

transactions = [
    {"date": "2026-11-10", "description": "Dinner", "amount_cents": 12860, "type": "expense", "category_id": 2},
    {"date": "2026-11-20", "description": "Pizza night", "amount_cents": 4280, "type": "expense", "category_id": 2},
]
spent = spending_by_category(transactions)  # {2: 17140}
budget_status(15000, spent[2])
# {'limit_cents': 15000, 'spent_cents': 17140, 'left_cents': -2140, 'percent_used': 114, 'status': 'over'}

Run the tests

cd library
pip install pytest
pytest

Licence

MIT

Metadata

Release files for budget-analytics 0.1.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 budget-analytics 0.1.0
File Size Uploaded Provenance Actions
budget_analytics-0.1.0.tar.gz 4.9 kB Without provenance Details for budget_analytics-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for budget-analytics 0.1.0
File Interpreter ABI Platform Actions
budget_analytics-0.1.0-py3-none-any.whl Python 3 none any Details for budget_analytics-0.1.0-py3-none-any.whl

Total release size: 9.2 kB

Release files / budget_analytics-0.1.0.tar.gz

Download URL budget_analytics-0.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c03a165fa2d42f74f0fd7445527a131ea29dcff0f11c18224dfa7a00308f4708
BLAKE2b-256 checksum
How to use checksums
4a4dfb61586da7a666ed4709d34bf4855dbef7df8030afecbe74f98d985a4187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.6

Release files / budget_analytics-0.1.0-py3-none-any.whl

Download URL budget_analytics-0.1.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10b0ab7a1c0ea490da0e6c9c32902933367b8042ca8d6435d4c3540b36cec118
BLAKE2b-256 checksum
How to use checksums
3873323a0bbcf3531f721225358a73e9ffcc69bf7660b23e661285f9110a0efc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.6

Security for budget-analytics 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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