No project description provided
Project description
Cybotrade
This is the Client SDK for building an automated trading strategy on Cybotrade
. The underlying libraries are written in Rust and this is a Python wrapper made possible through PyO3
.
Documentation
There are currently two main features for this library:
- Fetching historical data,
Datahub
- Collecting live market data,
MarketCollector
Datahub
This is a Python class and you can use it as follow:
# Get the Datahub's url from environment.
url = environ.get("DATAHUB_URL")
# Connect to Datahub.
datahub = await Datahub.connect(url)
# Fetch 1m candles for the past 10 minutes.
candles = await datahub.candle("BTC", "USDT", "1m", "bybit_linear", datetime.utcnow() - timedelta(minutes=10), datetime.utcnow())
Note that from the example above it is not guaranteed that you will get exactly 10 candles, you might be only getting 9 candles as the candle for the current minute is not closed yet.
Development
The underlying Rust libraries are private and hence not everyone is able to build this on their local environment. Although it is not required but using miniconda
or virtualenv
to manage your local development environment is recommended.
To build this package, first install maturin
:
pip install maturin
To build and test use maturin develop
:
pip install -r requirements-dev.txt
maturin develop && pytest
Publishing
The package is meant to be published to PyPi and the Dockerfile
uses an environment manylinux2014
to cross-compile for various linux architecture. It can be done by running the publish.sh
script.
PYPI_USERNAME=<username> PYPI_PASSWORD=<password> ./publish.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for cybotrade-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 221abf81e9b88ca73e675c15f8d66c12dc1827205d4b36bae2f0a376945604c2 |
|
MD5 | a9fc635694bb14728f3756358f7a1c44 |
|
BLAKE2b-256 | 57fdd7e66c688a59f53316bb06c40b9e53f15d021ccc1c586a7f79632e60c8b6 |