Skip to main content

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.

Download files

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

Source Distribution

finkritq-0.4.0.tar.gz (122.0 kB view details)

Uploaded Source

Built Distribution

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

finkritq-0.4.0-py3-none-any.whl (113.4 kB view details)

Uploaded Python 3

File details

Details for the file finkritq-0.4.0.tar.gz.

File metadata

  • Download URL: finkritq-0.4.0.tar.gz
  • Upload date:
  • Size: 122.0 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

Hashes for finkritq-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f4e846868f66ac3a01dfa04f38eefe6277374a694a043e5f0e5cbf57a7789fd5
MD5 f4c089a2f8437762f5d7a18a05d76210
BLAKE2b-256 641b7af2c6a5781cb1b629b80100e6b3d55f5714524ca780b529584a6a0775e7

See more details on using hashes here.

File details

Details for the file finkritq-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: finkritq-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 113.4 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

Hashes for finkritq-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15b695e858a6c8e15805c46ef2777d69ca5d4c2aba498a5a472044737ca625d6
MD5 a092eb88a473869035d2947acd6447cd
BLAKE2b-256 11587e78d8cef1498595d5775c861a43714015ac7540f916db3d6ffd5620f959

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.1

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page