Skip to main content

Python client for Interacting with Independent Reserve API - The Bitcoin and Digital Currency Market

Project description

pyindependentreserve

Python3 client for Interacting with Independent Reserve API - The Bitcoin and Digital Currency Market

Install

$ pip install pyindependentreserve

Usage REST API

$ python
>>> import independentreserve as ir
>>> connection = ir.PublicMethods()
>>> connection.get_valid_limit_order_types()
[u'LimitBid', u'LimitOffer'] 

>>> api = PrivateMethods("your_api_key", "your_api_secret")
>>> api.get_open_orders()
{'TotalItems': ... etc

Usage Websocket

pyindependentreserve uses python3 asyncio module to implement a producer consumer pattern to consume messages from the websocket.

Official websocket documentation can be found here

from asyncio.queues import Queue
import websockets
import asyncio
import sys

from independentreserve import wss_subscribe


async def consumer(queue: asyncio.Queue):
    while True:
        item = await queue.get()
        if item is None:
            break
        print("consuming item: {}".format(item))


if __name__ == "__main__":
    try:
        loop = asyncio.get_event_loop()
        queue = asyncio.Queue(1000)
        producer_coroutine = wss_subscribe(queue=queue, channel_name=["ticker-xbt-aud"])
        consumer_coroutine = consumer(queue=queue)
        loop.run_until_complete(asyncio.gather(producer_coroutine, consumer_coroutine))
        loop.close()
    except Exception as error:
        print(error)
        sys.exit(1)

Support

If you like this project and would want to support it please consider taking a look at the issues section at:

Github Issues

or consider donating to

Bitcoin: 1B2kZETHm9tjhPKtCCEo6eWhwT5TfXWE6u Etherium: 0x00912fdef62ab7d9c1cbee712a58105eb1dbd42f BitCash: 1B2kZETHm9tjhPKtCCEo6eWhwT5TfXWE6u

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

pyindependentreserve-0.3.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

pyindependentreserve-0.3.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file pyindependentreserve-0.3.0.tar.gz.

File metadata

  • Download URL: pyindependentreserve-0.3.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.20.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.2

File hashes

Hashes for pyindependentreserve-0.3.0.tar.gz
Algorithm Hash digest
SHA256 04450ee296b792e2afe07acc1307a4f9654a64a1da024bf0f2c0b8ccd1f1d718
MD5 c3e7eae8a57aa4e9e307d934c580efb7
BLAKE2b-256 7dca5bb3d6e07e04b6519f6ebe35662c5ea7608c8347de975b6a952ed272dab4

See more details on using hashes here.

File details

Details for the file pyindependentreserve-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyindependentreserve-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.20.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.2

File hashes

Hashes for pyindependentreserve-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a11a85ebffe6baf89f30dc9abe3fc50c91aea6333b6850f46808c63a1668fac5
MD5 384bcf90649120bd75c9bd88951292a7
BLAKE2b-256 fadb95b3a36b6176e2bd6dde641173ae0352a2da721c3426d975d2c6b109c44a

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