Skip to main content

A lightweight library that works as a connector to several crypto exchanges APIs.

Project description

Crypto-connector

tests PyPI version Python version Code Style License: MIT

This is a lightweight library that works as a connector to Binance SPOT and HTX SPOT APIs.

Installation

pip install crypto-connector

Usage examples

Public endpoints

import crypto_connector as cc

exc = cc.Binance()
# exc = cc.HTX()

# get server time
print(exc.get_server_time())

# get last 200 klines of ETHUSDT with 1d timeframe
print(exc.klines("ETHUSDT", "1d"))

Private endpoints

API key/secret are required for private endpoints.

import crypto_connector as cc

# some binance API endpoints require both sub and master accounts API key/secret.
# Therefore user needs to create a subaccount and provide subaccount api key, 
# subaccount api secret, subaccount email, master account api key and 
# master account api secret to the Binance constructor
exc = cc.Binance(
    sub_api_key="",
    sub_api_secret="",
    sub_email="",
    master_api_key="",
    master_api_secret="",
)
# exc = cc.HTX(
#     api_key="",
#     api_secret="",
# )

# get api key info
print(exc.get_api_key_info())

# get balance
print(exc.get_balance())

# post a new order
order = exc.place_order("ETHUSDT", type="limit", side="buy", qty=0.015, price=1000)
print(order)

# get open orders
print(exc.get_open_orders())

Limitation

  • This library is not intended to be comprehensive, I use it mainly for my personal projects
  • Not all endpoints of the different APIs are supported
  • Websocket and Futures are not supported

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

crypto_connector-0.5.5.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

crypto_connector-0.5.5-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file crypto_connector-0.5.5.tar.gz.

File metadata

  • Download URL: crypto_connector-0.5.5.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for crypto_connector-0.5.5.tar.gz
Algorithm Hash digest
SHA256 1be59d64f63b3c72f89241ec6afd07684836d5d2d1cfcb09a0a52acb7d02df61
MD5 ee095b48500f4507abff3a953e7472c0
BLAKE2b-256 65dceec5583babad6f6b364f5ff694425a7b7cfe17cdc47e42ed7641d6537436

See more details on using hashes here.

Provenance

The following attestation bundles were made for crypto_connector-0.5.5.tar.gz:

Publisher: publish-to-pypi.yml on Izem0/crypto-connector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crypto_connector-0.5.5-py3-none-any.whl.

File metadata

File hashes

Hashes for crypto_connector-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bc6906fed9adefa92ecd58ec2fe6c72f34d3aab48f247e9ef11a9db44b7d4c41
MD5 f13a541c54dd6dc47e20a6f2ff7fb4af
BLAKE2b-256 864e06879c233d118afb0b55d16ac62b23261b00910f10cd831a064001eca2e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for crypto_connector-0.5.5-py3-none-any.whl:

Publisher: publish-to-pypi.yml on Izem0/crypto-connector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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