Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyindependentreserve

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyindependentreserve

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

  • 0.4.1
  • PyPI
  • Socket score

Maintainers
1

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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc