A real-time cryptocurrency data pipeline built with Apache Kafka, Python, and Docker. The platform streams live BTC and ETH prices, ingests historical OHLCV data, and persists everything for downstream analysis.
- Live price streaming — BTC & ETH prices published to Kafka every 5 seconds
- Historical ingestion — 30 days of OHLCV data fetched and saved as CSV
- Kafka consumer — Reads from
crypto_pricestopic and writes per-coin JSON files - Dockerized broker — Kafka + Zookeeper running via Docker
- Coin-keyed messages — Ensures consistent partitioning per coin
crypto-data-platform/
├── Dockerfile
├── README.md
├── batch/
│ └── historical_ingest.py
├── data/
│ ├── raw/
│ │ ├── BTC_2026-03-22.csv
│ │ └── ETH_2026-03-22.csv
│ └── streaming_raw/
│ ├── BTC_2026-03-24.json
│ └── ETH_2026-03-24.json
├── docker-compose.yml
├── processing/
│ └── transform.py
├── requirements.txt
└── streaming/
├── 2026_04_01.txt
├── consumer.py
└── producer.py
- Docker & Docker Compose
- Python 3.8+
git clone https://github.com/dipeshluitel/crypto-data-platform.git
cd crypto-data-platformpip install -r requirements.txtdocker-compose up -dpython historical_ingest.pySaves 30 days of BTC and ETH OHLCV data to data/raw/.
python producer.pyBegins publishing live prices to the crypto_prices Kafka topic every 5 seconds.
python consumer.pyReads from the topic and appends messages to per-coin JSON files in data/streaming_raw/.
Each message published to the crypto_prices topic follows this structure:
| Field | Type | Description |
|---|---|---|
coin |
string | Coin symbol (BTC or ETH) |
price |
float | Current price in USD |
timestamp |
float | Unix timestamp at time of fetch |
kafka-python
requests
pandas
Prices fetched from the CryptoCompare API — free tier, no API key required for basic usage.
MIT License — feel free to fork, use, and build on top of this.