No project description provided
Project description
numfolio ⚡
Portfolio performance accelerated by Numba
A lightweight, flexible Python package for analyzing portfolio returns, risk metrics, and correlations using modern statistical and machine learning methods.
🚀 Features
✅ Bootstrapped metric estimation (e.g., Sharpe Ratio, Sortino Ratio)
✅ Automatic Scorecard Generation with time-based aggregation (Yearly, Quarterly, Monthly)
✅ Covariance and Correlation estimation with robust shrinkage methods
✅ Parallel computation for scalability
✅ Clean, consistent API inspired by scikit-learn & pandas
🔧 Installation
To install the package the simplest procedure is:
pip install numfolio
Now you can test the installation... In a python shell:
import numfolio as nf
nf.__version__
Optional dependencies are docs for documentation and
build for development. To install optional
dependencies pip install numfolio[docs,build].
📚 Example Usage
1. Compute Scorecard from PnL or Returns:
import pandas as pd
from numfolio import get_scorecard
# Sample PnL data
dates = pd.date_range("2025-01-01", periods=60, freq="D")
pnl = pd.Series(range(100, 160), index=dates)
df = pd.DataFrame({"pnl": pnl})
scorecard = get_scorecard(df, freq="M")
print(scorecard)
2. Estimate Bootstrapped Sharpe Ratio:
import numpy as np
from numfolio import bootstrap_metric
# Generate fake returns
returns = np.random.default_rng().normal(0, 1, 100)
bootstrapped = bootstrap_metric(returns, metric="sharpe_ratio", n_bootstraps=500)
print("Bootstrapped Sharpe Ratios:", bootstrapped[:5])
3. Estimate Correlation Matrix:
import pandas as pd
import numpy as np
from numfolio import estimate_correlation
dates = pd.date_range("2025-01-01", periods=100, freq="D")
returns = pd.DataFrame(np.random.default_rng().normal(0, 1, (100, 3)), columns=["A", "B", "C"], index=dates)
correlation = estimate_correlation(returns, method="ledoit_wolf", n_bootstraps=200)
print(correlation)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file numfolio-0.0.2.tar.gz.
File metadata
- Download URL: numfolio-0.0.2.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d4eae6b55e4e7d17b83aa4152839f7474af5e81672a0ae1455cb749d081198a
|
|
| MD5 |
b68e680661e8f265be7abeb91ea2c64c
|
|
| BLAKE2b-256 |
d61aba80cd49c3984dddac17347e9f0b863284798face36908e6ae137b748bcb
|
Provenance
The following attestation bundles were made for numfolio-0.0.2.tar.gz:
Publisher:
python-publish.yml on agdiiura/numfolio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
numfolio-0.0.2.tar.gz -
Subject digest:
5d4eae6b55e4e7d17b83aa4152839f7474af5e81672a0ae1455cb749d081198a - Sigstore transparency entry: 233846604
- Sigstore integration time:
-
Permalink:
agdiiura/numfolio@88ce0629af039d98323a3370624567458479c420 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/agdiiura
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@88ce0629af039d98323a3370624567458479c420 -
Trigger Event:
release
-
Statement type:
File details
Details for the file numfolio-0.0.2-py3-none-any.whl.
File metadata
- Download URL: numfolio-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de792067742aab2539ba38a0ba7e00c11ca7c63c5bc4708e7783ca626d72e26c
|
|
| MD5 |
e538b7b1ec4bfb953e9bde3589f962ed
|
|
| BLAKE2b-256 |
336c7212a672de5201f58918935e87ab3ae480f74e6841745a3cf6fe50d36e73
|
Provenance
The following attestation bundles were made for numfolio-0.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on agdiiura/numfolio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
numfolio-0.0.2-py3-none-any.whl -
Subject digest:
de792067742aab2539ba38a0ba7e00c11ca7c63c5bc4708e7783ca626d72e26c - Sigstore transparency entry: 233846605
- Sigstore integration time:
-
Permalink:
agdiiura/numfolio@88ce0629af039d98323a3370624567458479c420 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/agdiiura
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@88ce0629af039d98323a3370624567458479c420 -
Trigger Event:
release
-
Statement type: