Skip to main content

Connector library for Pionex REST and WS api.

Project description

Pionex to Python

Description

Connector library for Pionex Restful and Websocket api. Closely resembles PionexAPI Docs for intuitive implementation. All function names are identical to the names in documentation.

Examples

pip install pionex_python

Restful

public

from pionex_python.restful.Common import Common

commonClient = Common()
market_data = commonClient.market_data()

print(market_data)

private

from pionex_python.restful.Orders import Orders

key, secret = "X...X", "X...X"

ordersClient = Orders(key, secret)

order = {
    "symbol"":"BTC_USDT",
    "side":"BUY",
    "type":"MARKET",
    "amount":"16"
}

response = ordersClient.new_order(order=order)
print(response)

Websocket

from pionex_python.websocket.PublicStream import PublicStream
from time import sleep

stream = PublicStream()

def onMessage(msg):
    print(msg)

stream.subscribe(callback=onMessage, topic="TRADE",symbol="BTC_USDT")
sleep(5)
stream.unsubscribe(topic="TRADE",symbol="BTC_USDT")

TODO:

  • implement testing

Motivation

  • learn about the python packaging and publishing systems
  • implement a python websocket client
  • increase experience with marketplace apis

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

pionex_python-1.0.6.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

pionex_python-1.0.6-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file pionex_python-1.0.6.tar.gz.

File metadata

  • Download URL: pionex_python-1.0.6.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.6.44-1-MANJARO

File hashes

Hashes for pionex_python-1.0.6.tar.gz
Algorithm Hash digest
SHA256 a342377a3bb10cc19974e92f72e65d657d7e77175e49f3b71874b9a81566b415
MD5 2943f0c11f78c8447d7a6475795b7b24
BLAKE2b-256 38b16c6a985679c59e0736d9028b3ff76aae331507faa99afe1146ff041bfa59

See more details on using hashes here.

File details

Details for the file pionex_python-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: pionex_python-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.6.44-1-MANJARO

File hashes

Hashes for pionex_python-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 eb5515d9e617c63db34d75c243560516df64711844c0ebf21147363c51d6c6c6
MD5 eb814bcdaee5794780402c84886996cb
BLAKE2b-256 a3c292ddd0f7538a4aee68dc8d239a6ab611d07b31afe247452c0c6ca539173a

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