API Reference
Complete API documentation for all QuantMini modules.
Core Modules
Core Infrastructure
- Core (
src.core) System profiling, memory monitoring, configuration management, and exceptions
- Key Classes:
ConfigLoader: Manage credentials and pipeline configurationSystemProfiler: Auto-detect hardware capabilitiesAdvancedMemoryMonitor: Track memory usage and pressure
Polygon REST API Integration
- Download (
src.download) Polygon REST API client and specialized downloaders
- Key Classes:
PolygonRESTClient: Async HTTP client with rate limitingNewsDownloader: Download financial news articlesBarsDownloader: Download OHLCV dataCorporateActionsDownloader: Download corporate eventsFundamentalsDownloader: Download fundamental dataReferenceDataDownloader: Download ticker metadata
- Features:
Batch request optimization (100+ concurrent)
Automatic retries with exponential backoff
Date-first Hive partitioning
ZSTD compression
Feature Engineering
- Features (
src.features) Technical indicators and feature engineering
- Key Modules:
Alpha158: 158 technical indicators for QlibFinancialRatios: Financial metrics and ratios
- Alpha158 Features:
KBAR: Open-close-high-low features
KDJ: Stochastic indicators
RSI: Relative strength
MACD: Moving average convergence divergence
And 154 more features
Data Transformation
- Transform (
src.transform) Qlib binary format conversion and validation
- Key Classes:
QlibBinaryWriter: Convert Parquet to Qlib binary formatBinaryValidator: Validate binary data integrity
- Qlib Binary Format:
.day.bin: Daily frequency data.1min.bin: Minute frequency dataSymbol-based directory structure
Instruments and calendars metadata
Utilities
- Utils (
src.utils) Data loader and utility functions
- Key Classes:
DataLoader: High-performance query engine for bronze layerDuckDB-powered SQL queries
Multiple output formats (Polars, Pandas, PyArrow)
Module Overview
- Core (
src.core) System profiling, memory monitoring, configuration, and exceptions
- Download (
src.download) Polygon REST API client with specialized downloaders for:
News articles (8+ years historical)
OHLCV bars (stocks and options)
Corporate actions (splits, dividends, ticker changes)
Fundamentals (income statements, balance sheets, cash flow)
Reference data (ticker metadata, market status)
- Features (
src.features) Feature engineering and technical indicators:
Alpha158: 158 technical indicators
Financial ratios: Profitability, liquidity, leverage
- Transform (
src.transform) Qlib binary format conversion and validation
- Utils (
src.utils) Data loader for efficient queries on bronze layer
Data Pipeline Architecture
Landing Layer Bronze Layer Silver Layer Gold Layer
(Raw Sources) (Validated) (Enriched) (ML-Ready)
↓ ↓ ↓ ↓
Polygon.io → Validated Parquet → Feature-Enriched → Qlib Binary
REST API (Schema Check) (Indicators) (Backtesting)
↓ ↓ ↓ ↓
landing/ bronze/{type}/ silver/{type}/ gold/qlib/
Directory Structure:
$DATA_ROOT/
├── landing/ # Raw source data
├── bronze/ # Validated Parquet files
│ ├── stocks_daily/
│ ├── options_daily/
│ ├── news/
│ └── fundamentals/
├── silver/ # Feature-enriched data
│ └── stocks_daily/ # with Alpha158 features
└── gold/qlib/ # ML-ready binary format
├── stocks_daily/
├── stocks_minute/
└── options/
External Documentation
Polygon.io API: https://polygon.readthedocs.io/en/latest/
Qlib Framework: https://qlib.readthedocs.io/en/latest/
DuckDB: https://duckdb.org/docs/