A: Use a virtual environment to isolate dependencies:
python -m venv quantdb_env
# Linux/Mac
source quantdb_env/bin/activate
# Windows (PowerShell)
quantdb_env\Scripts\Activate.ps1
pip install quantdbA:
pip install --upgrade quantdbA: Python 3.8 and above. We recommend Python 3.9+ for best performance.
A: Due to caching. You can:
- Clear cache:
qdb.clear_cache() - Use fresh fetch where available:
qdb.get_realtime_data(symbol, force_refresh=True) - Note: TTL is managed internally in this version; there are no
set_cache_expire/disable_cachefunctions.
A: Use date parameters:
data = qdb.stock_zh_a_hist(
symbol="000001",
start_date="20200101",
end_date="20241231"
)A: Currently focusing on:
- Mainland China A-shares (SSE/SZSE)
- Hong Kong market
- US market (partial support)
A: Tips:
- Keep cache enabled (default)
- Use reasonable intervals when fetching in batch
- Warm up cache for frequently used symbols
- Periodically purge expired cache
A:
- Clear cache periodically:
qdb.clear_cache() - Manually delete the cache DB file if needed (default: in your qdb cache dir)
- Note: TTL is managed internally; there is no
set_cache_expire()function in this version
A:
stats = qdb.cache_stats()
print(stats) # e.g. {'cache_dir': '...', 'cache_size_mb': 12.34, 'initialized': True, 'status': 'Running'}A: Check:
- Network connectivity
- Firewall/Proxy constraints
- Data source availability
- Consider using a proxy or VPN if needed
A: Possible reasons:
- Invalid symbol format (e.g., use "000001" not "1")
- Wrong date format (use "YYYYMMDD")
- Temporary data source changes
A:
- First run downloads data — subsequent runs will be faster
- Ensure cache is enabled
- Check network speed
- Reduce time range
A:
# Option 1: Force refresh where supported
rt = qdb.get_realtime_data("000001", force_refresh=True)
# Option 2: Clear all cache (symbol-level clearing not yet implemented in simplified mode)
qdb.clear_cache()
# Option 3: Bypass cache by using a narrower date range if needed
hist = qdb.stock_zh_a_hist("000001", start_date="20250101", end_date="20250131")Note: TTL is managed internally in this version.
A:
- Realtime quotes: often delayed ~15 minutes
- Daily data: updated after market close
- Financials: quarterly updates
A:
- Use a dedicated database path
- Tune TTL to your workload
- Add retry logic
- Monitor cache usage regularly
A: Yes. QuantDB is primarily a cache layer for AKShare, but you can:
- Combine multiple sources
- Validate and clean data
- Build your own data pipelines
A:
- GitHub Issues: https://github.com/franksunye/quantdb/issues
- Pull Requests welcome
- Join Discussions
If you didn’t find your answer:
- See the User Guide
- See the API Reference
- Open an Issue on GitHub