# Cached Binance Futures Data Downloader
A lightweight Python module for downloading Binance futures market data with efficient caching support.
## Features
- Download Binance futures data for different timeframes
- Support for custom start and end periods
- Efficient caching mechanism with automatic system document folder integration
- Handles Binance API rate limits automatically
- Supports various timeframes (1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M)
- Minimal dependencies with pure Python implementation
## Installation
```bash
pip install cached-binance-data
```
## Dependencies
- python-binance>=1.0.16: Core Binance API functionality
- requests>=2.26.0: HTTP requests handling
- python-dateutil>=2.8.2: Date manipulation utilities
- pytest>=7.0.0: Testing framework (development only)
## Quick Start
```python
from cached_binance_data import BinanceDataDownloader
# Initialize downloader (uses system document folder by default)
downloader = BinanceDataDownloader()
# Or specify a custom cache directory
# downloader = BinanceDataDownloader(cache_dir="path/to/cache")
# Download XRPUSDT data for a specific period
data = downloader.download(
symbol="XRPUSDT",
timeframe="1m",
start_time="2024-01-01",
end_time="2024-01-31"
)
# Data is returned as a list of [timestamp, high, low, open, close, volume]
print(f"Downloaded {len(data)} data points")
```
## Cache Structure
By default, data is cached in your system's document folder under `binance_data/`:
- Windows: `C:/Users/<username>/Documents/binance_data/`
- macOS: `/Users/<username>/Documents/binance_data/`
- Linux: `~/Documents/binance_data/` or `~/binance_data/`
Cache files are stored with the following format:
```
SYMBOL_TIMEFRAME_STARTDATE_ENDDATE.csv
Example: XRPUSDT_1M_20240101_20240131.csv
```
You can specify a custom cache directory when initializing the downloader:
```python
downloader = BinanceDataDownloader(cache_dir="path/to/cache")
```
## Features
- Automatic data chunking for large date ranges
- Smart caching system with system integration
- Handles rate limits gracefully
- Supports all Binance futures trading pairs
- Efficient CSV-based caching for better compatibility
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the LICENSE file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/kunthet/cached-binance-data",
"name": "cached-binance-data",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Kunthet",
"author_email": "dev@kunthet.com",
"download_url": "https://files.pythonhosted.org/packages/60/80/ee0ad05ab66052bec22656a5101b1c53e21e259e013a3257c0e10e57d271/cached_binance_data-0.2.0.tar.gz",
"platform": null,
"description": "# Cached Binance Futures Data Downloader\n\nA lightweight Python module for downloading Binance futures market data with efficient caching support.\n\n## Features\n\n- Download Binance futures data for different timeframes\n- Support for custom start and end periods\n- Efficient caching mechanism with automatic system document folder integration\n- Handles Binance API rate limits automatically\n- Supports various timeframes (1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M)\n- Minimal dependencies with pure Python implementation\n\n## Installation\n\n```bash\npip install cached-binance-data\n```\n\n## Dependencies\n\n- python-binance>=1.0.16: Core Binance API functionality\n- requests>=2.26.0: HTTP requests handling\n- python-dateutil>=2.8.2: Date manipulation utilities\n- pytest>=7.0.0: Testing framework (development only)\n\n## Quick Start\n\n```python\nfrom cached_binance_data import BinanceDataDownloader\n\n# Initialize downloader (uses system document folder by default)\ndownloader = BinanceDataDownloader()\n\n# Or specify a custom cache directory\n# downloader = BinanceDataDownloader(cache_dir=\"path/to/cache\")\n\n# Download XRPUSDT data for a specific period\ndata = downloader.download(\n symbol=\"XRPUSDT\",\n timeframe=\"1m\",\n start_time=\"2024-01-01\",\n end_time=\"2024-01-31\"\n)\n\n# Data is returned as a list of [timestamp, high, low, open, close, volume]\nprint(f\"Downloaded {len(data)} data points\")\n```\n\n## Cache Structure\n\nBy default, data is cached in your system's document folder under `binance_data/`:\n- Windows: `C:/Users/<username>/Documents/binance_data/`\n- macOS: `/Users/<username>/Documents/binance_data/`\n- Linux: `~/Documents/binance_data/` or `~/binance_data/`\n\nCache files are stored with the following format:\n```\nSYMBOL_TIMEFRAME_STARTDATE_ENDDATE.csv\nExample: XRPUSDT_1M_20240101_20240131.csv\n```\n\nYou can specify a custom cache directory when initializing the downloader:\n```python\ndownloader = BinanceDataDownloader(cache_dir=\"path/to/cache\")\n```\n\n## Features\n\n- Automatic data chunking for large date ranges\n- Smart caching system with system integration\n- Handles rate limits gracefully\n- Supports all Binance futures trading pairs\n- Efficient CSV-based caching for better compatibility\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details. \n",
"bugtrack_url": null,
"license": null,
"summary": "A lightweight Python module for downloading Binance futures market data with caching support",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/kunthet/cached-binance-data"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1ced1de6d549b82298cf4640e8aa3bf4d69b9a85ff39eb0720db3181aaa8066a",
"md5": "73d19f2cea2db416dc215aeb65df6c50",
"sha256": "0a131ed76e7b9d8919ab876e85fc1caa136c7809aa440e53950c23b7804913f7"
},
"downloads": -1,
"filename": "cached_binance_data-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "73d19f2cea2db416dc215aeb65df6c50",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 9631,
"upload_time": "2025-01-26T12:21:02",
"upload_time_iso_8601": "2025-01-26T12:21:02.765954Z",
"url": "https://files.pythonhosted.org/packages/1c/ed/1de6d549b82298cf4640e8aa3bf4d69b9a85ff39eb0720db3181aaa8066a/cached_binance_data-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6080ee0ad05ab66052bec22656a5101b1c53e21e259e013a3257c0e10e57d271",
"md5": "5cdb07735b993f983431c7a6f3f5e0ae",
"sha256": "04f00353abbb208f6d6c1339b7a0b5eb105ed8b96c722549e26a56e0edecaa0c"
},
"downloads": -1,
"filename": "cached_binance_data-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5cdb07735b993f983431c7a6f3f5e0ae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 9664,
"upload_time": "2025-01-26T12:21:05",
"upload_time_iso_8601": "2025-01-26T12:21:05.493118Z",
"url": "https://files.pythonhosted.org/packages/60/80/ee0ad05ab66052bec22656a5101b1c53e21e259e013a3257c0e10e57d271/cached_binance_data-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-26 12:21:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kunthet",
"github_project": "cached-binance-data",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pandas",
"specs": [
[
">=",
"1.5.0"
]
]
},
{
"name": "numpy",
"specs": [
[
">=",
"1.21.0"
]
]
},
{
"name": "requests",
"specs": [
[
">=",
"2.26.0"
]
]
},
{
"name": "python-binance",
"specs": [
[
">=",
"1.0.16"
]
]
},
{
"name": "pytest",
"specs": [
[
">=",
"7.0.0"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
">=",
"2.8.2"
]
]
}
],
"lcname": "cached-binance-data"
}