PyCryptoEx
A Python library providing a clients for interacting with various APIs of cryptocurrency exchanges for trading and accessing market data.
Installation
pip install -U pycryptoex
Choose and install one or more supported crypto exchanges:
pycryptoex [names ...]
For example:
pycryptoex bybit kucoin
Install from Github main
pip install -U git+https://github.com/ren3104/pycryptoex@main
pycryptoex [names ...] --update --version main
Quick Start
import asyncio
from pycryptoex import KuCoin, Bybit
async def handler(json_data):
print(json_data)
async def main():
# Request to public endpoints
kucoin = KuCoin()
async with kucoin:
await kucoin.request(...)
# Request to private endpoints
bybit = Bybit(
api_key="YOUR_API_KEY",
secret="YOUR_API_SECRET"
)
async with bybit:
await bybit.request(..., signed=True)
# Start the public websocket
kucoin_public_ws = await kucoin.create_websocket_stream()
await kucoin_public_ws.start()
# Subscribe handler to a public channel
topic = "/market/candles:BTC-USDT_1min"
await kucoin_public_ws.subscribe_callback(topic, handler)
# Unsubscribe handler from a public channel
await kucoin_public_ws.unsubscribe_callback(topic, handler)
# Unsubscribe all handlers from a public channel
await kucoin_public_ws.unsubscribe(topic)
# Stop the public websocket
await kucoin_public_ws.close()
# Start the private websocket
kucoin_private_ws = await kucoin.create_websocket_stream(private=True)
await kucoin_private_ws.start()
# Subscribe to private channels
await kucoin_private_ws.subscribe_callback("/account/balance", handler)
# Block until websockets close
while not kucoin_public_ws.closed or not kucoin_private_ws.closed:
await asyncio.sleep(0.1)
Supported Crypto Exchanges
| Exchange | Api Client | Websocket Stream Manager |
|---|---|---|
| Bybit | + | - |
| KuCoin | + | + |
Metadata
Release files for pycryptoex 0.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycryptoex-0.6.2.tar.gz | 10.0 kB | Without provenance | Details for pycryptoex-0.6.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycryptoex-0.6.2-py3-none-any.whl | Python 3 | none | any | Details for pycryptoex-0.6.2-py3-none-any.whl |
Total release size: 20.8 kB
Release files / pycryptoex-0.6.2.tar.gz
| Download URL | pycryptoex-0.6.2.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bfa51e29bf1fab5335a8807f39387f8c530e0e0f1790d2e5d8aa8fbc09fe8c8
|
|
BLAKE2b-256 checksum How to use checksums |
0dd8cb2f2d0065cb5e2b6d0517e6342bc773c6f9b5cd1a79960d90116ce8129f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Release files / pycryptoex-0.6.2-py3-none-any.whl
| Download URL | pycryptoex-0.6.2-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2d4e72da9d1a74ebb65de8502d1b40d59abeba33db6044abfb25f456b89e56c
|
|
BLAKE2b-256 checksum How to use checksums |
b4232d3d5205ce82675cbc9a5e5656d61544eed3ed601bf1d64d21c4b73eb01c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Security for pycryptoex 0.6.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.