Installation¶
This guide covers how to install qldata and its dependencies.
Requirements¶
- Python 3.10+ (3.10, 3.11, or 3.12 recommended)
- pip or another Python package manager
Installation Options¶
Full Installation (Recommended)¶
The default installation includes all core dependencies plus support for Binance, Bybit, and DuckDB storage:
This installs:
- Core data processing:
pandas,numpy,pyarrow - Exchange adapters:
python-binance,pybit - Database storage:
duckdb - Live streaming:
websockets,aiohttp - Utilities:
tenacity(retry logic)
Minimal Installation¶
For lightweight deployments or when you only need core functionality:
This installs only:
pandas>=2.0.0numpy>=1.24.0python-dateutil>=2.8.0
Exchange-Specific Installation¶
Install support for specific exchanges only:
Feature-Specific Installation¶
Development Installation¶
For contributors and developers:
This includes:
- Testing:
pytest,pytest-cov,pytest-asyncio - Linting:
black,ruff,mypy - Documentation:
mkdocs-material,mkdocstrings
Verify Installation¶
After installation, verify everything works:
import qldata as qd
# Check version
print(f"qldata version: {qd.__version__}")
# Quick test - fetch symbol info (no API key required)
try:
info = qd.get_symbol_info("BTCUSDT", source="binance", category="spot")
print(f"✓ Successfully connected to Binance")
print(f" Symbol: {info.symbol}")
print(f" Status: {info.status}")
except Exception as e:
print(f"✗ Connection error: {e}")
Expected output:
Configuration¶
Environment Variables¶
qldata uses the following optional environment variables:
| Variable | Description | Default |
|---|---|---|
QLDATA_DATA_DIR | Directory for cached data | ~/.qldata |
QLDATA_CACHE_ENABLED | Enable/disable caching | true |
QLDATA_VALIDATION_ENABLED | Enable/disable data validation | true |
BINANCE_API_KEY | Binance API key (for private endpoints) | None |
BINANCE_API_SECRET | Binance API secret | None |
BYBIT_API_KEY | Bybit API key (for private endpoints) | None |
BYBIT_API_SECRET | Bybit API secret | None |
API Keys Not Required for Public Data
For most use cases (market data, historical bars, public trades), API keys are not required. Keys are only needed for private endpoints like account balances or order placement.
Python Configuration¶
You can also configure qldata programmatically:
import qldata as qd
# Configure at runtime
qd.config(
data_dir="./my_data",
cache_enabled=True,
validation_enabled=True
)
# Check current configuration
print(f"Data directory: {qd.get_data_dir()}")
print(f"Cache enabled: {qd.is_cache_enabled()}")
print(f"Validation enabled: {qd.is_validation_enabled()}")
Troubleshooting¶
Common Issues¶
ImportError: No module named 'binance'
You have the minimal installation. Install Binance support:
ImportError: No module named 'pybit'
You have the minimal installation. Install Bybit support:
SSL Certificate Errors
Some networks block WebSocket connections. Try:
- Check your firewall/VPN settings
- Update
certifi:pip install --upgrade certifi - If in China, consider using proxy settings
Connection Timeout Errors
Exchange APIs may be slow or rate-limited:
- Check your internet connection
- Try a different exchange (Binance vs Bybit)
- Wait a few minutes if rate-limited
Getting Help¶
- 📖 Browse the full documentation
- 🐛 Report issues on GitHub
- 💬 Check the Cookbook for examples
Next Steps¶
Ready to start using qldata?
- Quick Start Guide - Your first data query
- Core Concepts - Understand the API design
- Historical Data - Detailed API reference