A python client for tickerdax.com with a built-in caching system.
Project description
TickerDax Client
A python package that interfaces with the tickerdax.com REST and websockets API. It handles common data operations like batch downloading data, streaming real-time data, and caching data locally to minimize network requests.
Installation
You can install this package with pip by running the command below.
pip install tickerdax
Docker Dependency
This client interfaces with a redis docker container. In order for the package to work, you must first install docker. Here are instructions per platform.
Mac
Linux
Windows
Note on windows you must first install WSL then you can install docker. Instructions
Python Examples
Here is a basic example of getting historical data using the python SDK.
Get historical data
from pprint import pprint
from datetime import datetime, timezone
from tickerdax.client import TickerDax
client = TickerDax()
pprint(client.get_route(
route='order-book/predictions/v1/50',
symbols=["BTC"],
start=datetime.now(tz=timezone.utc),
end=datetime.now(tz=timezone.utc)
))
Note that if this data doesn't exist in your cache, the data will be fetched from the REST API. All subsequent calls to the same data will only be from the cache and not the REST API. This is designed give you lighting fast responses and ultimately deliver data to you a cheaper cost.
Stream realtime data
This is how you can stream data to your cache. This will run indefinitely and fill your local cache as new data is available.
client.stream(
routes={
'order-book/predictions/v1/50': ['BTC', 'LTC'],
},
)
In another process you can call client.get_route()
as many times you like or whenever your
app re-evaluates. The data will be available once it is updated by the stream.
Documentation
Read the user documentation here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tickerdax-0.0.83.tar.gz
.
File metadata
- Download URL: tickerdax-0.0.83.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.18 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 823474b184a8a1d9efcd88aa7432ee000ab89db3021c39dd239acbcd4678ca0a |
|
MD5 | 60d5d3426c66be4f9f6000303bc52118 |
|
BLAKE2b-256 | 5f87e861953810926f730e6e7b155d57218f9f509a949807062ebad08f1c1cea |
File details
Details for the file tickerdax-0.0.83-py3-none-any.whl
.
File metadata
- Download URL: tickerdax-0.0.83-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.18 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17f5826c748cd856a3c4bdcc171187553eafe080483065cc3f4d4bbb587e3fcb |
|
MD5 | c47f99d951c0bb4b7476a1145a9fecce |
|
BLAKE2b-256 | 81f0c90d2db2215b4e535ee0b83347ad141c25bb6909ad3bad850ec0400dcc9e |