Giter VIP home page Giter VIP logo

pyindependentreserve's Introduction

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

pyindependentreserve's People

Contributors

dependabot[bot] avatar djpnewton avatar hippus avatar melchisalins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyindependentreserve's Issues

Some methods are missing from the pip package

Hello there,

thank you for maintaining this API! I'm playing around with it and I noticed that a couple of methods are missing from the pip package:

Public API

get_valid_order_types()

Private API

get_brokerage_fees()

Could you please update the package?

Thank you.

Missing tests

This Project is missing rest. Would be great if someone can contribute some.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.