Skip to main content

fincore | Quantitative Performance & Risk Analytics

Version 0.5.1 Status: Beta Python 3.11+ MIT License

Documentation · 0.5 migration · Contributing · Changelog

What fincore 0.5 is

fincore is a unified Python platform for quantitative performance analysis. It keeps the analytical capabilities historically associated with Empyrical, Pyfolio, and Alphalens, but rebuilds them as one low-coupling core rather than three package-shaped APIs. The public contract is organized by domain and each capability has one canonical implementation path.

Version 0.5.1 is a quality-maintenance release that preserves the deliberately breaking 0.5.0 public contract. It does not provide fincore.empyrical, fincore.pyfolio, fincore.alphalens, flat root metric functions, compatibility aliases, or façade classes. Update imports to the focused domain modules described in the migration guide.

Domain Use it for Canonical examples
fincore.metrics returns, drawdown, ratios, rolling and statistical metrics metrics.ratios.sharpe_ratio
fincore.performance cash-flow-aware return calculation and performance inference performance.cashflows.cashflow_adjusted_twr
fincore.portfolio positions, transactions, capacity, and round trips portfolio.positions.gross_lev
fincore.report immutable report documents and HTML/PDF/XLSX renderers report.portfolio.compute.build_portfolio_report
fincore.factor_analysis factor preparation, analysis, inference, cost, and rendering factor_analysis.analysis.analyze_factor
fincore.risk risk models, diagnostics, calibration, EVT, and GARCH risk.diagnostics.walk_forward_var
fincore.attribution allocation and factor-performance attribution attribution.performance.perf_attrib
fincore.optimization, simulation, data, viz, extensions, runtime specialized analysis and platform services import the owning leaf module

The package root is only a namespace index. Import executable functions and models from their owning leaf module, not from fincore itself.

Install

pip install fincore

# Optional capabilities
pip install "fincore[factor-analysis]"
pip install "fincore[visualization]"
pip install "fincore[interactive]"
pip install "fincore[report-pdf]"
pip install "fincore[report-xlsx]"
pip install "fincore[bayesian]"
pip install "fincore[data-yahoo]"
pip install "fincore[data-alphavantage]"
pip install "fincore[data-pandas-datareader]"
pip install "fincore[data-cn]"
pip install "fincore[all]"

For a source checkout, use pip install -e ".[dev]". Python 3.11+ is required. pyproject.toml is the dependency source of truth.

Quick start: metrics

import pandas as pd

from fincore.metrics.drawdown import max_drawdown
from fincore.metrics.ratios import sharpe_ratio
from fincore.metrics.yearly import annual_return

returns = pd.Series([0.01, -0.005, 0.002, 0.004])

print(sharpe_ratio(returns))
print(max_drawdown(returns))
print(annual_return(returns))

Portfolio report workflow

Compute a portable report model once, then choose a renderer. Renderers do not repeat analytical computation.

import pandas as pd

from fincore.report.portfolio.compute import build_portfolio_report
from fincore.report.renderers.html import write_html

index = pd.date_range("2024-01-02", periods=5, freq="B")
returns = pd.Series([0.01, -0.005, 0.002, 0.004, -0.001], index=index)
positions = pd.DataFrame({"AAA": 100.0, "BBB": -30.0, "cash": 80.0}, index=index)

document = build_portfolio_report(returns, positions=positions, rolling_window=3)
artifacts = write_html(document, "portfolio-report.html")
print(artifacts.named_artifacts["file"])

Use fincore[report-pdf] or fincore[report-xlsx] only when selecting the corresponding renderer.

Factor analysis

Factor analysis is a first-class domain, not an Alphalens wrapper. The repository includes an offline deterministic quickstart that prepares inputs, computes the canonical model, derives portfolio inputs, and renders a headless summary:

pip install "fincore[visualization]"
MPLBACKEND=Agg python examples/factor_analysis_quickstart.py

For application code, import the exact operation from its owning module, such as fincore.factor_analysis.data, analysis, performance, portfolio, or inference.

Design commitments

  • One implementation path per public operation; no re-exported legacy API shells.
  • Immutable input and extension snapshots at domain boundaries.
  • Structured runtime errors with operation and parameter context.
  • Report models separated from renderers and artifact lifecycle management.
  • Optional dependencies isolated by explicit capability extras.
  • Tests protect canonical imports, removed legacy surfaces, report semantics, package contents, and executable documentation.

Development and verification

/Users/yunjinqi/opt/anaconda3/bin/conda run -n base python -m pytest -o addopts='' tests/docs tests/packaging -q
/Users/yunjinqi/opt/anaconda3/bin/conda run -n base python -m ruff check fincore scripts tests

The release-quality and provenance records live under docs/quality/. A local test pass is not a published-release claim.

License and third-party notices

fincore is MIT licensed; see LICENSE. Retained third-party material keeps its own licensing and attribution in NOTICE, THIRD_PARTY_NOTICES.md, and THIRD_PARTY_LICENSES.

Metadata

Release files for fincore 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fincore 0.5.1
File Size Uploaded
fincore-0.5.1.tar.gz 598.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fincore 0.5.1
File Interpreter ABI Platform
fincore-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / fincore-0.5.1.tar.gz

Download URL fincore-0.5.1.tar.gz
Size 598.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a7d869920321a4f8b32aeb93f659a455a6ff5ad10a97299d038875c069934c8f
BLAKE2b-256 checksum
How to use checksums
7bbff786bd9ca8381c85cc0df2e1f5ccafc8a26a1f34b47c1b5bd09df4459a1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / fincore-0.5.1-py3-none-any.whl

Download URL fincore-0.5.1-py3-none-any.whl
Size 661.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fac3c45679141a15c58e02ea28938f199688299e85ca4d9cbf464733bf072b12
BLAKE2b-256 checksum
How to use checksums
e68e8824c0cc7b6e653f8868db4ec43391c8962452b322e7bfc68079ff08d060
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.3.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page