Skip to main content

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:

  1. Fetching historical data, Datahub
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cybotrade-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cybotrade-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (12.0 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page