Skip to main content

The personal finance brain. 30 calculations across 7 countries + Sharia-compliant module + deep India coverage (PF/EPF, Gratuity, Capital Gains, Advance Tax, GST, HRA). 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.2.0.tar.gz (50.3 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.2.0-py3-none-any.whl (64.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: calcnook-0.2.0.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for calcnook-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b6d05b63a7e96cfdcd12106764c68b3e6c1af64257cdcbb0537d0d05ab39fd8f
MD5 c9271892140d798d644091aa07b4881d
BLAKE2b-256 899e73eefd61b66a10944891b8024dd75f088559b55b9db9f17fd4290423e56f

See more details on using hashes here.

Provenance

The following attestation bundles were made for calcnook-0.2.0.tar.gz:

Publisher: publish.yml on Declan142/calcnook-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: calcnook-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 64.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for calcnook-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 511315c3655b0a4e719275a65ce593674ccdc7a2bb48eb70deb2e4d44eaa87d1
MD5 de3d3091ac083634c3d1f0198d2d825a
BLAKE2b-256 bbaada1c6e7c6d30ab6b11353e0ee8433da9a6449ae7701ed3ae107775a339ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for calcnook-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Declan142/calcnook-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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