Skip to main content

fincore | Quantitative Performance & Risk Analytics

Version 0.5.0 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.0 is a deliberately breaking release. 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.0

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.0
File Size Uploaded
fincore-0.5.0.tar.gz 598.7 kB Details

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / fincore-0.5.0.tar.gz

Download URL fincore-0.5.0.tar.gz
Size 598.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b64ef5a6e641ebc65451c87b792b62048bb7c8b19b04fb7663df8b96482491d5
BLAKE2b-256 checksum
How to use checksums
120cb2be52509037ac7f55bc05c41e01966dc914d7620b3502e16dbe8b7e7725
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 1, 2026.

Transparency log

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

Download URL fincore-0.5.0-py3-none-any.whl
Size 661.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9368555b06e7b78ea445b72327cbfdbe24419018dd589cc6198f2fbf42a7967c
BLAKE2b-256 checksum
How to use checksums
bff2c4a93477ed67059de3533c3ff3ec0118d5525e1653b774aa1090c958bcf0
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 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

2 release files

This release

0.5.0 This release

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