Deterministic portfolio quant core: risk, performance, optimization, and tax.
Project description
finkritq
Deterministic portfolio quant core: risk, performance, optimization, and tax analytics over holdings you supply. Pure numpy and scipy, no agent or web dependency. This is the open core of the finkrit stack, published on its own for use as a standalone library.
Install
pip install finkritq # core: numpy + scipy
pip install "finkritq[data]" # adds the live yfinance market data provider
What it does
- Risk: volatility, variance, semivariance, downside deviation, drawdown and maximum drawdown, value at risk and conditional value at risk, beta, marginal and component contribution to risk, forward return range.
- Performance: total and annualized return, Sharpe, Sortino, Calmar, information ratio, Jensen's alpha, contribution to return, net of fees, time and money weighted return, Brinson attribution.
- Optimization: mean variance weights (minimum variance, maximum Sharpe, target return), long only and box constrained, Ledoit-Wolf shrinkage, rebalancing to a target or a policy.
- Tax: tax lots, tax-loss harvest candidates, tax-aware rebalancing.
Quickstart
from datetime import date
from decimal import Decimal
from finkritq.asset import Stock
from finkritq.datatype import Currency, Exchange
from finkritq.portfolio import Portfolio, Position, TaxLot
from finkritq.anal.risk import portfolio_volatility
stock = Stock(ticker="AAPL", currency=Currency.USD, exchange=Exchange.NASDAQ, company_name="Apple Inc")
lot = TaxLot(id="lot-1", quantity=Decimal("100"), cost_per_share=Decimal("150"), acquired=date(2022, 1, 3))
portfolio = Portfolio(id="p1", name="Demo", positions=[Position(id="pos-1", asset=stock, lots=(lot,))])
Feed it your own price history, or install the data extra to pull live daily
closes through the bundled provider.
Runnable demo
python -m finkritq # seeded, offline synthetic market
python -m finkritq real NVDA KO PG --benchmark SPY --years 3 # needs [data]
License
Apache-2.0. 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
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 finkritq-0.1.2.tar.gz.
File metadata
- Download URL: finkritq-0.1.2.tar.gz
- Upload date:
- Size: 112.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f72497b9d8deb23192902b1b3e6a708aa8e4881aa5f58ccf5fd91b8189d01e00
|
|
| MD5 |
b296ec46f95fc375aafb15d1ccf7b0ed
|
|
| BLAKE2b-256 |
517b8cbc38cc841b678885003c222389f980b952651a4661ad7f762671d99b9b
|
File details
Details for the file finkritq-0.1.2-py3-none-any.whl.
File metadata
- Download URL: finkritq-0.1.2-py3-none-any.whl
- Upload date:
- Size: 106.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6c9c2992e1de3dc1c52fa876e9eff54bffb9d2c671647275045afff23528303
|
|
| MD5 |
1756b8c25e5b232e94d1140872514291
|
|
| BLAKE2b-256 |
32c2b89a8339e6b9465838bcfa37cd296d46c0a53679f3279fe580914030f441
|