Skip to main content

IDEX REST API python implementation

Project description

https://img.shields.io/pypi/v/python-idex.svg https://img.shields.io/pypi/l/python-idex.svg https://img.shields.io/travis/sammchardy/python-idex.svg https://img.shields.io/coveralls/sammchardy/python-idex.svg https://img.shields.io/pypi/wheel/python-idex.svg https://img.shields.io/pypi/pyversions/python-idex.svg

This is an unofficial Python wrapper for the IDEX exchanges REST API v1. I am in no way affiliated with IDEX, use at your own risk.

PyPi

https://pypi.python.org/pypi/python-idex

Source code

https://github.com/sammchardy/python-idex

Documentation

https://python-idex.readthedocs.io/en/latest/

Features

  • Implementation of all REST endpoints except for deposit.

  • Helper functions for your wallet address

  • Response exception handling

  • Websockets for Python 3.5+

Quick Start

Register an account with IDEX.

pip install python-idex

Synchronous Examples

from idex.client import Client
client = Client(address, private_key)

# get currencies
currencies = client.get_currencies()

# get market depth
depth = client.get_order_book('ETH_SAN')

# get your balances
balances = client.get_my_balances()

# get your open orders
orders = client.get_my_open_orders('ETH_SAN')

# create a limit order
order = client.create_order('SAN', 'ETH', '0.001', '10000')

Async Examples for Python 3.5+

from idex.asyncio import AsyncClient, IdexSocketManager

loop = None

async def main():
    global loop

    # Initialise the client
    client = await AsyncClient()

    # get currencies
    currencies = await client.get_currencies()

    # get market depth
    depth = await client.get_order_book('ETH_SAN')

    # get your balances
    balances = await client.get_my_balances()

    # get your open orders
    orders = await client.get_my_open_orders('ETH_SAN')

    # create a limit order
    order = await client.create_order('SAN', 'ETH', '0.001', '10000')

    # Initialise the socket manager
    ism = await IdexSocketManager.create(loop)

    # Coroutine to receive messages
    async def handle_evt(msg, topic):
        print("topic:{} type:{}".format(topic, msg['type']))

    # Subscribe to updates for the ETH_NPXS market
    await ism.subscribe('ETH_NPXS', handle_evt)

    # keep the script running so we can retrieve websocket events
    while True:
        await asyncio.sleep(20, loop=loop)


if __name__ == "__main__":
    # get a loop and switch from synchronous to async
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

For more check out the documentation.

TODO

  • Deposit endpoints

Other Exchanges

If you use Binance check out my python-binance library.

If you use Quoinex or Qryptos check out my python-quoine library.

If you use Allcoin check out my python-allucoin library.

If you use Exx check out my python-exx library.

If you use Kucoin check out my python-kucoin library.

If you use BigONE check out my python-bigone library.

https://analytics-pixel.appspot.com/UA-111417213-1/github/python-idex?pixel

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

python-idex-0.3.2.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

python_idex-0.3.2-py2.py3-none-any.whl (31.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file python-idex-0.3.2.tar.gz.

File metadata

  • Download URL: python-idex-0.3.2.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-idex-0.3.2.tar.gz
Algorithm Hash digest
SHA256 ef0a0b77b7a579bd6763e7d3227d57067b514caad54884485ee19a0f907b53d9
MD5 2bf46c8e0a6ffc6550f610a67a852c76
BLAKE2b-256 8cd0ab2fa785e4eca3c903f67baf97e6e08b9b76b13c26a4e6fdf23b15604f88

See more details on using hashes here.

File details

Details for the file python_idex-0.3.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for python_idex-0.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e72d71c2536b8db9166e22f87d75b8c760da52ebe5fb380fe7ad486d05ef4fb1
MD5 cab1b40844f0b593630da00b181f5674
BLAKE2b-256 0e4efc3fb422fd47e323adf4af54ee0938ecf1039a0114869f4058432ef9e355

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