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:
or consider donating to
Bitcoin: 1B2kZETHm9tjhPKtCCEo6eWhwT5TfXWE6u Etherium: 0x00912fdef62ab7d9c1cbee712a58105eb1dbd42f BitCash: 1B2kZETHm9tjhPKtCCEo6eWhwT5TfXWE6u
Release files for pyindependentreserve 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyindependentreserve-0.4.1.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyindependentreserve-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.3 kB
Release files / pyindependentreserve-0.4.1.tar.gz
| Download URL | pyindependentreserve-0.4.1.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b3ee72a6a2da9e6d530d27ff36970bc1a432980bf979df30ad5750608ee20cc
|
|
BLAKE2b-256 checksum How to use checksums |
474d798d67d23d8ae2a58688d59af2e721f13fbabc221ddc994928448e70067d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / pyindependentreserve-0.4.1-py3-none-any.whl
| Download URL | pyindependentreserve-0.4.1-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3cfef1372d6fe7d738b61764a47c339a94600fcb47bb0d405a0ccafbd0a2764b
|
|
BLAKE2b-256 checksum How to use checksums |
fe9ca146ebe2084e07389bf9d6052656eb0459feea700ce8bb95624ec734f91c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|