Skip to content

sjhavar/crypto-websockets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto WebSockets

A Python-based cryptocurrency data collector that supports both REST API and WebSocket connections for real-time market data collection.

Features

  • REST API Collector: Synchronous and asynchronous implementations for fetching cryptocurrency data
  • WebSocket Collector: Real-time data streaming from cryptocurrency exchanges
  • Exchange Support: Currently supports Coinbase Pro WebSocket feeds
  • Flexible Configuration: Easy-to-configure system for different exchanges and data types
  • Database Integration: Supabase integration for data persistence

Installation

  1. Clone the repository:
git clone https://github.com/sjhavar/crypto-websockets.git
cd crypto-websockets
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables: Create a .env file in the root directory with your configuration:
# Add your environment variables here

Usage

REST API Collector

Synchronous version:

from collectors.rest_api.collector import collect_data

Asynchronous version:

from collectors.rest_api.collector_async import async_collect_data

WebSocket Collector

Run the Coinbase WebSocket collector:

python collectors/websocket/coinbase_websocket.py

Test WebSocket connection:

python collectors/websocket/test_connection.py

One-time Import

For bulk data import:

python one_time_import.py

Project Structure

crypto-websockets/
├── collectors/
│   ├── rest_api/
│   │   ├── collector.py          # Synchronous REST API collector
│   │   └── collector_async.py    # Asynchronous REST API collector
│   └── websocket/
│       ├── coinbase_websocket.py # Coinbase WebSocket implementation
│       └── test_connection.py    # Connection testing utility
├── config.py                     # Configuration management
├── one_time_import.py           # Bulk import utility
├── requirements.txt             # Python dependencies
└── README.md                    # This file

Requirements

  • Python 3.7+
  • See requirements.txt for Python package dependencies

Contributing

Feel free to submit issues and enhancement requests!

License

[Specify your license here]

About

real time data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages