Introduction
Crypto exchange APIs are often callback-oriented. This makes coding a nightmare and will distract you from your most important goal of developing a winning strategy.
aiotrading is here to solve this problem. Using it, interacting with exchanges will be as much fun as the following example:
from aiotrading import CandleStream
from aiotrading.exchange import BinanceFutures
async with BinanceFutures() as exchange:
async with CandleStream(exchange, 'btcusdt', '3m') as stream:
for i in range(10):
candle = await stream.read()
log.info(candle)
Sample output of this code example is:
connecting to exchange: binance-futures
opening candle stream btcusdt@3m
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33800.00, l:33789.99, c:33795.18, v:4.164
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33800.00, l:33789.99, c:33799.76, v:4.481
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33800.00, l:33789.99, c:33797.73, v:4.741
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33800.00, l:33789.99, c:33797.47, v:5.132
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33800.89, l:33789.99, c:33797.39, v:5.520
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33800.89, l:33789.99, c:33797.38, v:5.605
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33800.89, l:33789.99, c:33797.39, v:6.000
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33807.99, l:33789.99, c:33806.80, v:16.562
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33807.99, l:33789.99, c:33797.70, v:16.590
candle btcusdt, 3m, t:2021-01-30 11:39:00, o:33795.69, h:33807.99, l:33789.99, c:33794.60, v:17.342
closing candle stream btcusdt@3m
disconnecting from exchange: binance-futures
Installation
pip3 install aiotrading
Design Principles
- Thin portable API. Lots of exchanges exist in the wild and developers like to migrate from exchange to exchange with no hassle.
- Easy concurrency. No callbacks as they distract from the goal and introduce errors.
Status
aiotrading is at its early stage of development. It currently supports a subset of Binance exchange API services. More services will be supported in the future. It is designed in a way that other exchanges can be supported easily.
Metadata
Release files for aiotrading 0.0.4
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 |
|---|---|---|---|---|
| aiotrading-0.0.4.tar.gz | 9.7 kB | Without provenance | Details for aiotrading-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiotrading-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for aiotrading-0.0.4-py3-none-any.whl |
Total release size: 41.5 kB
Release files / aiotrading-0.0.4.tar.gz
| Download URL | aiotrading-0.0.4.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e020c8916cdf159bf385403fcf80ef9653adece461150c4e19b8102ce3305168
|
|
BLAKE2b-256 checksum How to use checksums |
952ac98f83c2e204e83799d1cf5c34a814bc4aaa9ae69f2eeb33ea72b28cfe00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Release files / aiotrading-0.0.4-py3-none-any.whl
| Download URL | aiotrading-0.0.4-py3-none-any.whl |
|---|---|
| Size | 31.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad52db00889e74a3c6370fa3cf60d36e1f5752be4fe445497ad83e7cef182fcc
|
|
BLAKE2b-256 checksum How to use checksums |
7061043318ce082346baaa78dd6ceeb8d5277c5c8760ad3e740643848257599f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Security for aiotrading 0.0.4
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.