Financial and quantitative statistical computing for Python
Project description
PyStatsFinance
Financial and quantitative statistical computing for Python.
Status:
0.1.0— first module shipped. Return-series performance metrics are available now; more quantitative-finance methods are on the roadmap below.
PyStatsFinance is part of the open-core PyStatistics family:
| Package | Layer |
|---|---|
pystatistics |
Fundamental, general statistics |
pystatsbio |
Biotech / pharma statistics |
pystatsclinical |
Clinical-trial / clinical-research statistics |
pystatsgenomic |
Genomics / computational-biology statistics |
pystatsfinance |
Financial / quantitative statistics |
pystatsinsurance |
Actuarial / insurance statistics |
Like its siblings, it builds on pystatistics for the general statistical layer
and adds methods specific to quantitative finance.
What's available now (0.1.0)
Return-series risk and performance metrics:
from pystatsfinance import performance
returns = [0.01, -0.02, 0.03, -0.01, 0.02]
performance.sharpe_ratio(returns) # annualized Sharpe ratio
performance.annualized_volatility(returns) # annualized volatility
performance.max_drawdown(returns) # worst peak-to-trough decline
sharpe_ratio annualizes mean(excess) / std(excess) (sample standard
deviation; per-period risk-free rate). max_drawdown works on returns or a
price series (are_prices=True) and reports the decline magnitude with its peak
and trough indices. All three fail loud on empty/non-finite input, and the
Sharpe ratio is raised — not returned as inf/nan — when volatility is zero.
Roadmap (candidates, not commitments)
- Value-at-Risk and Conditional VaR (historical and parametric).
- Extended performance ratios (Sortino, Calmar, Information) and drawdown analytics.
- GARCH-family volatility and portfolio optimization.
Installation
pip install pystatsfinance
License
MIT © Hai-Shuo. Part of the SGCX open-core ecosystem.
Project details
Release history Release notifications | RSS feed
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 pystatsfinance-0.1.1.tar.gz.
File metadata
- Download URL: pystatsfinance-0.1.1.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6e5cc012705137cb96d345ca0ac3ef02ea4e90895403cbf9462b00f29f754e2
|
|
| MD5 |
60226de6b9a810a1f1335afb58e9b90d
|
|
| BLAKE2b-256 |
6b2634c9b81949fbac33e056461220240689861c2c5874e1f97bc2ca53705b33
|
Provenance
The following attestation bundles were made for pystatsfinance-0.1.1.tar.gz:
Publisher:
publish.yml on sgcx-org/pystatsfinance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pystatsfinance-0.1.1.tar.gz -
Subject digest:
b6e5cc012705137cb96d345ca0ac3ef02ea4e90895403cbf9462b00f29f754e2 - Sigstore transparency entry: 1618907834
- Sigstore integration time:
-
Permalink:
sgcx-org/pystatsfinance@e06d6cf4bab359dc5e4e077a8b703afb18892fde -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/sgcx-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e06d6cf4bab359dc5e4e077a8b703afb18892fde -
Trigger Event:
release
-
Statement type:
File details
Details for the file pystatsfinance-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pystatsfinance-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ab7c868051e7c72b32a4a3036c917995884164e76c151dc068bbad9b81724b3
|
|
| MD5 |
2d71e6822da7dca942eda8b553347bc3
|
|
| BLAKE2b-256 |
6a70edab5892949c6dcb0f9b258f9c27667fa657ce09562e11dbf9e179c33825
|
Provenance
The following attestation bundles were made for pystatsfinance-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on sgcx-org/pystatsfinance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pystatsfinance-0.1.1-py3-none-any.whl -
Subject digest:
9ab7c868051e7c72b32a4a3036c917995884164e76c151dc068bbad9b81724b3 - Sigstore transparency entry: 1618907937
- Sigstore integration time:
-
Permalink:
sgcx-org/pystatsfinance@e06d6cf4bab359dc5e4e077a8b703afb18892fde -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/sgcx-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e06d6cf4bab359dc5e4e077a8b703afb18892fde -
Trigger Event:
release
-
Statement type: