Skip to main content

A blazing-fast, type-safe CLI for finance and quant formulas.

Project description

pecunia

A blazing-fast, type-safe, AI-friendly CLI for finance and quant formulas.

Pecunia (Latin for money — the root of English pecuniary) computes the formulas you reach for every day in finance: enterprise value, free cash flow, discounted cash flow, WACC, returns, ratios. It runs in your terminal, prints clean tables (or structured JSON for piping and agents), and uses decimal.Decimal throughout so you never lose a cent to floating-point rounding.

Built on the modern Astral toolchain — uv, ruff, ty — with strict type checking, 100% formula coverage, and Hypothesis property tests on every invariant.

Status: early alpha. Today: Enterprise Value, Free Cash Flow, schema discovery. The rest of the formula library (DCF, WACC, ratios, returns) is landing next.

Install

uv tool install pecunia

Or run without installing:

uvx pecunia --help

Quickstart

# Enterprise Value
$ pecunia valuation ev --market-cap 500 --total-debt 200 --cash 50
Enterprise Value  650

# Free Cash Flow
$ pecunia cash-flow fcf --operating-cash-flow 100 --capital-expenditures 30
Free Cash Flow  70

Output formats

Every command supports --format / -f:

Format What you get Use case
table Rich-rendered table (default) Reading in the terminal
json Structured envelope with command, inputs, result Agents, pipelines, jq
plain The bare value, nothing else x=$(pecunia ... -f plain)
$ pecunia valuation ev --market-cap 500 --total-debt 200 --cash 50 -f json
{"schema_version":"1","command":"valuation.ev","formula":"Enterprise Value",
 "result":{"value":"650","type":"decimal"},
 "inputs":{"market_cap":"500","total_debt":"200","cash":"50",
           "minority_interest":"0","preferred_equity":"0"}}

For AI agents

Pecunia is designed to be driven by LLMs and autonomous agents. See AGENTS.md for the terse machine-oriented spec: JSON schema, exit codes, error envelopes, and the pecunia schema discovery command.

$ pecunia schema | jq '.commands[].path'
["valuation","ev"]
["cash-flow","fcf"]
["schema"]

Development

See CONTRIBUTING.md. Quick version:

git clone https://github.com/nsollazzo/pecunia.git
cd pecunia
uv sync
uv run pre-commit install
uv run pre-commit install --hook-type commit-msg
uv run pytest --cov=pecunia

Security

Please report vulnerabilities privately via GitHub Security Advisories — see SECURITY.md.

License

MIT — see LICENSE.

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

pecunia-0.1.0.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

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

pecunia-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pecunia-0.1.0.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pecunia-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a7c80d4085280d5c67947e8b6cbdd63aba5dc776aa94d581bc4de2c95a0b8a04
MD5 ae5931e00ceb05072d1c4dcb3a88e662
BLAKE2b-256 13f6ef0785ea9e780496017684fb0d3a063652243f9a8670ed4b71761b6a7cc3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pecunia-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pecunia-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 745a3bce8516ccf33680e45a557c67e286af7d28a9c378e06d9c2101875eba18
MD5 55e7640c83e4b900d5f41b7dd370c915
BLAKE2b-256 3334eb7ceae67be0c6ee07d1d0d25753512d598dca2ea557898330e80fb041a1

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