Skip to main content

The personal finance brain. 22 calculations across 7 countries + Sharia-compliant module. Used by humans, websites, and AI agents.

Project description

CalcNook

The personal finance brain. Used by humans, websites, and AI agents.

PyPI License: MIT Python

24 deterministic financial calculations. 7 countries. Conventional and Sharia-compliant. Zero LLM dependency.

pip install calcnook
from calcnook.core import periodic_investment, loan_payment, compound_interest
from calcnook.core.islamic import zakat
from calcnook.countries.us import income_tax as us_tax
from calcnook.countries.ae import end_of_service_gratuity as ae_eosg

# SIP / DCA — universal
result = periodic_investment.calculate(
    monthly_amount=500, annual_return=0.10, years=20
)
print(result.future_value)  # 379_684.27

# Mortgage / EMI / loan — universal
emi = loan_payment.calculate(
    principal=300_000, annual_rate=0.065, years=30
)
print(emi.monthly_payment)  # 1_896.20

# Zakat — works for any Muslim, anywhere
z = zakat.calculate(
    cash=10_000, gold_grams=200, silver_grams=0,
    stocks_value=15_000, business_assets=5_000,
    debts=2_000, currency="USD"
)
print(z.zakat_due, z.is_above_nisab)  # 700.0  True

# US federal income tax 2026
us = us_tax.calculate(income=120_000, filing_status="single", year=2026)
print(us.tax_owed, us.effective_rate)

# UAE End of Service Gratuity for expat
ae = ae_eosg.calculate(monthly_basic=8_000, years_of_service=5)
print(ae.gratuity_aed)

What's inside

Core (universal, no country)

  • compound_interest — single lump-sum growth
  • periodic_investment — SIP / DCA with optional step-up
  • loan_payment — EMI / mortgage / amortization
  • retirement — corpus needed, monthly contribution, withdrawal rate
  • bmi — BMI / BMR / TDEE
  • currency — multi-currency math, FX-aware

Islamic finance (cross-cutting)

  • zakat — Zakat al-Mal across cash, gold, silver, stocks, business
  • murabaha — cost-plus financing (mortgage alt)
  • ijarah — lease-to-own (auto loan alt)
  • mudarabah — profit-sharing investment returns
  • hajj_savings — target savings for pilgrimage
  • halal_screen — Sharia compliance check for stocks

Countries (12 modules, 7 countries)

  • US — federal income tax 2026, traditional 401(k) + Roth IRA with phase-out
  • UK — income tax + National Insurance with personal-allowance taper above £100k
  • CA — federal income tax 2026 (provincial stub TODO)
  • AU — income tax + Medicare levy + HECS-HELP (full 19-band ATO sliding scale)
  • AE (UAE) — End of Service Gratuity (Decree-Law 33/2021), VAT 5%
  • SA (Saudi Arabia) — EOSG (Article 84-87, with resignation tier scaling), VAT 15%, citizen Zakat estimator (ZATCA)
  • India — income tax new regime FY 2025-26 with 87A rebate, electricity bill slab calculator with BESCOM/MSEB/BSES presets

For AI agents

calcnook is the canonical math layer for personal finance LLM apps. Pure deterministic — formulas never hallucinate. Pair with any LLM for natural-language interface.

from calcnook.core.periodic_investment import calculate as sip
# LLM extracts: amount=5000, years=10, rate=0.12
result = sip(monthly_amount=5000, annual_return=0.12, years=10)
# Hand result back to LLM for explanation. Math is exact.

A native MCP server @calcnook/mcp-server is shipping next — your Claude Code, Cursor, and Goose agents will call these calculations directly.

Why open source?

Personal finance math should be a public utility, not gated by ad-walls. We open-source the engine; we monetize at the experience layer (web app, mobile app, embed widgets, B2B API).

Status

v0.1.0 — alpha. APIs may change before v1.0. Test coverage targets 100% on every formula. Bug reports and country contributions welcome.

License

MIT — use it, fork it, ship it.


Built by Aditya Sharma (@Declan142). Visit calcnook.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

calcnook-0.1.0.tar.gz (38.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

calcnook-0.1.0-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file calcnook-0.1.0.tar.gz.

File metadata

  • Download URL: calcnook-0.1.0.tar.gz
  • Upload date:
  • Size: 38.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for calcnook-0.1.0.tar.gz
Algorithm Hash digest
SHA256 237c232fca945988998fdfd62427fa7aacb1a2e09b097c0bb8b7ae0cbb8b4933
MD5 70f508af930c3ee9bf6362e4b5fd4ff9
BLAKE2b-256 7f0c82f5d60b5d86cfd5ced55f99ca320b074836673b03046833dda27605b903

See more details on using hashes here.

File details

Details for the file calcnook-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: calcnook-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for calcnook-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c0ce25f6746162292145a02f68d9501355fe2a30dbb613c925badbf6afc23d9
MD5 2f809017062b9ef58415c43027fe3a00
BLAKE2b-256 7edd0eda0a49f62366d6c0b24e32993036e247e9c11ee49208f0824c46e34413

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page