Skip to main content

GRVT Python SDK

Project description

uv logo pre-commit logo ruff logo bandit logo pytest logo

Docker logo GitHub Actions logo

GRVT Python SDK

CodeQL GitHub CI GitHub license


Table of Contents


Installation via pip

pip install grvt-pysdk

Usage

There are various ways to use the GRVT Python SDK

  • GRVT CCXT - CCXT compatible client for GRVT (sync Rest API calls)
  • GRVT CCXT Pro - CCXT Pro compatible client for GRVT (async Rest API calls)
  • GRVT CCXT WS - CCXT Pro + Web Socket client, supports async Rest APIs + WS subscriptions + JSON RPC calls over Web Sockets.
  • GRVT API Sync - Synchronous API client for GRVT
  • GRVT API Async - Asynchronous API client for GRVT

Contributor's guide

Prerequisites

Installation of a source code

  1. Clone the git repository

    git clone https://github.com/grvt-technologies/grvt-pysdk.git
    
  2. Go into the project directory

    cd grvt-pysdk/
    
  3. Checkout working branch

    git checkout <branch>
    
  4. Install dependencies

    make install
    
  5. Enable pre-commit hooks

    pre-commit install
    

Manually run example files

Example files run extensive testing of the SDK API classes and log details about details of using GRVT API.

  1. Change to tests folder

    cd tests/pysdk
    
  2. Run example of using synchronous CCXT-compatible calls to Rest API via grvt_ccxt.py, class GrvtCcxt

    uv run python3 test_grvt_ccxt.py
    
  3. Run example of using asynchronous CCXT-compatible calls to Rest API via grvt_ccxt_pro.py, class GrvtCcxtPro

    uv run python3 test_grvt_ccxt_pro.py
    
  4. Run example of using WebSockets subscriptions and JSON RPC calls via grvt_ccxt_ws.py, class GrvtCcxtWS

    uv run python3 test_grvt_ccxt_ws.py
    

What's in the box ?

uv

uv is an extremely fast Python package and project manager, written in Rust.

pyproject.toml file (pyproject.toml): orchestrate your project and its dependencies uv.lock file (uv.lock): ensure that the package versions are consistent for everyone working on your project

For more configuration options and details, see the configuration docs.

pre-commit

pre-commit is a framework for managing and maintaining multi-language pre-commit hooks.

.pre-commit-config.yaml file (.pre-commit-config.yaml): describes what repositories and hooks are installed

For more configuration options and details, see the configuration docs.

ruff

ruff is an extremely fast Python linter, written in Rust.

Rules are defined in the pyproject.toml.

For more configuration options and details, see the configuration docs.

mypy

mypy is an optional static type checker for Python that aims to combine the benefits of dynamic (or "duck") typing and static typing.

Rules are defined in the pyproject.toml.

For more configuration options and details, see the configuration docs.

bandit

bandit is a tool designed to find common security issues in Python code.

Rules are defined in the pyproject.toml.

For more configuration options and details, see the configuration docs.

docformatter

docformatter is a tool designed to format docstrings to follow PEP 257.

Options are defined in the .pre-commit-config.yaml.


Testing

We are using pytest & pytest-cov to write tests.

To run tests with coverage:

make test
Name                                      Stmts   Miss  Cover
-------------------------------------------------------------
src/pysdk/__init__.py                         0      0   100%
src/pysdk/grvt_ccxt.py                      238     21    91%
src/pysdk/grvt_ccxt_base.py                 196     57    71%
src/pysdk/grvt_ccxt_env.py                   48     12    75%
src/pysdk/grvt_ccxt_logging_selector.py      15      7    53%
src/pysdk/grvt_ccxt_pro.py                  245     69    72%
src/pysdk/grvt_ccxt_test_utils.py            30      4    87%
src/pysdk/grvt_ccxt_types.py                 41      0   100%
src/pysdk/grvt_ccxt_utils.py                237     89    62%
src/pysdk/grvt_ccxt_ws.py                   275    238    13%
src/pysdk/grvt_raw_async.py                 149    109    27%
src/pysdk/grvt_raw_base.py                  154     69    55%
src/pysdk/grvt_raw_env.py                    27      5    81%
src/pysdk/grvt_raw_signing.py                33     17    48%
src/pysdk/grvt_raw_sync.py                  149    109    27%
src/pysdk/grvt_raw_types.py                1031      0   100%
-------------------------------------------------------------
TOTAL                                      2868    806    72%


=================================================================================================== 8 passed in 58.20s ====================================================================================================

Makefile

We are using Makefile to manage the project.

To see the list of commands:

make
  grvt-pysdk git:(main)  make
help                           Show this help
run                            Run the project
test                           Run the tests
precommit                      Run the pre-commit hooks
lint                           Run the linter
format                         Run the formatter
typecheck                      Run the type checker
security                       Run the security checker
clean                          Clean the project
install                        Install the project
build                          Build the project
publish                        Publish the project

Project details


Download files

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

Source Distribution

grvt_pysdk-0.1.7.tar.gz (196.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grvt_pysdk-0.1.7-py3-none-any.whl (65.2 kB view details)

Uploaded Python 3

File details

Details for the file grvt_pysdk-0.1.7.tar.gz.

File metadata

  • Download URL: grvt_pysdk-0.1.7.tar.gz
  • Upload date:
  • Size: 196.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for grvt_pysdk-0.1.7.tar.gz
Algorithm Hash digest
SHA256 9e2ef9e056d35b734da63583875e55afb50264a9a268371856a1c633d32b5b8b
MD5 6f049ed20aba62c5eea3a6c7b7088060
BLAKE2b-256 9cb08d0a0949b49649ed72645dce83ce5d549506b7a7257b1dfba21050e081c9

See more details on using hashes here.

File details

Details for the file grvt_pysdk-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: grvt_pysdk-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 65.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for grvt_pysdk-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a7526f42e2f2bbd06df14fa4fbb2799be90646cf92cd7176d24b5ac187de0639
MD5 62049d32763ee676582df28c8bcd3e40
BLAKE2b-256 92877336d90bd3b1799be041a3f3e0dbf5470b2cb7e8e90e6dbb57d9fd39eb09

See more details on using hashes here.

Supported by

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