← ClaudeAtlas

ccxt-pythonlisted

Libreria CCXT para exchanges de cripto en Python, REST y WebSocket: conectar, bajar datos de mercado, colocar ordenes y transmitir tickers. Para bots de trading y analisis, sync o asyncio.
CarlosCaPe/octorato · ★ 15 · AI & Automation · score 73
Install: claude install-skill CarlosCaPe/octorato
# CCXT for Python A comprehensive guide to using CCXT in Python projects for cryptocurrency exchange integration. ## Installation ### REST API (Standard) ```bash pip install ccxt ``` ### WebSocket API (Real-time, ccxt.pro) ```bash pip install ccxt ``` ### Optional Performance Enhancements ```bash pip install orjson # Faster JSON parsing pip install coincurve # Faster ECDSA signing (45ms → 0.05ms) ``` Both REST and WebSocket APIs are included in the same package. ## Quick Start ### REST API - Synchronous ```python import ccxt exchange = ccxt.binance() exchange.load_markets() ticker = exchange.fetch_ticker('BTC/USDT') print(ticker) ``` ### REST API - Asynchronous ```python import asyncio import ccxt.async_support as ccxt async def main(): exchange = ccxt.binance() await exchange.load_markets() ticker = await exchange.fetch_ticker('BTC/USDT') print(ticker) await exchange.close() # Important! asyncio.run(main()) ``` ### WebSocket API - Real-time Updates ```python import asyncio import ccxt.pro as ccxtpro async def main(): exchange = ccxtpro.binance() while True: ticker = await exchange.watch_ticker('BTC/USDT') print(ticker) # Live updates! await exchange.close() asyncio.run(main()) ``` ## REST vs WebSocket | Import | For REST | For WebSocket | |--------|----------|---------------| | **Sync** | `import ccxt` | (WebSocket requires async) | | **Async** | `import ccxt.async_support as ccxt` | `import ccxt.pro a