Skip to main content

Python SDK for the VALR REST API

Project description

Python SDK for the VALR REST API

  • Free software: MIT license

Installation

pip install valr-python

You can also install the in-development version with:

pip install https://github.com/jonathanelscpt/valr-python/archive/master.zip

Authentication

Authenticating to the VALR API requires a valid API Key from the VALR exchange.

Documentation

To use the project:

>>> from valr_python import Client
>>> from valr_python.exceptions import IncompleteOrderWarning
>>>
>>> c = Client(api_key='api_key', api_secret='api_secret')
>>> c.rate_limiting_support = True # honour HTTP 429 "Retry-After" header values
>>> limit_order = {
...     "side": "SELL",
...     "quantity": 0.1,
...     "price": 10000,
...     "pair": "BTCZAR",
...     "post_only": True,
... }
>>> try:
...    res = c.post_limit_order(**limit_order)
...    order_id = res['id']
...    print(order_id)
... except IncompleteOrderWarning as w:  # HTTP 202 Accepted handling for incomplete orders
...    order_id = w.data['id']
...    print(order_id)
... except Exception as e:
...    print(e)
"558f5e0a-ffd1-46dd-8fae-763d93fa2f25"
>>>

Development

To execute all tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows

set PYTEST_ADDOPTS=--cov-append
tox

Other

PYTEST_ADDOPTS=--cov-append tox

Changelog

0.1.7 (2020-01-11)

  • Standardised api attribute naming in Client

  • Updated doctest and readme for more detailed SDK description

0.1.6 (2020-01-11)

  • Added custom warning IncompleteOrderWarning on receiving 202 Accepted response to support custom handling of incomplete orders

  • Added custom warning TooManyRequestsWarning during 429 handling

  • Added class flag for enabling or disabling 429 handler

0.1.5 (2020-01-11)

  • Expanded test suites to unit, functional and live integration testing

  • Internal class refactoring

  • Added optional HTTP 429 handling by honouring the “Retry-After” header value sent in VALR responses

0.1.4 (2020-01-04)

  • Streamlined ordering api calls with decorators

  • Added typing support

  • Re-worked class design internals to support later async expansion

  • Fixed bugs with str ‘None’ insertion with f-strings

  • Expanded unit tests to cover all api endpoints for synchronous client

0.1.3 (2020-01-02)

  • Fixed defect with empty body signed signatures

  • Updated class importing

  • Added additional docstrings and unit tests

0.1.2 (2019-12-31)

  • Updated readme and documentation

0.1.1 (2019-12-31)

  • corrected build error issue in setup.py

0.1.0 (2019-12-29)

  • Initial PyPi release

0.0.0 (2019-12-27)

  • Alpha-only. Not released on PyPI.

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

valr-python-0.1.7.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

valr_python-0.1.7-py2.py3-none-any.whl (13.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file valr-python-0.1.7.tar.gz.

File metadata

  • Download URL: valr-python-0.1.7.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7

File hashes

Hashes for valr-python-0.1.7.tar.gz
Algorithm Hash digest
SHA256 e3c68d7689cff9ead70c5332a981c5ff2f3c88294bc507ae47c552a50b718392
MD5 9cddabe2ad7e8d24ea46b4952a1907df
BLAKE2b-256 b3216b46e0d224eb94b06fdcfa6134ca75a330a42e75ca8b47a89f872fb07329

See more details on using hashes here.

File details

Details for the file valr_python-0.1.7-py2.py3-none-any.whl.

File metadata

  • Download URL: valr_python-0.1.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7

File hashes

Hashes for valr_python-0.1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 de4cd69bc335ea54ef15842593466066bc1e7bafdfdb25fb1b179958fe374627
MD5 f1108de0fb8426b9175842a915330ae1
BLAKE2b-256 6d2f86e443b7a3573bdba095282090021c14207f4b474ba4e35efe7a69cdac2e

See more details on using hashes here.

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