Skip to main content
English · 简体中文

Folioframe

CI Python 3.10–3.13 License: CC BY-NC 4.0

Folioframe turns user-provided Pandas return or equity series into structured portfolio analytics and a modern, interactive, self-contained HTML report. It supports English and Simplified Chinese, one or many strategies, and zero, one or many benchmarks.

Open the interactive English demo · Open the Simplified Chinese demo · Browse the demo source

Folioframe report overview

Interactive equity comparison

What you get

  • Performance, risk, drawdown, distribution, tail-risk and data-quality metrics for every series.
  • Strategy-versus-benchmark metrics for every pair, with a selector when multiple benchmarks exist.
  • Interactive equity, drawdown and weekly/monthly/quarterly/yearly return comparisons.
  • Consistent comparison tables: series in rows, metrics in columns, best values emphasized.
  • Optional IC/RankIC, sample, model, recorded-cost and turnover diagnostics.
  • Offline Plotly charts, light/dark themes and a single portable HTML file.
  • Strict inputs: no downloads, silent filling, implicit alignment or inferred return/equity type.

Install

Install the latest release from PyPI:

python -m pip install folioframe

To test the current unreleased main branch instead:

python -m pip install "folioframe @ git+https://github.com/xystudio-ai/folioframe.git"

For local development:

git clone https://github.com/xystudio-ai/folioframe.git
cd folioframe
python -m pip install -e ".[dev]"

Quick start

import pandas as pd

from folioframe import report

strategies = pd.DataFrame(
    {"My strategy": strategy_returns},
    index=pd.DatetimeIndex(dates),
)
benchmarks = pd.DataFrame(
    {"Market benchmark": benchmark_returns},
    index=strategies.index,
)

analysis = report(
    strategies,
    benchmarks,
    input_kind="returns",
    periods_per_year=252,
    risk_free_rate=0.02,
    primary_benchmark="Market benchmark",
    output="report.html",
    language="en",  # or "zh-CN"
)

print(analysis.metrics)

DataFrame column names are the report labels. Use input_kind="returns" for simple period returns or input_kind="equity" for positive equity/NAV levels. All series must share the same increasing, unique DatetimeIndex; Folioframe fails clearly instead of repairing inputs silently.

periods_per_year and risk_free_rate default to None. Metrics that need a missing assumption are marked unavailable instead of assuming 252 observations or a zero risk-free rate. See the metric definitions.

Three public workflows

API Use it when
report(...) You want analysis and an HTML file in one call.
analyze(...) You want structured metrics and time-series results in Python.
render_html(...) You already have an Analysis and want to render it separately.

MachineLearningDiagnostics and TradingDiagnostics are independent optional inputs. If an object or field is omitted, its report section is omitted too. They display supplied research facts without training a model or rerunning a backtest. See optional diagnostics.

Reproduce the demo

The repository includes an authorized, anonymized research sample with two strategy views, two benchmarks, a 2% risk-free assumption, IC/RankIC, recorded cost, turnover and sample diagnostics. Names and machine-specific identifiers have been removed.

python examples/generate_reports.py

This writes both languages to examples/output/. The two canonical reports are also versioned in docs/demo, so visitors can inspect the result before installing anything.

Project structure

src/folioframe/
  _core.py          input validation and portfolio calculations
  _diagnostics.py   optional research and trading diagnostics
  _render.py        the single HTML/Plotly renderer
examples/
  data/              anonymous demo inputs
  generate_reports.py
docs/
  demo/              canonical bilingual HTML reports
tests/               numerical, rendering and real-browser checks

The library owns generic formulas and rendering. Calling frameworks only translate their own verified evidence into Pandas objects; no caller-specific report logic belongs in Folioframe.

Development

python -m pip install -e ".[dev,browser,release]"
python -m playwright install chromium
ruff check .
python -m pytest
python -m build
python -m twine check dist/*

Tests are offline and deterministic. Contributions that change a public formula must include a numerical regression test, metric-documentation update and changelog entry. See CONTRIBUTING.md.

License

Folioframe is source-available under CC BY-NC 4.0. Sharing and adaptation are allowed with attribution; commercial use requires separate permission. This non-commercial license is not an OSI-approved open-source license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

folioframe-0.1.0.tar.gz (270.8 kB view details)

Uploaded Source

Built Distribution

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

folioframe-0.1.0-py3-none-any.whl (255.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: folioframe-0.1.0.tar.gz
  • Upload date:
  • Size: 270.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for folioframe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9fe7dbb9a6e5531202536c8aa7c9c63524b4aad4aad59517e23437bcb6a024e5
MD5 bc30aae947933d9214dbf5f46c9ccca4
BLAKE2b-256 83bd8b7177d33cf82dd79abba1ca5ae4df9526d335da4ad1c03e3d4dc88ad093

See more details on using hashes here.

Provenance

The following attestation bundles were made for folioframe-0.1.0.tar.gz:

Publisher: publish.yml on xystudio-ai/folioframe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: folioframe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 255.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for folioframe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47d00c3534af77cbe1e3cffbdba593380310e37a6be75c4f153b108307f177fe
MD5 91ea3c315315937e39facb9b29b37ea2
BLAKE2b-256 c9db53484a5e2f9d022173ffe637b998d423cab235a079bf56188837b976b9e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for folioframe-0.1.0-py3-none-any.whl:

Publisher: publish.yml on xystudio-ai/folioframe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page