Skip to main content

A quantitative factor analysis library for financial research

Project description

Factorium

Python License: MIT PyPI

Factorium is a Polars-first factor research & backtesting toolkit.

  • Data pipeline: BinanceDataLoader + AggBar → multi-symbol OHLCV panel in one line.
  • Factor engine: Factor with rich TS/CS/math ops and expression parsing.
  • Analysis: FactorAnalyzer + FactorAnalysisResult for IC, quantile returns, and plots.
  • Backtest: VectorizedBacktester (exposed as factorium.backtest.Backtester) with Polars-vectorized PnL.
  • Research workflow: ResearchSession + FactorReport to tie everything into a notebook-friendly API.

For a Chinese introduction, see README_zh.md.


Installation

# Recommended
uv add factorium

# Or with pip
pip install factorium

Development setup:

git clone https://github.com/novis10813/factorium.git
cd factorium
uv sync --dev

Quick example

from factorium import ResearchSession

session = ResearchSession.from_parquet("data/btc_1h.parquet")

close = session.factor("close")
momentum = (close.ts_delta(20) / close.ts_shift(20)).cs_rank()

print(session.quick_report(momentum, periods=1))

More complete guides live under docs/:

  • docs/getting-started/quickstart.md
  • docs/user-guide/bar.md
  • docs/user-guide/factor.md
  • docs/user-guide/analyzer.md
  • docs/user-guide/backtest.md

License

MIT – see LICENSE.

Project details


Download files

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

Source Distribution

factorium-0.3.1.tar.gz (403.5 kB view details)

Uploaded Source

Built Distribution

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

factorium-0.3.1-py3-none-any.whl (76.5 kB view details)

Uploaded Python 3

File details

Details for the file factorium-0.3.1.tar.gz.

File metadata

  • Download URL: factorium-0.3.1.tar.gz
  • Upload date:
  • Size: 403.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for factorium-0.3.1.tar.gz
Algorithm Hash digest
SHA256 fdd991d1b59f03be1c8227bb2e7a9d9a4a507ac3a60a97c4c22c148011e9a7ed
MD5 3d09db62adc01980eb20b3b768b9c7a5
BLAKE2b-256 d5e21933277fcb78632eadcaf1517a750bc1fec1c971aaefda96812be58353fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for factorium-0.3.1.tar.gz:

Publisher: publish.yml on novis10813/factorium

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

File details

Details for the file factorium-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: factorium-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 76.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for factorium-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b931bd4aa8f34fb214a44ad945980b24ece25dfee6e7f330d1e573bef86ea5af
MD5 e64539f88f0c4a2d493a60a595d9d330
BLAKE2b-256 7b52b6e80c133deb1e2fe614861272418b06a3fd99aca6d7f898c71723dfbafb

See more details on using hashes here.

Provenance

The following attestation bundles were made for factorium-0.3.1-py3-none-any.whl:

Publisher: publish.yml on novis10813/factorium

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 Pingdom Monitoring Sentry Error logging StatusPage Status page