ml4t-data 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ml4t_data-0.1.0/.gitignore +45 -0
- ml4t_data-0.1.0/LICENSE +21 -0
- ml4t_data-0.1.0/PKG-INFO +457 -0
- ml4t_data-0.1.0/README.md +347 -0
- ml4t_data-0.1.0/pyproject.toml +316 -0
- ml4t_data-0.1.0/scripts/verify_distribution.py +142 -0
- ml4t_data-0.1.0/scripts/verify_provider_contract_runs.py +99 -0
- ml4t_data-0.1.0/src/ml4t/data/AGENTS.md +46 -0
- ml4t_data-0.1.0/src/ml4t/data/__init__.py +54 -0
- ml4t_data-0.1.0/src/ml4t/data/_version.py +24 -0
- ml4t_data-0.1.0/src/ml4t/data/adjustments/__init__.py +23 -0
- ml4t_data-0.1.0/src/ml4t/data/adjustments/core.py +252 -0
- ml4t_data-0.1.0/src/ml4t/data/anomaly/AGENTS.md +16 -0
- ml4t_data-0.1.0/src/ml4t/data/anomaly/__init__.py +23 -0
- ml4t_data-0.1.0/src/ml4t/data/anomaly/base.py +142 -0
- ml4t_data-0.1.0/src/ml4t/data/anomaly/config.py +117 -0
- ml4t_data-0.1.0/src/ml4t/data/anomaly/detectors.py +496 -0
- ml4t_data-0.1.0/src/ml4t/data/anomaly/manager.py +306 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/AGENTS.md +16 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/__init__.py +26 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/asset_class.py +252 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/contracts.py +422 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/data/__init__.py +0 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/data/crypto_top100.json +102 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/data/forex_majors.json +30 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/data/nasdaq100.json +102 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/data/sp500.json +505 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/schemas.py +322 -0
- ml4t_data-0.1.0/src/ml4t/data/assets/validation.py +296 -0
- ml4t_data-0.1.0/src/ml4t/data/calendar/__init__.py +0 -0
- ml4t_data-0.1.0/src/ml4t/data/calendar/crypto.py +366 -0
- ml4t_data-0.1.0/src/ml4t/data/cli/__init__.py +69 -0
- ml4t_data-0.1.0/src/ml4t/data/cli/batch.py +206 -0
- ml4t_data-0.1.0/src/ml4t/data/cli/config.py +83 -0
- ml4t_data-0.1.0/src/ml4t/data/cli/core.py +805 -0
- ml4t_data-0.1.0/src/ml4t/data/cli/cot.py +278 -0
- ml4t_data-0.1.0/src/ml4t/data/cli/futures.py +350 -0
- ml4t_data-0.1.0/src/ml4t/data/cli/utils.py +169 -0
- ml4t_data-0.1.0/src/ml4t/data/cli_interface.py +59 -0
- ml4t_data-0.1.0/src/ml4t/data/config/__init__.py +38 -0
- ml4t_data-0.1.0/src/ml4t/data/config/_serialization.py +46 -0
- ml4t_data-0.1.0/src/ml4t/data/config/loader.py +331 -0
- ml4t_data-0.1.0/src/ml4t/data/config/models.py +607 -0
- ml4t_data-0.1.0/src/ml4t/data/config/validator.py +247 -0
- ml4t_data-0.1.0/src/ml4t/data/core/AGENTS.md +16 -0
- ml4t_data-0.1.0/src/ml4t/data/core/__init__.py +6 -0
- ml4t_data-0.1.0/src/ml4t/data/core/config.py +123 -0
- ml4t_data-0.1.0/src/ml4t/data/core/exceptions.py +315 -0
- ml4t_data-0.1.0/src/ml4t/data/core/models.py +179 -0
- ml4t_data-0.1.0/src/ml4t/data/core/schemas.py +467 -0
- ml4t_data-0.1.0/src/ml4t/data/cot/AGENTS.md +14 -0
- ml4t_data-0.1.0/src/ml4t/data/cot/__init__.py +46 -0
- ml4t_data-0.1.0/src/ml4t/data/cot/fetcher.py +695 -0
- ml4t_data-0.1.0/src/ml4t/data/cot/workflow.py +519 -0
- ml4t_data-0.1.0/src/ml4t/data/crypto/__init__.py +15 -0
- ml4t_data-0.1.0/src/ml4t/data/crypto/downloader.py +500 -0
- ml4t_data-0.1.0/src/ml4t/data/data_manager.py +584 -0
- ml4t_data-0.1.0/src/ml4t/data/etfs/__init__.py +16 -0
- ml4t_data-0.1.0/src/ml4t/data/etfs/downloader.py +589 -0
- ml4t_data-0.1.0/src/ml4t/data/export/__init__.py +5 -0
- ml4t_data-0.1.0/src/ml4t/data/export/formats/__init__.py +14 -0
- ml4t_data-0.1.0/src/ml4t/data/export/formats/base.py +145 -0
- ml4t_data-0.1.0/src/ml4t/data/export/formats/csv.py +138 -0
- ml4t_data-0.1.0/src/ml4t/data/export/formats/excel.py +347 -0
- ml4t_data-0.1.0/src/ml4t/data/export/formats/json.py +280 -0
- ml4t_data-0.1.0/src/ml4t/data/export/manager.py +364 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/AGENTS.md +116 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/__init__.py +188 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/adjustment.py +115 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/book_downloader.py +760 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/config.py +230 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/continuous.py +227 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/continuous_downloader.py +568 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/databento_parser.py +607 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/definitions.py +334 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/downloader.py +857 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/individual_downloader.py +501 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/parser.py +328 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/roll.py +415 -0
- ml4t_data-0.1.0/src/ml4t/data/futures/schema.py +433 -0
- ml4t_data-0.1.0/src/ml4t/data/macro/__init__.py +15 -0
- ml4t_data-0.1.0/src/ml4t/data/macro/downloader.py +465 -0
- ml4t_data-0.1.0/src/ml4t/data/managers/__init__.py +46 -0
- ml4t_data-0.1.0/src/ml4t/data/managers/async_batch.py +281 -0
- ml4t_data-0.1.0/src/ml4t/data/managers/batch_manager.py +409 -0
- ml4t_data-0.1.0/src/ml4t/data/managers/bulk_manager.py +326 -0
- ml4t_data-0.1.0/src/ml4t/data/managers/config_manager.py +262 -0
- ml4t_data-0.1.0/src/ml4t/data/managers/fetch_manager.py +279 -0
- ml4t_data-0.1.0/src/ml4t/data/managers/metadata_manager.py +296 -0
- ml4t_data-0.1.0/src/ml4t/data/managers/provider_manager.py +378 -0
- ml4t_data-0.1.0/src/ml4t/data/managers/storage_manager.py +631 -0
- ml4t_data-0.1.0/src/ml4t/data/provider_updater.py +466 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/AGENTS.md +63 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/__init__.py +216 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/alpaca.py +1039 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/aqr.py +1185 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/async_base.py +264 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/base.py +360 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/binance.py +415 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/binance_public.py +1923 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/coingecko.py +766 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/cryptocompare.py +576 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/databento.py +727 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/eodhd.py +624 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/fama_french.py +1003 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/finnhub.py +444 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/fred.py +586 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/fundamentals.py +406 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/fxmacrodata.py +749 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/kalshi.py +801 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/learned_synthetic.py +529 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/mixins/__init__.py +45 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/mixins/async_session.py +143 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/mixins/circuit_breaker.py +362 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/mixins/rate_limit.py +91 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/mixins/retry.py +116 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/mixins/session.py +127 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/mixins/validation.py +366 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/mock.py +355 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/nasdaq_itch.py +638 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/oanda.py +328 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/okx.py +602 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/polygon.py +574 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/polymarket.py +976 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/protocols.py +249 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/registry.py +348 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/synthetic.py +543 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/tiingo.py +238 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/twelve_data.py +266 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/wiki_prices.py +807 -0
- ml4t_data-0.1.0/src/ml4t/data/providers/yahoo.py +658 -0
- ml4t_data-0.1.0/src/ml4t/data/py.typed +0 -0
- ml4t_data-0.1.0/src/ml4t/data/security/__init__.py +5 -0
- ml4t_data-0.1.0/src/ml4t/data/security/path_validator.py +255 -0
- ml4t_data-0.1.0/src/ml4t/data/sessions/__init__.py +10 -0
- ml4t_data-0.1.0/src/ml4t/data/sessions/assigner.py +287 -0
- ml4t_data-0.1.0/src/ml4t/data/sessions/completer.py +359 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/AGENTS.md +45 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/__init__.py +92 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/async_base.py +102 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/backend.py +448 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/chunked.py +703 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/config.py +162 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/data_profile.py +325 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/flat.py +188 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/hive.py +640 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/keys.py +111 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/legacy_migration.py +454 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/metadata_tracker.py +399 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/migration.py +598 -0
- ml4t_data-0.1.0/src/ml4t/data/storage/protocols.py +129 -0
- ml4t_data-0.1.0/src/ml4t/data/synthetic/__init__.py +51 -0
- ml4t_data-0.1.0/src/ml4t/data/synthetic/ohlcv_utils.py +404 -0
- ml4t_data-0.1.0/src/ml4t/data/synthetic/registry.py +409 -0
- ml4t_data-0.1.0/src/ml4t/data/universe.py +217 -0
- ml4t_data-0.1.0/src/ml4t/data/update_manager.py +827 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/AGENTS.md +20 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/__init__.py +8 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/async_rate_limit.py +302 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/conversion.py +138 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/format.py +342 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/gap_optimizer.py +148 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/gaps.py +329 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/global_rate_limit.py +118 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/locking.py +193 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/rate_limit.py +87 -0
- ml4t_data-0.1.0/src/ml4t/data/utils/retry.py +54 -0
- ml4t_data-0.1.0/src/ml4t/data/validation/__init__.py +13 -0
- ml4t_data-0.1.0/src/ml4t/data/validation/base.py +86 -0
- ml4t_data-0.1.0/src/ml4t/data/validation/cross_validation.py +286 -0
- ml4t_data-0.1.0/src/ml4t/data/validation/ohlcv.py +409 -0
- ml4t_data-0.1.0/src/ml4t/data/validation/report.py +223 -0
- ml4t_data-0.1.0/src/ml4t/data/validation/rules.py +300 -0
- ml4t_data-0.1.0/tests/MULTI_ASSET_INTEGRATION_REPORT.md +386 -0
- ml4t_data-0.1.0/tests/__init__.py +1 -0
- ml4t_data-0.1.0/tests/anomaly/__init__.py +1 -0
- ml4t_data-0.1.0/tests/anomaly/test_base.py +510 -0
- ml4t_data-0.1.0/tests/anomaly/test_config.py +473 -0
- ml4t_data-0.1.0/tests/anomaly/test_detectors.py +668 -0
- ml4t_data-0.1.0/tests/anomaly/test_manager.py +565 -0
- ml4t_data-0.1.0/tests/assets/__init__.py +1 -0
- ml4t_data-0.1.0/tests/assets/test_asset_class.py +252 -0
- ml4t_data-0.1.0/tests/assets/test_contracts.py +205 -0
- ml4t_data-0.1.0/tests/assets/test_schemas.py +312 -0
- ml4t_data-0.1.0/tests/assets/test_validation.py +520 -0
- ml4t_data-0.1.0/tests/conftest.py +199 -0
- ml4t_data-0.1.0/tests/core/__init__.py +1 -0
- ml4t_data-0.1.0/tests/core/test_schemas.py +778 -0
- ml4t_data-0.1.0/tests/cot/__init__.py +1 -0
- ml4t_data-0.1.0/tests/cot/test_fetcher.py +468 -0
- ml4t_data-0.1.0/tests/cot/test_workflow.py +774 -0
- ml4t_data-0.1.0/tests/futures/test_adjustment.py +580 -0
- ml4t_data-0.1.0/tests/futures/test_book_downloader.py +978 -0
- ml4t_data-0.1.0/tests/futures/test_continuous.py +559 -0
- ml4t_data-0.1.0/tests/futures/test_databento_parser.py +863 -0
- ml4t_data-0.1.0/tests/futures/test_downloader.py +1185 -0
- ml4t_data-0.1.0/tests/futures/test_parser.py +256 -0
- ml4t_data-0.1.0/tests/futures/test_roll.py +1099 -0
- ml4t_data-0.1.0/tests/integration/conftest.py +146 -0
- ml4t_data-0.1.0/tests/integration/test_alpaca.py +112 -0
- ml4t_data-0.1.0/tests/integration/test_binance_public.py +566 -0
- ml4t_data-0.1.0/tests/integration/test_coingecko.py +439 -0
- ml4t_data-0.1.0/tests/integration/test_cryptocompare.py +187 -0
- ml4t_data-0.1.0/tests/integration/test_eodhd.py +281 -0
- ml4t_data-0.1.0/tests/integration/test_factor_providers.py +345 -0
- ml4t_data-0.1.0/tests/integration/test_finnhub.py +303 -0
- ml4t_data-0.1.0/tests/integration/test_fred.py +373 -0
- ml4t_data-0.1.0/tests/integration/test_fxmacrodata.py +53 -0
- ml4t_data-0.1.0/tests/integration/test_kalshi.py +459 -0
- ml4t_data-0.1.0/tests/integration/test_oanda.py +169 -0
- ml4t_data-0.1.0/tests/integration/test_polygon.py +222 -0
- ml4t_data-0.1.0/tests/integration/test_polymarket.py +504 -0
- ml4t_data-0.1.0/tests/integration/test_real_api_integration.py +373 -0
- ml4t_data-0.1.0/tests/integration/test_release_provider_contracts.py +120 -0
- ml4t_data-0.1.0/tests/integration/test_tiingo.py +260 -0
- ml4t_data-0.1.0/tests/integration/test_twelve_data.py +197 -0
- ml4t_data-0.1.0/tests/integration/test_wiki_prices.py +397 -0
- ml4t_data-0.1.0/tests/integration/test_yahoo.py +189 -0
- ml4t_data-0.1.0/tests/providers/test_nasdaq_itch.py +623 -0
- ml4t_data-0.1.0/tests/storage/test_data_profile.py +326 -0
- ml4t_data-0.1.0/tests/storage/test_keys.py +87 -0
- ml4t_data-0.1.0/tests/storage/test_legacy_migration.py +322 -0
- ml4t_data-0.1.0/tests/storage/test_metadata_tracker.py +892 -0
- ml4t_data-0.1.0/tests/storage/test_migration.py +577 -0
- ml4t_data-0.1.0/tests/synthetic/__init__.py +0 -0
- ml4t_data-0.1.0/tests/synthetic/test_learned_synthetic.py +795 -0
- ml4t_data-0.1.0/tests/synthetic/test_registry.py +659 -0
- ml4t_data-0.1.0/tests/test_adjustments_core.py +583 -0
- ml4t_data-0.1.0/tests/test_alpaca_provider.py +1296 -0
- ml4t_data-0.1.0/tests/test_anomaly/__init__.py +1 -0
- ml4t_data-0.1.0/tests/test_anomaly/test_detectors.py +350 -0
- ml4t_data-0.1.0/tests/test_anomaly/test_manager.py +308 -0
- ml4t_data-0.1.0/tests/test_aqr_provider.py +533 -0
- ml4t_data-0.1.0/tests/test_aqr_provider_edge_cases.py +313 -0
- ml4t_data-0.1.0/tests/test_async_providers.py +648 -0
- ml4t_data-0.1.0/tests/test_async_providers_extended.py +613 -0
- ml4t_data-0.1.0/tests/test_async_rate_limit.py +327 -0
- ml4t_data-0.1.0/tests/test_base_provider_enhanced.py +683 -0
- ml4t_data-0.1.0/tests/test_batch_load.py +352 -0
- ml4t_data-0.1.0/tests/test_batch_load_integration.py +135 -0
- ml4t_data-0.1.0/tests/test_batch_load_performance.py +375 -0
- ml4t_data-0.1.0/tests/test_binance.py +326 -0
- ml4t_data-0.1.0/tests/test_binance_public_edge_cases.py +260 -0
- ml4t_data-0.1.0/tests/test_binance_public_provider.py +819 -0
- ml4t_data-0.1.0/tests/test_chunked_storage.py +1048 -0
- ml4t_data-0.1.0/tests/test_cli_batch.py +149 -0
- ml4t_data-0.1.0/tests/test_cli_interface.py +1886 -0
- ml4t_data-0.1.0/tests/test_coingecko_provider.py +896 -0
- ml4t_data-0.1.0/tests/test_config.py +531 -0
- ml4t_data-0.1.0/tests/test_config_basics.py +85 -0
- ml4t_data-0.1.0/tests/test_config_integration.py +298 -0
- ml4t_data-0.1.0/tests/test_config_loader.py +433 -0
- ml4t_data-0.1.0/tests/test_config_models.py +440 -0
- ml4t_data-0.1.0/tests/test_config_validator.py +242 -0
- ml4t_data-0.1.0/tests/test_configuration_authority.py +110 -0
- ml4t_data-0.1.0/tests/test_conversion.py +143 -0
- ml4t_data-0.1.0/tests/test_core_abstractions.py +147 -0
- ml4t_data-0.1.0/tests/test_core_models.py +145 -0
- ml4t_data-0.1.0/tests/test_cot.py +487 -0
- ml4t_data-0.1.0/tests/test_crypto_assets.py +282 -0
- ml4t_data-0.1.0/tests/test_crypto_downloader.py +594 -0
- ml4t_data-0.1.0/tests/test_cryptocompare.py +371 -0
- ml4t_data-0.1.0/tests/test_cryptocompare_provider.py +241 -0
- ml4t_data-0.1.0/tests/test_data_manager.py +579 -0
- ml4t_data-0.1.0/tests/test_data_manager_storage.py +1219 -0
- ml4t_data-0.1.0/tests/test_data_manager_unit.py +613 -0
- ml4t_data-0.1.0/tests/test_data_manager_universe.py +281 -0
- ml4t_data-0.1.0/tests/test_databento_acceptance.py +36 -0
- ml4t_data-0.1.0/tests/test_databento_provider.py +549 -0
- ml4t_data-0.1.0/tests/test_distribution_verification.py +65 -0
- ml4t_data-0.1.0/tests/test_eodhd_provider.py +525 -0
- ml4t_data-0.1.0/tests/test_etf_downloader.py +620 -0
- ml4t_data-0.1.0/tests/test_exceptions.py +141 -0
- ml4t_data-0.1.0/tests/test_export.py +697 -0
- ml4t_data-0.1.0/tests/test_fama_french_provider.py +463 -0
- ml4t_data-0.1.0/tests/test_finnhub_provider.py +499 -0
- ml4t_data-0.1.0/tests/test_fred_unit.py +474 -0
- ml4t_data-0.1.0/tests/test_fundamentals_providers.py +283 -0
- ml4t_data-0.1.0/tests/test_fxmacrodata_provider.py +279 -0
- ml4t_data-0.1.0/tests/test_gap_optimizer.py +168 -0
- ml4t_data-0.1.0/tests/test_gaps.py +303 -0
- ml4t_data-0.1.0/tests/test_global_rate_limit.py +340 -0
- ml4t_data-0.1.0/tests/test_global_rate_limiting.py +242 -0
- ml4t_data-0.1.0/tests/test_hive_storage.py +680 -0
- ml4t_data-0.1.0/tests/test_import.py +23 -0
- ml4t_data-0.1.0/tests/test_incremental_update_system.py +744 -0
- ml4t_data-0.1.0/tests/test_kalshi_unit.py +755 -0
- ml4t_data-0.1.0/tests/test_locking.py +187 -0
- ml4t_data-0.1.0/tests/test_macro_downloader.py +401 -0
- ml4t_data-0.1.0/tests/test_metadata_tracker.py +409 -0
- ml4t_data-0.1.0/tests/test_mock_provider.py +240 -0
- ml4t_data-0.1.0/tests/test_mock_provider_enhanced.py +160 -0
- ml4t_data-0.1.0/tests/test_multi_asset.py +935 -0
- ml4t_data-0.1.0/tests/test_oanda_provider.py +453 -0
- ml4t_data-0.1.0/tests/test_offline_network_policy.py +30 -0
- ml4t_data-0.1.0/tests/test_okx_provider.py +208 -0
- ml4t_data-0.1.0/tests/test_package_metadata.py +98 -0
- ml4t_data-0.1.0/tests/test_polygon_provider.py +581 -0
- ml4t_data-0.1.0/tests/test_polymarket_unit.py +818 -0
- ml4t_data-0.1.0/tests/test_provider_consistency.py +180 -0
- ml4t_data-0.1.0/tests/test_provider_contract_verification.py +55 -0
- ml4t_data-0.1.0/tests/test_provider_registration.py +87 -0
- ml4t_data-0.1.0/tests/test_provider_registry_contract.py +120 -0
- ml4t_data-0.1.0/tests/test_provider_updater.py +520 -0
- ml4t_data-0.1.0/tests/test_rate_limit.py +114 -0
- ml4t_data-0.1.0/tests/test_release_workflows.py +206 -0
- ml4t_data-0.1.0/tests/test_retry.py +61 -0
- ml4t_data-0.1.0/tests/test_security.py +177 -0
- ml4t_data-0.1.0/tests/test_sessions.py +656 -0
- ml4t_data-0.1.0/tests/test_simple_utils.py +51 -0
- ml4t_data-0.1.0/tests/test_storage.py +78 -0
- ml4t_data-0.1.0/tests/test_storage_backends.py +445 -0
- ml4t_data-0.1.0/tests/test_storage_config_authority.py +107 -0
- ml4t_data-0.1.0/tests/test_storage_migration.py +585 -0
- ml4t_data-0.1.0/tests/test_storage_paths.py +155 -0
- ml4t_data-0.1.0/tests/test_synthetic_provider.py +435 -0
- ml4t_data-0.1.0/tests/test_tiingo_provider.py +436 -0
- ml4t_data-0.1.0/tests/test_twelve_data_provider.py +296 -0
- ml4t_data-0.1.0/tests/test_universe.py +340 -0
- ml4t_data-0.1.0/tests/test_update_manager.py +764 -0
- ml4t_data-0.1.0/tests/test_utils_gaps.py +445 -0
- ml4t_data-0.1.0/tests/test_validation.py +441 -0
- ml4t_data-0.1.0/tests/test_validation_report.py +369 -0
- ml4t_data-0.1.0/tests/test_validation_rules.py +405 -0
- ml4t_data-0.1.0/tests/test_validation_simple.py +25 -0
- ml4t_data-0.1.0/tests/test_validation_unit.py +185 -0
- ml4t_data-0.1.0/tests/test_wiki_prices_provider.py +649 -0
- ml4t_data-0.1.0/tests/test_yahoo_provider.py +217 -0
- ml4t_data-0.1.0/tests/test_yahoo_provider_edge_cases.py +456 -0
- ml4t_data-0.1.0/tests/test_yahoo_provider_unit.py +403 -0
- ml4t_data-0.1.0/tests/utils/test_format.py +500 -0
- ml4t_data-0.1.0/tests/utils/test_format_integration.py +157 -0
- ml4t_data-0.1.0/tests/validation/test_cross_validation.py +660 -0
- ml4t_data-0.1.0/tests/validation/test_ohlcv_validator.py +1174 -0
- ml4t_data-0.1.0/tests/validation/test_report.py +542 -0
- ml4t_data-0.1.0/tests/validation/test_rules.py +387 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*$py.class
|
|
4
|
+
*.so
|
|
5
|
+
.Python
|
|
6
|
+
build/
|
|
7
|
+
develop-eggs/
|
|
8
|
+
dist/
|
|
9
|
+
downloads/
|
|
10
|
+
eggs/
|
|
11
|
+
.eggs/
|
|
12
|
+
lib/
|
|
13
|
+
lib64/
|
|
14
|
+
parts/
|
|
15
|
+
sdist/
|
|
16
|
+
var/
|
|
17
|
+
wheels/
|
|
18
|
+
*.egg-info/
|
|
19
|
+
.installed.cfg
|
|
20
|
+
*.egg
|
|
21
|
+
.env
|
|
22
|
+
.venv/
|
|
23
|
+
venv/
|
|
24
|
+
ENV/
|
|
25
|
+
.mypy_cache/
|
|
26
|
+
.ruff_cache/
|
|
27
|
+
.pytest_cache/
|
|
28
|
+
.coverage
|
|
29
|
+
htmlcov/
|
|
30
|
+
*.log
|
|
31
|
+
.DS_Store
|
|
32
|
+
*.tmp
|
|
33
|
+
/data/
|
|
34
|
+
logs/
|
|
35
|
+
site/
|
|
36
|
+
src/ml4t/data/_version.py
|
|
37
|
+
coverage/
|
|
38
|
+
|
|
39
|
+
# Claude Code (local development only)
|
|
40
|
+
CLAUDE.md
|
|
41
|
+
.claude/
|
|
42
|
+
.agentic_documentation/
|
|
43
|
+
.skills-outputs/
|
|
44
|
+
planning/
|
|
45
|
+
.idea/
|
ml4t_data-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Stefan Jansen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ml4t_data-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ml4t-data
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: High-performance market data management library with unified multi-provider interface
|
|
5
|
+
Project-URL: Homepage, https://www.ml4trading.io/docs/data/
|
|
6
|
+
Project-URL: Documentation, https://www.ml4trading.io/docs/data/
|
|
7
|
+
Project-URL: Repository, https://github.com/ml4t/data
|
|
8
|
+
Project-URL: Issues, https://github.com/ml4t/data/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/ml4t/data/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: ML4T Team <info@ml4trading.io>
|
|
11
|
+
Maintainer-email: ML4T Contributors <dev@ml4trading.io>
|
|
12
|
+
License: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: backtesting,binance,cryptocompare,databento,finance,market-data,oanda,parquet,polars,quantitative-finance,trading,yahoo-finance
|
|
15
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
18
|
+
Classifier: Intended Audience :: Science/Research
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
20
|
+
Classifier: Operating System :: MacOS
|
|
21
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
22
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
23
|
+
Classifier: Programming Language :: Python :: 3
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
+
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
29
|
+
Classifier: Typing :: Typed
|
|
30
|
+
Requires-Python: >=3.12
|
|
31
|
+
Requires-Dist: aiofiles>=23.0.0
|
|
32
|
+
Requires-Dist: click>=8.0.0
|
|
33
|
+
Requires-Dist: filelock>=3.19.1
|
|
34
|
+
Requires-Dist: httpx>=0.25.0
|
|
35
|
+
Requires-Dist: numpy>=1.24.0
|
|
36
|
+
Requires-Dist: openpyxl>=3.1.5
|
|
37
|
+
Requires-Dist: pandas-market-calendars>=4.3.0
|
|
38
|
+
Requires-Dist: pandas>=2.0.0
|
|
39
|
+
Requires-Dist: platformdirs>=4.0.0
|
|
40
|
+
Requires-Dist: polars>=0.20.0
|
|
41
|
+
Requires-Dist: pybreaker>=1.0.0
|
|
42
|
+
Requires-Dist: pydantic-settings>=2.0.0
|
|
43
|
+
Requires-Dist: pydantic<3,>=2.12
|
|
44
|
+
Requires-Dist: pydantic>=2.14.0b1; python_version >= '3.15'
|
|
45
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
46
|
+
Requires-Dist: pyyaml>=6.0
|
|
47
|
+
Requires-Dist: rich>=13.0.0
|
|
48
|
+
Requires-Dist: structlog>=23.0.0
|
|
49
|
+
Requires-Dist: tenacity>=8.0.0
|
|
50
|
+
Provides-Extra: all
|
|
51
|
+
Requires-Dist: cot-reports>=0.1.0; extra == 'all'
|
|
52
|
+
Requires-Dist: databento>=0.38.0; extra == 'all'
|
|
53
|
+
Requires-Dist: hypothesis>=6.80.0; extra == 'all'
|
|
54
|
+
Requires-Dist: ipdb>=0.13.0; extra == 'all'
|
|
55
|
+
Requires-Dist: ipython>=8.14.0; extra == 'all'
|
|
56
|
+
Requires-Dist: mkdocs-git-revision-date-localized-plugin>=1.2.0; extra == 'all'
|
|
57
|
+
Requires-Dist: mkdocs-material>=9.5.0; extra == 'all'
|
|
58
|
+
Requires-Dist: mkdocs<2,>=1.6; extra == 'all'
|
|
59
|
+
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'all'
|
|
60
|
+
Requires-Dist: oandapyv20>=0.7.0; extra == 'all'
|
|
61
|
+
Requires-Dist: pre-commit>=3.3.0; extra == 'all'
|
|
62
|
+
Requires-Dist: pyarrow>=14.0.0; extra == 'all'
|
|
63
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'all'
|
|
64
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'all'
|
|
65
|
+
Requires-Dist: pytest-timeout>=2.1.0; extra == 'all'
|
|
66
|
+
Requires-Dist: pytest-xdist>=3.3.0; extra == 'all'
|
|
67
|
+
Requires-Dist: pytest>=7.4.0; extra == 'all'
|
|
68
|
+
Requires-Dist: requests>=2.32.0; extra == 'all'
|
|
69
|
+
Requires-Dist: ruff>=0.1.0; extra == 'all'
|
|
70
|
+
Requires-Dist: ty; extra == 'all'
|
|
71
|
+
Requires-Dist: xlsxwriter>=3.1.0; extra == 'all'
|
|
72
|
+
Requires-Dist: yfinance>=0.2.0; extra == 'all'
|
|
73
|
+
Provides-Extra: all-providers
|
|
74
|
+
Requires-Dist: cot-reports>=0.1.0; extra == 'all-providers'
|
|
75
|
+
Requires-Dist: databento>=0.38.0; extra == 'all-providers'
|
|
76
|
+
Requires-Dist: oandapyv20>=0.7.0; extra == 'all-providers'
|
|
77
|
+
Requires-Dist: pyarrow>=14.0.0; extra == 'all-providers'
|
|
78
|
+
Requires-Dist: requests>=2.32.0; extra == 'all-providers'
|
|
79
|
+
Requires-Dist: yfinance>=0.2.0; extra == 'all-providers'
|
|
80
|
+
Provides-Extra: cot
|
|
81
|
+
Requires-Dist: cot-reports>=0.1.0; extra == 'cot'
|
|
82
|
+
Provides-Extra: databento
|
|
83
|
+
Requires-Dist: databento>=0.38.0; extra == 'databento'
|
|
84
|
+
Requires-Dist: pyarrow>=14.0.0; extra == 'databento'
|
|
85
|
+
Provides-Extra: dev
|
|
86
|
+
Requires-Dist: hypothesis>=6.80.0; extra == 'dev'
|
|
87
|
+
Requires-Dist: ipdb>=0.13.0; extra == 'dev'
|
|
88
|
+
Requires-Dist: ipython>=8.14.0; extra == 'dev'
|
|
89
|
+
Requires-Dist: oandapyv20>=0.7.0; extra == 'dev'
|
|
90
|
+
Requires-Dist: pre-commit>=3.3.0; extra == 'dev'
|
|
91
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
92
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
93
|
+
Requires-Dist: pytest-timeout>=2.1.0; extra == 'dev'
|
|
94
|
+
Requires-Dist: pytest-xdist>=3.3.0; extra == 'dev'
|
|
95
|
+
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
96
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
97
|
+
Requires-Dist: ty; extra == 'dev'
|
|
98
|
+
Requires-Dist: xlsxwriter>=3.1.0; extra == 'dev'
|
|
99
|
+
Provides-Extra: docs
|
|
100
|
+
Requires-Dist: mkdocs-git-revision-date-localized-plugin>=1.2.0; extra == 'docs'
|
|
101
|
+
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
|
|
102
|
+
Requires-Dist: mkdocs<2,>=1.6; extra == 'docs'
|
|
103
|
+
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
|
|
104
|
+
Provides-Extra: oanda
|
|
105
|
+
Requires-Dist: oandapyv20>=0.7.0; extra == 'oanda'
|
|
106
|
+
Requires-Dist: requests>=2.32.0; extra == 'oanda'
|
|
107
|
+
Provides-Extra: yahoo
|
|
108
|
+
Requires-Dist: yfinance>=0.2.0; extra == 'yahoo'
|
|
109
|
+
Description-Content-Type: text/markdown
|
|
110
|
+
|
|
111
|
+
# ml4t-data
|
|
112
|
+
|
|
113
|
+
[](https://www.python.org/downloads/)
|
|
114
|
+
[](https://pypi.org/project/ml4t-data/)
|
|
115
|
+
[](https://opensource.org/licenses/MIT)
|
|
116
|
+
|
|
117
|
+
Unified market data acquisition and storage for quantitative research workflows.
|
|
118
|
+
|
|
119
|
+
## Part of the ML4T Library Ecosystem
|
|
120
|
+
|
|
121
|
+
This library is one of six interconnected libraries supporting the machine learning for trading workflow described in [Machine Learning for Trading](https://www.ml4trading.io):
|
|
122
|
+
|
|
123
|
+

|
|
124
|
+
|
|
125
|
+
Together they cover data infrastructure, feature engineering, modeling, signal evaluation, strategy backtesting, and live deployment.
|
|
126
|
+
|
|
127
|
+
## What This Library Does
|
|
128
|
+
|
|
129
|
+
Quantitative research requires consistent, reproducible access to market data from multiple sources. ml4t-data provides:
|
|
130
|
+
|
|
131
|
+
- `DataManager` as the unified OHLCV interface for registry providers with that capability
|
|
132
|
+
- 20+ provider adapters covering equities, crypto, futures, forex, macro, prediction markets, and factors
|
|
133
|
+
- Automated storage in Hive-partitioned Parquet format with metadata tracking
|
|
134
|
+
- Incremental updates, gap detection, and backfill via CLI
|
|
135
|
+
- Built-in data validation (OHLC invariants, deduplication, anomaly detection)
|
|
136
|
+
- Futures module for CME/ICE bulk downloads with continuous contract construction
|
|
137
|
+
- COT module for CFTC Commitment of Traders weekly reports
|
|
138
|
+
- Resilience: rate limiting, retry with exponential backoff, gap detection
|
|
139
|
+
|
|
140
|
+
The goal is to support an ongoing research workflow rather than one-off downloads. Data is stored locally, tracked for freshness, and queryable with tools like DuckDB or Polars.
|
|
141
|
+
|
|
142
|
+

|
|
143
|
+
|
|
144
|
+
## Installation
|
|
145
|
+
|
|
146
|
+
ML4T Data supports stable CPython 3.12 through 3.14 on Linux, macOS, and Windows.
|
|
147
|
+
Python 3.15 prereleases are tested as informational compatibility checks but are not supported
|
|
148
|
+
until the required dependencies publish compatible distributions. The Databento SDK currently
|
|
149
|
+
has no CPython 3.15 distribution, so the 3.15 prerelease lane tests the core package without the
|
|
150
|
+
Databento extra.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
pip install ml4t-data
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Quick Start
|
|
157
|
+
|
|
158
|
+
### DataManager (Unified Interface)
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
from ml4t.data import DataManager
|
|
162
|
+
|
|
163
|
+
dm = DataManager()
|
|
164
|
+
|
|
165
|
+
# Fetch and store
|
|
166
|
+
dm.fetch("AAPL", "2020-01-01", "2024-12-31", provider="yahoo")
|
|
167
|
+
|
|
168
|
+
# Load from local storage
|
|
169
|
+
data = dm.load("AAPL", "2020-01-01", "2024-12-31")
|
|
170
|
+
|
|
171
|
+
# Batch load multiple symbols
|
|
172
|
+
prices = dm.batch_load(["AAPL", "MSFT", "GOOGL"], "2020-01-01", "2024-12-31")
|
|
173
|
+
|
|
174
|
+
# Incremental update
|
|
175
|
+
dm.update("AAPL")
|
|
176
|
+
|
|
177
|
+
# List what's stored
|
|
178
|
+
symbols = dm.list_symbols()
|
|
179
|
+
metadata = dm.get_metadata("AAPL")
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Direct Provider Access
|
|
183
|
+
|
|
184
|
+
Providers expose capability-specific methods. OHLCV providers use `fetch_ohlcv`, economic-series
|
|
185
|
+
providers may also use `fetch_series`, and factor providers use `fetch`.
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
from datetime import UTC, datetime, timedelta
|
|
189
|
+
|
|
190
|
+
from ml4t.data.providers import YahooFinanceProvider, CoinGeckoProvider, FREDProvider
|
|
191
|
+
|
|
192
|
+
# Equities
|
|
193
|
+
provider = YahooFinanceProvider()
|
|
194
|
+
data = provider.fetch_ohlcv("AAPL", "2020-01-01", "2024-12-31")
|
|
195
|
+
|
|
196
|
+
# Crypto
|
|
197
|
+
last_complete_day = datetime.now(UTC).date() - timedelta(days=1)
|
|
198
|
+
crypto = CoinGeckoProvider().fetch_ohlcv(
|
|
199
|
+
"bitcoin",
|
|
200
|
+
str(last_complete_day - timedelta(days=6)),
|
|
201
|
+
str(last_complete_day),
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
# Economic data
|
|
205
|
+
# Reads FRED_API_KEY from the environment
|
|
206
|
+
fred = FREDProvider().fetch_series("GDP", "2020-01-01", "2024-12-31")
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Data Providers
|
|
210
|
+
|
|
211
|
+
### No API Key Required
|
|
212
|
+
|
|
213
|
+
| Provider | Coverage |
|
|
214
|
+
|----------|----------|
|
|
215
|
+
| Yahoo Finance | US/global equities, ETFs, crypto, forex |
|
|
216
|
+
| CoinGecko | 10,000+ cryptocurrencies; daily OHLCV for 29 completed UTC days |
|
|
217
|
+
| FXMacroData | FX macro releases, calendars, COT, commodities, sentiment |
|
|
218
|
+
| Fama-French | Academic factor data |
|
|
219
|
+
| AQR | Research factors (QMJ, BAB, HML Devil, VME, more) |
|
|
220
|
+
| Wiki Prices | Frozen US equities history (1962-2018) |
|
|
221
|
+
| Kalshi | Prediction market contracts |
|
|
222
|
+
| Polymarket | Prediction market history/order book snapshots |
|
|
223
|
+
| Binance Public | Bulk crypto data downloads |
|
|
224
|
+
| Binance | Crypto exchange data |
|
|
225
|
+
| OKX | Crypto perpetuals and funding rates |
|
|
226
|
+
| NASDAQ ITCH Sample | Tick-level sample data |
|
|
227
|
+
|
|
228
|
+
### Authenticated or Metered APIs
|
|
229
|
+
|
|
230
|
+
| Provider | Coverage |
|
|
231
|
+
|----------|----------|
|
|
232
|
+
| FRED | 850,000 economic series |
|
|
233
|
+
| Alpaca | US equities + crypto (free IEX feed) |
|
|
234
|
+
| EODHD | 60+ global exchanges |
|
|
235
|
+
| Tiingo | US equities with quality focus |
|
|
236
|
+
| Twelve Data | Multi-asset coverage |
|
|
237
|
+
| Databento | CME/ICE futures; OPRA options |
|
|
238
|
+
| Massive | US equities, options, futures, forex, crypto |
|
|
239
|
+
| Finnhub | 70+ global exchanges |
|
|
240
|
+
| OANDA | Forex broker data |
|
|
241
|
+
| CryptoCompare | Included adapter; not release-qualified for 0.1.0 |
|
|
242
|
+
|
|
243
|
+
CryptoCompare account registration was unavailable during the 0.1.0 release review, so no live
|
|
244
|
+
contract evidence was obtained. The adapter remains available for evaluation, but CryptoCompare is
|
|
245
|
+
not part of the release-qualified provider set until its contract passes on a release commit.
|
|
246
|
+
|
|
247
|
+
## Specialized Modules
|
|
248
|
+
|
|
249
|
+
### Futures
|
|
250
|
+
|
|
251
|
+
Bulk download and continuous contract construction for CME/ICE products:
|
|
252
|
+
|
|
253
|
+
```python
|
|
254
|
+
from ml4t.data.futures import FuturesDownloader, ContinuousContractBuilder
|
|
255
|
+
|
|
256
|
+
# Bulk download via Databento (parent symbology)
|
|
257
|
+
downloader = FuturesDownloader(config)
|
|
258
|
+
downloader.download() # Downloads ES, NQ, CL, GC, etc.
|
|
259
|
+
|
|
260
|
+
# Build continuous contracts with configurable roll logic
|
|
261
|
+
builder = ContinuousContractBuilder()
|
|
262
|
+
continuous = builder.build(contracts_df, roll_method="volume")
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Book-focused interface with profiling:
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
from ml4t.data.futures import FuturesDataManager
|
|
269
|
+
|
|
270
|
+
fm = FuturesDataManager.from_config("config.yaml")
|
|
271
|
+
fm.download_all()
|
|
272
|
+
data = fm.load_ohlcv("ES")
|
|
273
|
+
profile = fm.generate_profile("ES")
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### COT (Commitment of Traders)
|
|
277
|
+
|
|
278
|
+
CFTC weekly positioning data for futures markets:
|
|
279
|
+
|
|
280
|
+
```python
|
|
281
|
+
import polars as pl
|
|
282
|
+
|
|
283
|
+
from ml4t.data.cot import COTFetcher, combine_cot_ohlcv, create_cot_features
|
|
284
|
+
|
|
285
|
+
fetcher = COTFetcher()
|
|
286
|
+
official_schedule = pl.read_parquet("cot-release-schedule.parquet")
|
|
287
|
+
cot_data = fetcher.fetch_product(
|
|
288
|
+
"ES",
|
|
289
|
+
start_year=2015,
|
|
290
|
+
end_year=2024,
|
|
291
|
+
release_schedule=official_schedule,
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
# Point-in-time combination with OHLCV
|
|
295
|
+
combined = combine_cot_ohlcv(ohlcv_data, cot_data)
|
|
296
|
+
|
|
297
|
+
# Generate weekly features without counting forward-filled daily rows as new reports
|
|
298
|
+
features = create_cot_features(combined)
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
The schedule must contain one `report_date` and timezone-aware `available_at` timestamp per
|
|
302
|
+
report. CFTC publishes a tentative schedule for only the latest 13 months, so retain the exact
|
|
303
|
+
release timestamps you use for historical research. Shutdown catch-up releases and other
|
|
304
|
+
exceptions must use their actual publication timestamps. See the
|
|
305
|
+
[official CFTC release schedule](https://www.cftc.gov/MarketReports/CommitmentsofTraders/ReleaseSchedule/index.htm).
|
|
306
|
+
|
|
307
|
+
### Book Data Managers
|
|
308
|
+
|
|
309
|
+
Simplified interfaces for the ML4T book workflow:
|
|
310
|
+
|
|
311
|
+
```python
|
|
312
|
+
from ml4t.data.etfs import ETFDataManager
|
|
313
|
+
from ml4t.data.crypto import CryptoDataManager
|
|
314
|
+
|
|
315
|
+
# 50 diversified ETFs via Yahoo Finance
|
|
316
|
+
etf_dm = ETFDataManager.from_config("config.yaml")
|
|
317
|
+
etf_dm.download_all()
|
|
318
|
+
aapl = etf_dm.load_ohlcv("AAPL")
|
|
319
|
+
|
|
320
|
+
# Crypto premium index via Binance Public
|
|
321
|
+
crypto_dm = CryptoDataManager.from_config("config.yaml")
|
|
322
|
+
crypto_dm.download_premium_index()
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## CLI for Automated Updates
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
# Fetch specific symbols
|
|
329
|
+
ml4t-data fetch -s AAPL -s MSFT -s GOOGL --provider yahoo --start 2020-01-01
|
|
330
|
+
|
|
331
|
+
# Incremental update
|
|
332
|
+
ml4t-data update --symbol AAPL
|
|
333
|
+
|
|
334
|
+
# Validate data quality
|
|
335
|
+
ml4t-data validate --symbol AAPL --anomalies
|
|
336
|
+
|
|
337
|
+
# Check storage status
|
|
338
|
+
ml4t-data status --detailed
|
|
339
|
+
|
|
340
|
+
# List available data
|
|
341
|
+
ml4t-data list-data
|
|
342
|
+
|
|
343
|
+
# Export to CSV/JSON/Excel
|
|
344
|
+
ml4t-data export --symbol AAPL --format-type csv --output aapl.csv
|
|
345
|
+
|
|
346
|
+
# Get symbol info
|
|
347
|
+
ml4t-data info --symbol AAPL
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Configuration-driven batch updates:
|
|
351
|
+
|
|
352
|
+
```yaml
|
|
353
|
+
storage:
|
|
354
|
+
base_path: ~/data/market
|
|
355
|
+
|
|
356
|
+
datasets:
|
|
357
|
+
- name: sp500_daily
|
|
358
|
+
provider: yahoo
|
|
359
|
+
symbols_file: symbols/sp500.txt
|
|
360
|
+
frequency: daily
|
|
361
|
+
start_date: 2015-01-01
|
|
362
|
+
|
|
363
|
+
- name: crypto
|
|
364
|
+
provider: coingecko
|
|
365
|
+
symbols: [bitcoin, ethereum, solana]
|
|
366
|
+
frequency: daily
|
|
367
|
+
initial_load_days: 29
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## Storage Format
|
|
371
|
+
|
|
372
|
+
Data is stored in Hive-partitioned Parquet:
|
|
373
|
+
|
|
374
|
+
```
|
|
375
|
+
~/data/market/
|
|
376
|
+
├── yahoo/daily/symbol=AAPL/data.parquet
|
|
377
|
+
├── yahoo/daily/symbol=MSFT/data.parquet
|
|
378
|
+
└── coingecko/daily/symbol=bitcoin/data.parquet
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Query with DuckDB or Polars:
|
|
382
|
+
|
|
383
|
+
```python
|
|
384
|
+
import duckdb
|
|
385
|
+
|
|
386
|
+
result = duckdb.execute("""
|
|
387
|
+
SELECT * FROM read_parquet('~/data/market/yahoo/daily/**/*.parquet')
|
|
388
|
+
WHERE symbol IN ('AAPL', 'MSFT')
|
|
389
|
+
AND date >= '2024-01-01'
|
|
390
|
+
""").pl()
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## Data Validation
|
|
394
|
+
|
|
395
|
+
```python
|
|
396
|
+
from ml4t.data.validation import OHLCVValidator, ValidationReport
|
|
397
|
+
|
|
398
|
+
validator = OHLCVValidator()
|
|
399
|
+
report = validator.validate(data)
|
|
400
|
+
# Checks: high >= low, high >= open/close, low <= open/close
|
|
401
|
+
# Detects: duplicates, gaps, anomalies
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
Anomaly detection:
|
|
405
|
+
|
|
406
|
+
```python
|
|
407
|
+
from ml4t.data.anomaly import AnomalyManager, ReturnOutlierDetector, VolumeSpikeDetector
|
|
408
|
+
|
|
409
|
+
manager = AnomalyManager([
|
|
410
|
+
ReturnOutlierDetector(),
|
|
411
|
+
VolumeSpikeDetector(),
|
|
412
|
+
])
|
|
413
|
+
report = manager.detect(data)
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
## Documentation
|
|
417
|
+
|
|
418
|
+
- [Getting Started](docs/user-guide/getting-started.md) - quick start guide
|
|
419
|
+
- [Configuration](docs/user-guide/configuration.md) - YAML config reference
|
|
420
|
+
- [Storage](docs/user-guide/storage.md) - Hive partitioning and backends
|
|
421
|
+
- [Incremental Updates](docs/user-guide/incremental-updates.md) - update strategies and gap detection
|
|
422
|
+
- [Data Quality](docs/user-guide/data-quality.md) - validation and anomaly detection
|
|
423
|
+
- [CLI Reference](docs/user-guide/cli-reference.md) - command-line interface
|
|
424
|
+
- [Provider Selection Guide](docs/getting-started/provider-selection.md) - choosing providers
|
|
425
|
+
- [Creating a Provider](docs/contributing/creating-a-provider.md) - extending with new sources
|
|
426
|
+
|
|
427
|
+
## Technical Characteristics
|
|
428
|
+
|
|
429
|
+
- **Polars-based**: Native Polars DataFrames throughout
|
|
430
|
+
- **Capability-specific schemas**: OHLCV, economic-series, factor, and specialized providers
|
|
431
|
+
expose contracts suited to their data
|
|
432
|
+
- **Async support**: OHLCV providers implementing the async protocol can use parallel batch operations
|
|
433
|
+
- **Metadata tracking**: Last update timestamps, row counts, date ranges
|
|
434
|
+
- **Resilience**: Rate limiting, retry with exponential backoff, gap detection
|
|
435
|
+
- **Storage layouts**: Partitioned Hive and single-file Parquet storage
|
|
436
|
+
- **Type-safe**: Full type annotations throughout
|
|
437
|
+
|
|
438
|
+
## Related Libraries
|
|
439
|
+
|
|
440
|
+
- **ml4t-engineer**: Feature engineering and technical indicators
|
|
441
|
+
- **ml4t-diagnostic**: Signal evaluation and statistical validation
|
|
442
|
+
- **ml4t-backtest**: Event-driven backtesting
|
|
443
|
+
- **ml4t-live**: Live trading with broker integration
|
|
444
|
+
|
|
445
|
+
## Development
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
git clone https://github.com/ml4t/data.git ml4t-data
|
|
449
|
+
cd ml4t-data
|
|
450
|
+
uv sync
|
|
451
|
+
uv run pytest tests/ -q
|
|
452
|
+
uv run ty check
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
## License
|
|
456
|
+
|
|
457
|
+
MIT License - see [LICENSE](LICENSE) for details.
|