Metadata-Version: 2.4
Name: quantlib-pro
Version: 1.0.1
Summary: Advanced quantitative finance library implementing modern portfolio theory, stochastic calculus, derivative pricing models, and risk management methodologies for institutional financial applications
Home-page: https://github.com/quantlib-pro/quantlib-pro
Author: QuantLib Pro Team
Author-email: Guerson Dukens Jr Joseph <guersondukensjrjoseph@gmail.com>
Maintainer-email: gdukens <guersondukensjrjoseph@gmail.com>
License: MIT
Keywords: quantitative-finance,portfolio-optimization,risk-management,options-pricing,derivatives,stochastic-calculus,monte-carlo,black-scholes,var,cvar,efficient-frontier,martingale,ito-calculus,pde,mathematical-finance,computational-finance
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26.4
Requires-Dist: pandas>=2.2.3
Requires-Dist: scipy>=1.12.0
Requires-Dist: yfinance>=0.2.48
Requires-Dist: scikit-learn>=1.4.0
Requires-Dist: hmmlearn>=0.3.2
Requires-Dist: matplotlib>=3.9.0
Requires-Dist: plotly>=5.20.0
Requires-Dist: seaborn>=0.13.0
Requires-Dist: streamlit>=1.32.0
Requires-Dist: networkx>=3.2.0
Requires-Dist: redis>=5.0.0
Requires-Dist: sqlalchemy[asyncio]>=2.0.0
Requires-Dist: asyncpg>=0.29.0
Requires-Dist: fastapi>=0.110.0
Requires-Dist: uvicorn[standard]>=0.27.0
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: passlib[bcrypt]>=1.7.4
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: slowapi>=0.1.9
Requires-Dist: bleach>=6.1.0
Requires-Dist: cryptography>=42.0.0
Requires-Dist: prometheus-client>=0.20.0
Requires-Dist: opentelemetry-api>=1.23.0
Requires-Dist: opentelemetry-sdk>=1.23.0
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.23.0
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.44b0
Requires-Dist: opentelemetry-instrumentation-redis>=0.44b0
Requires-Dist: opentelemetry-instrumentation-requests>=0.44b0
Requires-Dist: psutil>=5.9.8
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pydantic>=2.6.0
Requires-Dist: structlog>=24.1.0
Provides-Extra: sdk
Requires-Dist: numpy>=1.26.4; extra == "sdk"
Requires-Dist: pandas>=2.2.3; extra == "sdk"
Requires-Dist: scipy>=1.12.0; extra == "sdk"
Requires-Dist: scikit-learn>=1.4.0; extra == "sdk"
Requires-Dist: yfinance>=0.2.48; extra == "sdk"
Requires-Dist: requests>=2.31.0; extra == "sdk"
Provides-Extra: full
Requires-Dist: streamlit>=1.32.0; extra == "full"
Requires-Dist: fastapi>=0.110.0; extra == "full"
Requires-Dist: uvicorn[standard]>=0.27.0; extra == "full"
Requires-Dist: redis>=5.0.0; extra == "full"
Requires-Dist: sqlalchemy[asyncio]>=2.0.0; extra == "full"
Requires-Dist: plotly>=5.20.0; extra == "full"
Requires-Dist: matplotlib>=3.9.0; extra == "full"
Provides-Extra: data
Requires-Dist: yfinance>=0.2.48; extra == "data"
Requires-Dist: pandas-datareader>=0.10.0; extra == "data"
Requires-Dist: alpha-vantage>=2.3.1; extra == "data"
Requires-Dist: fredapi>=0.5.0; extra == "data"
Provides-Extra: ml
Requires-Dist: scikit-learn>=1.4.0; extra == "ml"
Requires-Dist: hmmlearn>=0.3.2; extra == "ml"
Requires-Dist: tensorflow>=2.15.0; extra == "ml"
Requires-Dist: torch>=2.1.0; extra == "ml"
Requires-Dist: xgboost>=2.0.0; extra == "ml"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: pytest-mock>=3.12.0; extra == "dev"
Requires-Dist: fakeredis>=2.21.0; extra == "dev"
Requires-Dist: httpx>=0.27.0; extra == "dev"
Requires-Dist: black>=24.0.0; extra == "dev"
Requires-Dist: flake8>=7.0.0; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Requires-Dist: isort>=5.13.0; extra == "dev"
Requires-Dist: pre-commit>=3.6.0; extra == "dev"
Requires-Dist: bandit>=1.7.7; extra == "dev"
Requires-Dist: safety>=3.0.0; extra == "dev"
Requires-Dist: pandas-stubs>=2.2.0; extra == "dev"
Requires-Dist: types-redis>=4.6.0; extra == "dev"
Requires-Dist: types-requests>=2.31.0; extra == "dev"
Provides-Extra: all
Requires-Dist: quantlib-pro[data,full,ml,sdk]; extra == "all"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# QuantLib Pro: Advanced Quantitative Finance Library

## Overview

QuantLib Pro is a comprehensive Python library for quantitative finance that implements rigorous mathematical foundations for portfolio optimization, derivative pricing, risk management, and financial modeling. Built on measure-theoretic probability theory and stochastic calculus, it provides institutional-grade tools for financial analysis and computational finance applications.

## Scientific Foundation

This library implements advanced mathematical concepts from:

- **Measure-Theoretic Probability Theory**: Rigorous treatment of random variables, expectations, and filtrations
- **Stochastic Calculus**: Ito processes, Brownian motion, and stochastic differential equations  
- **Martingale Theory**: Complete mathematical framework for fair pricing and risk-neutral valuation
- **Partial Differential Equations**: Numerical methods for option pricing and diffusion models
- **Optimization Theory**: Convex optimization for portfolio construction and risk budgeting

## Core Deliverables

### 1. Portfolio Theory Module (`quantlib_pro.portfolio`)

**Mathematical Foundation**: Modern Portfolio Theory with extensions

**Deliverables**:
- Mean-variance optimization with quadratic programming solver
- Efficient frontier computation with parametric representation
- Black-Litterman model with Bayesian updating framework
- Risk budgeting algorithms with equal risk contribution
- Multi-period portfolio optimization with transaction costs
- Factor model implementation with principal component analysis
- Performance attribution with Brinson-Fachler methodology
- Backtesting engine with statistical significance testing

**Key Functions**:
```python
optimize_portfolio(expected_returns, covariance_matrix, constraints)
efficient_frontier(returns, num_portfolios=1000)  
black_litterman_optimization(views, view_uncertainty, market_caps)
risk_budgeting_portfolio(target_risk_contributions)
```

### 2. Risk Management Module (`quantlib_pro.risk`)

**Mathematical Foundation**: Extreme value theory and copula methods

**Deliverables**:
- Value-at-Risk (VaR) calculation using historical, parametric, and Monte Carlo methods
- Conditional VaR (Expected Shortfall) with coherent risk measure properties
- Stress testing framework with scenario generation and backtesting  
- Copula-based dependency modeling for multivariate risk assessment
- GARCH volatility modeling with maximum likelihood estimation
- Regime detection using Hidden Markov Models
- Correlation analysis with dynamic conditional correlation models
- Risk decomposition and marginal risk contribution analytics

**Key Functions**:
```python
calculate_var(returns, confidence_level=0.05, method='historical')
calculate_cvar(returns, confidence_level=0.05)
stress_test_portfolio(portfolio_weights, scenarios)
fit_copula(returns, copula_type='gaussian')
```

### 3. Options Pricing Module (`quantlib_pro.options`)

**Mathematical Foundation**: Stochastic differential equations and risk-neutral valuation

**Deliverables**:
- Black-Scholes-Merton analytical solutions for European options
- Monte Carlo simulation engine with variance reduction techniques
- Binomial and trinomial tree methods for American option pricing
- Heston stochastic volatility model implementation
- Implied volatility calculation with Newton-Raphson solver
- Greeks computation (Delta, Gamma, Theta, Vega, Rho) with finite differences
- Volatility surface construction and interpolation
- Exotic option pricing (barrier, Asian, lookback options)

**Key Functions**:
```python
black_scholes(S, K, T, r, sigma, option_type='call')
monte_carlo_option_price(S0, K, T, r, sigma, n_simulations=100000)
american_option_binomial(S, K, T, r, sigma, n_steps=100)
heston_model_calibration(market_prices, strikes, maturities)
```

### 4. Volatility Modeling Module (`quantlib_pro.volatility`)

**Mathematical Foundation**: Econometric time series analysis

**Deliverables**:
- GARCH family models (GARCH, EGARCH, GJR-GARCH) with MLE estimation
- Realized volatility calculation with microstructure noise correction
- Volatility forecasting with conditional heteroskedasticity models
- Jump detection in high-frequency data using Lee-Mykland test
- Volatility surface fitting with SVI parameterization
- Regime-switching volatility models with Markov chains
- Volatility clustering analysis and persistence measurement
- HAR (Heterogeneous Autoregressive) model for realized volatility

**Key Functions**:
```python
fit_garch_model(returns, model_type='GARCH', p=1, q=1)
calculate_realized_volatility(price_data, frequency='5min')
forecast_volatility(fitted_model, horizon=10)
detect_jumps(price_data, test_statistic='lee_mykland')
```

### 5. Market Data Module (`quantlib_pro.data`)

**Mathematical Foundation**: Data quality and statistical validation

**Deliverables**:
- Multi-source market data aggregation and normalization
- Data quality assessment with statistical outlier detection
- Missing data imputation using advanced interpolation methods
- Corporate actions adjustment (splits, dividends, mergers)
- High-frequency data cleaning and microstructure analysis
- Alternative data integration and preprocessing pipelines
- Real-time data streaming with WebSocket connections
- Historical data backtesting and simulation capabilities

**Key Functions**:
```python
get_market_data(symbols, start_date, end_date, frequency='daily')
clean_price_data(raw_data, outlier_method='iqr')
adjust_for_corporate_actions(price_data, actions_data)
validate_data_quality(dataset, quality_checks=['completeness', 'accuracy'])
```

### 6. Macro Economics Module (`quantlib_pro.macro`)

**Mathematical Foundation**: Econometric modeling and time series analysis

**Deliverables**:
- Economic indicator analysis with statistical significance testing
- FRED (Federal Reserve Economic Data) integration and preprocessing
- Yield curve construction using Nelson-Siegel and Svensson models
- Term structure modeling with affine models and PCA analysis
- Economic scenario generation for stress testing applications
- Business cycle analysis using state-space models
- Inflation modeling and real rate calculations
- Central bank policy impact analysis with event study methodology

**Key Functions**:
```python
fetch_fred_data(series_ids, start_date, end_date)
construct_yield_curve(bond_data, method='nelson_siegel')
analyze_economic_indicators(indicator_data, significance_level=0.05)
generate_economic_scenarios(base_case, n_scenarios=1000)
```

### 7. Analytics Module (`quantlib_pro.analytics`)

**Mathematical Foundation**: Statistical learning and dimensionality reduction

**Deliverables**:
- Principal Component Analysis (PCA) for factor extraction
- Independent Component Analysis (ICA) for non-Gaussian factors
- Machine learning models for return prediction and classification
- Clustering analysis for asset grouping and regime identification
- Anomaly detection using isolation forests and autoencoders
- Time series forecasting with ARIMA and state-space models
- Backtesting framework with walk-forward analysis
- Performance metrics calculation with statistical significance tests

**Key Functions**:
```python
perform_pca(returns_matrix, n_components=5)
fit_ml_model(features, targets, model_type='random_forest')
detect_anomalies(time_series, method='isolation_forest')
backtest_strategy(strategy_returns, benchmark_returns)
```

### 8. Execution Module (`quantlib_pro.execution`)

**Mathematical Foundation**: Market microstructure theory and optimal execution

**Deliverables**:
- Transaction cost analysis (TCA) with market impact models
- Optimal execution algorithms (TWAP, VWAP, Implementation Shortfall)
- Slippage analysis and execution quality measurement
- Market impact modeling using Kyle and Obizhaeva framework
- Order flow analysis and adverse selection detection
- Algorithmic trading strategy development and backtesting
- Execution scheduling optimization with stochastic control
- Post-trade analysis and execution performance attribution

**Key Functions**:
```python
calculate_transaction_costs(trades, market_data)
optimal_execution_schedule(target_position, market_impact_model)
analyze_execution_quality(executed_trades, benchmark)
estimate_market_impact(order_size, asset_characteristics)
```

## API Integration

### RESTful API Server (`quantlib_api`)

Production-ready FastAPI server providing:

- Asynchronous request handling with high-performance endpoints
- JWT authentication and authorization with role-based access control
- Rate limiting and request validation with comprehensive error handling
- OpenAPI documentation with interactive testing interface
- Prometheus metrics collection and observability instrumentation
- Database integration with SQLAlchemy ORM and connection pooling
- Caching layer with Redis for performance optimization
- Microservices architecture with containerized deployment

### Command Line Interface (`quantlib_cli`)

Professional CLI tool offering:

- Interactive portfolio optimization with parameter validation
- Batch processing capabilities for large-scale computations
- Configuration management with environment-specific settings
- Logging and monitoring with structured output formats
- Integration with CI/CD pipelines for automated testing
- Data export functionality in multiple formats (CSV, JSON, Parquet)
- Performance benchmarking and profiling utilities
- Help system with detailed documentation and examples

## Technical Specifications

**Programming Language**: Python 3.10+ with type hints and async support  
**Dependencies**: NumPy, SciPy, Pandas, scikit-learn for computational foundations  
**Performance**: Vectorized operations with optional GPU acceleration via CuPy  
**Memory Management**: Optimized data structures with lazy loading capabilities  
**Testing**: Comprehensive unit and integration tests with 90%+ coverage  
**Documentation**: Complete API reference with mathematical derivations  

## Installation Options

```bash
# Complete installation with all modules
pip install quantlib-pro

# Minimal SDK installation
pip install quantlib-pro[sdk]

# Full platform with API and UI components  
pip install quantlib-pro[full]

# Development environment with testing tools
pip install quantlib-pro[dev]
```

## Mathematical Documentation

The library includes comprehensive mathematical documentation covering:

- Measure theory foundations and sigma-algebras
- Stochastic processes and martingale theory  
- Ito calculus and stochastic differential equations
- Numerical methods for PDE solving
- Optimization theory and convex analysis
- Statistical inference and hypothesis testing
- Time series econometrics and GARCH modeling
- Monte Carlo methods and variance reduction

## Quality Assurance

- Numerical accuracy verified against academic literature
- Performance benchmarked against industry standards  
- Code quality maintained with automated testing and linting
- Mathematical correctness validated through peer review
- Regulatory compliance considerations for institutional use
- Comprehensive error handling and input validation
- Memory and computational efficiency optimization
- Cross-platform compatibility testing

## Author

**Guerson Dukens Jr Joseph** (gdukens)  
Contact: guersondukensjrjoseph@gmail.com

## License

MIT License - see LICENSE file for details.

## Citation

If you use QuantLib Pro in academic research, please cite:

```
Dukens Jr Joseph, G. (2026). QuantLib Pro: Advanced Quantitative Finance Library. 
Python Package Index. https://pypi.org/project/quantlib-pro/
```
