pyxirr
Rust-powered collection of financial functions for Python.
What it is and what it does
PyXIRR is a Python wrapper around Rust-implemented financial functions, designed to compute internal rate of return (XIRR), IRR, NPV, FV, and related metrics with high performance. It handles multiple input formats—iterators, numpy arrays, pandas DataFrames, dictionaries, and date-string pairs—and supports different day-count conventions (ACT/360, 30E/360, etc.) used in fixed-income and corporate finance. The library also includes private equity metrics like PME+ and direct alpha, plus numpy-like vectorization for batch calculations.
The package solves the multiple IRR problem by searching for a positive result near 0.1 (matching Excel's default) and falling back to conservative lower IRR estimates when multiple solutions exist. It has no external runtime dependencies, includes type annotations, and is optimized for speed through its Rust backend. Typical use cases span investment analysis, portfolio performance measurement, and financial modeling where fast, accurate cash-flow calculations are needed.
Use it for:
- Calculate investment returns (XIRR) for portfolios with irregular cash flows and multiple entry/exit dates.
- Compute NPV and IRR for capital budgeting and project evaluation with different discount rates.
- Apply day-count conventions in fixed-income bond pricing and accrued interest calculations.
- Batch-process financial metrics across multiple securities or funds using vectorized operations.
- Measure private equity fund performance using PME+ and direct alpha against public market indices.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyXIRR is a Rust-backed library that computes financial functions including XIRR, IRR, NPV, and FV with support for multiple day-count conventions and vectorized operations on dates and cash flows.
Yes. PyXIRR is a solid choice for financial calculations: it has no runtime dependencies, supports modern Python versions (3.7–3.14), carries a permissive license, and offers significant speed advantages through Rust. The medium install friction is mitigated by pre-built wheels for common platforms. The aging maintenance status (284 days since last release) is a minor concern but not a blocker, given the stable, focused scope of the library and zero known vulnerabilities.
Install
pyxirr on PyPI
pip
pip install pyxirruv
uv add pyxirrpoetry
poetry add pyxirrInstalling pyxirr
Before you install
Medium install friction due to compiled wheels; however, pre-built wheels are available for Python 3.7–3.14 across macOS, Linux (multiple architectures), and Windows, reducing build overhead for most users. Last release was 284 days ago; repository is active but aging.
License in practice
Licensed under the Unlicense (permissive public domain equivalent), imposing no restrictions on use, modification, or distribution—suitable for commercial and proprietary projects.
Quickstart
from datetime import date
from pyxirr import xirr
dates = [date(2020, 1, 1), date(2021, 1, 1)]
amounts = [-1000, 1200]
result = xirr(dates, amounts)
Verify before relying
- Whether the aging maintenance status (284 days since last release) signals a risk for future bug fixes or feature updates.
- Compatibility and performance with very large cash-flow datasets or high-dimensional vectorized operations.
Package facts
| License | Unlicense (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 284 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,082,630/month — #4,393 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyxirr-0.10.8-cp310-cp310-macosx_10_12_x86_64.whl; pyxirr-0.10.8-cp310-cp310-macosx_11_0_arm64.whl; pyxirr-0.10.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyxirr-0.10.8-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; pyxirr-0.10.8-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; pyxirr-0.10.8-cp310-cp310-manylinux_2_17_ppc64.manylinux2014_ppc64.whl; pyxirr-0.10.8-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; pyxirr-0.10.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyxirr-0.10.8-cp310-cp310-musllinux_1_2_aarch64.whl; pyxirr-0.10.8-cp310-cp310-musllinux_1_2_armv7l.whl; pyxirr-0.10.8-cp310-cp310-musllinux_1_2_i686.whl; pyxirr-0.10.8-cp310-cp310-musllinux_1_2_x86_64.whl; pyxirr-0.10.8-cp310-none-win_amd64.whl; pyxirr-0.10.8-cp311-cp311-macosx_10_12_x86_64.whl; pyxirr-0.10.8-cp311-cp311-macosx_11_0_arm64.whl; pyxirr-0.10.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyxirr-0.10.8-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; pyxirr-0.10.8-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; pyxirr-0.10.8-cp311-cp311-manylinux_2_17_ppc64.manylinux2014_ppc64.whl; pyxirr-0.10.8-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl
Keywords: python, fast, financial, xirr, cashflow, day count convention, PME
Tags
More Financial packages
statsmodels provides statistical models,…
permissive · top 1,000 on PyPI
yfinanceFetches financial and market data from Yahoo…
permissive · top 1,000 on PyPI
bokehBokeh is an interactive visualization library…
permissive · top 5,000 on PyPI
python-stdnumParses, validates, and reformats standard…
copyleft · top 5,000 on PyPI
panelPanel is a Python framework for building…
permissive · top 5,000 on PyPI
databentoOfficial Python client for accessing live and…
permissive · top 5,000 on PyPI
numpy-financialProvides elementary financial functions (IRR,…
permissive · top 5,000 on PyPI
rustworkxA high-performance graph library for Python,…
permissive · top 5,000 on PyPI
moviepilot-rustProvides Rust-accelerated parsing and filtering…
unclear · top 15,000 on PyPI
delta-kernel-rust-sharing-wrapperProvides Python bindings to the Rust-based…
permissive · top 5,000 on PyPI
pyiceberg-coreProvides a Rust-powered core implementation for…
permissive · top 5,000 on PyPI
chia-rsProvides Python bindings to Rust crates for…
unclear · top 15,000 on PyPI
polars-runtime-64A Rust-based analytical query engine for…
permissive · top 15,000 on PyPI
py-rust-stemmersProvides fast, parallel word stemming using…
unclear · top 5,000 on PyPI