- ✅ Real-time trade stream for any cryptocurrency pair
- ✅ Ticker stream with current price, 24h changes, high/low and volume
- ✅ Professional colored terminal visualization
- ✅ Modular and scalable architecture for future features
- ✅ Automatic error handling and reconnection
- ✅ Cross-platform (Windows, Linux, macOS)
- ✅ Interactive menu for symbol selection
- ✅ Support for 15+ popular cryptocurrency pairs
- Install dependencies:
pip install -r requirements.txtRun the program:
python main.pyThe program will show an interactive menu where you can:
- Select a cryptocurrency symbol (BTC, ETH, SOL, etc.)
- Choose which streams to activate (Trade, Ticker, or both)
- Monitor real-time data with colored output
Press Ctrl+C to stop the stream.
python-binance/
├── src/
│ ├── config/
│ │ └── settings.py # Global configurations
│ ├── utils/
│ │ └── colors.py # Terminal color management
│ ├── ui/
│ │ └── menu.py # Interactive menu system
│ └── stream/
│ ├── manager.py # WebSocket manager
│ └── handlers.py # Trade and ticker handlers
├── main.py # Entry point
├── requirements.txt # Dependencies
├── api.md # Binance API documentation
└── websocket.md # Binance WebSocket documentation
Modify src/config/settings.py to customize:
- Default symbol to monitor (default: BTCUSDT)
- API Keys (optional for public streams)
- Testnet mode
- Value formatting
The project is structured to be easily extensible:
-
Add new streams: Add methods in
BinanceStreamManager -
New handlers: Create new classes in
handlers.py -
New display formats: Extend
colors.py -
New commands: Add logic in
main.pyor create a CLI
================================================================================
Binance Stream Monitor
================================================================================
Configuration:
Symbol: BTCUSDT
Active streams: Trade | Ticker
Press Ctrl+C to stop
--------------------------------------------------------------------------------
✓ Trade stream started
✓ Ticker stream started
14:23:15 │ BUY │ BTCUSDT │ Price: 43,250.50 │ Volume: 0.00125000
14:23:16 │ BTCUSDT │ Price: 43,251.20 (+0.15%) │ 24h High: 43,500.00 │ 24h Low: 42,800.00 │ 24h Volume: 1250.50000000
14:23:17 │ SELL │ BTCUSDT │ Price: 43,250.00 │ Volume: 0.00250000
python-binance: Python client for Binance APIcolorama: Cross-platform terminal colors
- Public streams do not require API keys
- The program automatically handles reconnections
- Messages are formatted and colored for better readability
This project is open source and available for use and modification.
Contributions are welcome! Please feel free to submit a Pull Request.