Skip to main content

Applied actuarial and quantitative finance workflows for Python.

Project description

AbaQuant

Tests Documentation PyPI Python License: MIT

AbaQuant is an applied actuarial and quantitative-finance library for Python. Version 1.0.0rc1 stabilizes the public namespace around derivatives, financial mathematics, market data, credit analytics, portfolio construction, risk dashboards, visualization, reports, rate curves, and provenance-aware workflows.

Installation

pip install abaquant

For a local source checkout:

python -m pip install -e .

Optional extras are grouped by workflow:

python -m pip install -e .[market]
python -m pip install -e .[visual]
python -m pip install -e .[dev]
python -m pip install -e .[docs]

AbaQuant targets Python 3.11 through 3.14; the release workflow validates each version before publication. Live market-data workflows and visualization backends are optional; the mathematical core depends only on NumPy, pandas, and SciPy.

Minimal examples

Derivatives

from abaquant.derivatives import BlackScholesMertonModel

model = BlackScholesMertonModel(
    spot_price=100.0,
    strike_price=105.0,
    maturity_years=1.0,
    risk_free_rate=0.04,
    volatility=0.20,
)

price = model.price("call")
greeks = model.greeks("call")

Market data and option-chain analytics

from abaquant.marketdata import get_ticker

ticker = get_ticker("AAPL")
spot = ticker.spot()
# Live data requires an installed provider extra and provider availability.

Portfolio construction

from abaquant.portfolio import PortfolioAllocator

allocator = PortfolioAllocator.from_returns(returns)
weights = allocator.max_sharpe()
report = allocator.report()

Rates

from abaquant.rates import ManualRateProvider, get_rate_curve

curve = get_rate_curve(
    provider=ManualRateProvider({1.0: 0.045, 5.0: 0.047, 10.0: 0.049})
)
discount = curve.discount_factor(5.0)

Provenance

from abaquant.core import DataProvenance

provenance = DataProvenance(
    provider="manual",
    dataset="example",
    request={"symbol": "AAPL"},
)
metadata = provenance.as_dict()

Stable v1 namespace map

Namespace Purpose
abaquant.derivatives Vanilla, exotic, tree, simulation, strategy, calibration, and advanced option models.
abaquant.financial_math Time value of money, rates, annuities, bonds, loans, corporate finance, equity, portfolio math, and VaR helpers.
abaquant.marketdata Lazy ticker and universe facades, optional provider adapters, option-chain analytics, and financial statements.
abaquant.credit Credit transition matrices, CDS/CDO helpers, Gaussian copula simulation, credit proxy scoring, and credit VaR/CVaR.
abaquant.portfolio Allocation engines, downside-risk optimizers, backtesting, rolling metrics, and scenario analysis.
abaquant.rates Manual and FRED-backed rate curves, interpolation, discount factors, and interest-rate utilities.
abaquant.visualization Matplotlib and Plotly chart helpers with configurable themes.
abaquant.reports Markdown, HTML, and lightweight PDF report exports.
abaquant.risk Integrated risk dashboard workflows.
abaquant.core Shared provenance objects and provenance merging helpers.

The root abaquant namespace re-exports the documented public facades and defines abaquant.__version__.

Live-data warnings

Market-data providers are optional and lazy. Object construction should not make network requests unless a retrieval method explicitly asks for provider data. Provider data can be unavailable, incomplete, stale, adjusted, restated, or subject to provider-specific terms and rate limits.

For SEC EDGAR requests, set a project-specific contact user agent when using live data:

export ABAQUANT_SEC_USER_AGENT="your-app/1.0 your.email@example.com"

For FRED requests, provide a FRED API key through the provider constructor or environment where supported.

Model assumptions

AbaQuant implements educational and research-grade quantitative routines. Major assumptions include:

  • Black-Scholes-Merton assumes lognormal dynamics, constant volatility, frictionless markets, and continuous trading.
  • Black-76 uses forward pricing conventions and constant lognormal forward volatility.
  • Bachelier uses normal price dynamics and can accommodate negative underlyings or rates.
  • Heston, SABR, Merton jump diffusion, NIG, and Variance-Gamma models rely on numerical approximations and calibration quality.
  • Portfolio optimizers are sensitive to estimated returns, covariance matrices, constraints, sampling frequency, and transaction-cost assumptions.
  • Credit proxy metrics are accounting-derived heuristics, not agency ratings.
  • Gaussian copula credit simulation depends materially on default probabilities, recoveries, and correlation assumptions.
  • Backtests are historical simulations; they are not forecasts.

Not investment advice

AbaQuant is not an investment adviser, broker, credit-rating agency, or risk-management system. Outputs are model-derived estimates for research and education, not trading, lending, investment, tax, accounting, or legal advice.

Development checks

python -m pip install -e ".[dev,docs,market,visual]"
python -m ruff format --check .
python -m ruff check .
python -m pytest
python scripts/check_documentation.py
python -m sphinx -W --keep-going -b html docs docs/_build/html
python -m build
python -m twine check dist/*

See CONTRIBUTING.md for the complete contributor workflow and the hosted documentation for API contracts, model assumptions, and examples.

Documentation source layout

The Sphinx documentation source is written in native reStructuredText under docs/ and organized into topic subfolders: getting-started/, reference/, domains/, operations/, development/, and api/. The api/ tree is generated from the source package by python scripts/generate_api_docs.py; it mirrors all 109 Python modules/packages and renders detailed autodoc entries for the public callable surface.

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

abaquant-1.0.0rc1.tar.gz (381.9 kB view details)

Uploaded Source

Built Distribution

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

abaquant-1.0.0rc1-py3-none-any.whl (286.3 kB view details)

Uploaded Python 3

File details

Details for the file abaquant-1.0.0rc1.tar.gz.

File metadata

  • Download URL: abaquant-1.0.0rc1.tar.gz
  • Upload date:
  • Size: 381.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for abaquant-1.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 db3428036ff93b60b1d5ef75faaf2aee73aed0fae7184f9c9e7394ef3de3f420
MD5 732a7f72dc27b1ca728a37ceff112a17
BLAKE2b-256 fd88df87b41b93ded60ab81eecdb07eae4a8e789b2728bafb994745ed588e131

See more details on using hashes here.

Provenance

The following attestation bundles were made for abaquant-1.0.0rc1.tar.gz:

Publisher: publish.yml on AbaQuant/AbaQuant

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

File details

Details for the file abaquant-1.0.0rc1-py3-none-any.whl.

File metadata

  • Download URL: abaquant-1.0.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 286.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for abaquant-1.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 1dec830377e4edb54e300b02f9417049150cc86159bed410dcd1a31ddf8ba6e4
MD5 8721cddc502150f43e4cd29c412f38ef
BLAKE2b-256 bbfc3f3f1406d5b5483d2a1c874b1392a9f65098ee4acd6c7f9f721127ba5298

See more details on using hashes here.

Provenance

The following attestation bundles were made for abaquant-1.0.0rc1-py3-none-any.whl:

Publisher: publish.yml on AbaQuant/AbaQuant

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