Metadata-Version: 2.4
Name: pecunia
Version: 0.1.0
Summary: A blazing-fast, type-safe CLI for finance and quant formulas.
Project-URL: Homepage, https://github.com/nsollazzo/pecunia
Project-URL: Repository, https://github.com/nsollazzo/pecunia
Project-URL: Issues, https://github.com/nsollazzo/pecunia/issues
Author-email: Nicholas Sollazzo <github@nsollazzo.com>
License: MIT License
        
        Copyright (c) 2026 Nicholas Sollazzo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: cli,dcf,fcf,finance,quant,valuation
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: cyclopts>=4.14.1
Requires-Dist: polars>=1.40.1
Requires-Dist: pydantic>=2.13.4
Requires-Dist: rich>=15.0.0
Description-Content-Type: text/markdown

# 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

```bash
uv tool install pecunia
```

Or run without installing:

```bash
uvx pecunia --help
```

## Quickstart

```bash
# 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)` |

```bash
$ 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`](./AGENTS.md) for the terse machine-oriented spec: JSON
schema, exit codes, error envelopes, and the `pecunia schema` discovery
command.

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

## Development

See [`CONTRIBUTING.md`](./CONTRIBUTING.md). Quick version:

```bash
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`](./SECURITY.md).

## License

MIT — see [LICENSE](./LICENSE).
