Skip to main content

A Python interface to the Binance API

Project description

MATRAD: a Python trading interfance for Binance

Mantrad enables you to interact with the Binance API with Python

Installation

pip install matrad

API Functions available

The available API functions with their properties (especially endpoint and method) are listed properties.endpoint_mapping.

Call a function

from utils import execute_query
execute_query(function_name, params, data)

where function_name is a key in properties.endpoint_mapping, data is a Dict corresponding to the query string arguments and params a Dict corresponding to th request body.

Other utilities

Your current timestamp

You can get your current rimestam through utils.get_current_timestamp(). Is useful for timing your trades.

Signature

Some API function require a signature to proceed. This is handles seamlessly by utils.execute_query() through utils.get_hashmap_signature().

Coin pairs

All the coin pairs handled by the Binance API can be generated or updated locally through utils.update_pair_list() and returned by utils.get_all_pairs().

Compare API urls

The API url are listed in properties.urls. Their ping speed can be compred through utils.get_urls_speeds().

API keys

Your API key and secret must be stored in the user home directory in a file called .binance_api_secrets in this format:

{
    "key": "aBccc",
    "secret": "xYzzz"
}

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

matrad-0.0.7.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

matrad-0.0.7-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

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