Luno Crypto Currency Exchanage Python API
Project description
Luno Python Library
Sync and Async Python 3 clients for the Luno API
Quickstart
This library includes 2 types of clients, a sync client built using the requests library and an async library built with treq and twisted.
Sync client
from luno.clients.sync import LunoSyncClient
api_key = ''
api_secret = ''
client = LunoSyncClient(api_key=api_key, secret=api_secret)
client.ticker('XBTZAR')
Async client
from typing import Dict
from twisted.internet import reactor
from luno.clients.asynchronous import LunoAsyncClient
api_key = ''
api_secret = ''
client = LunoAsyncClient(api_key=api_key, secret=api_secret)
d = client.ticker('XBTZAR') # returns a twisted deferred
def print_data(data: Dict) -> None:
"""prints the json response from an API call"""
print(data)
d.addCallback(print_data)
reactor.run()
Installation
The library can be installed from PyPi as follows.
pip install luno
The async client is an optional extra and may be installed as follows.
pip install luno[async]
To install the version on this repository follow the steps below.
git clone https://github.com/BradleyKirton/luno
cd luno
python -m venv env # virtualenv env
source env/bin/activate
pip install . #pip install .[async] for the async client
Developement
Clone the repo and install the package with it's development requirements.
git clone https://github.com/BradleyKirton/luno
cd luno
python -m venv env # virtualenv env
source env/bin/activate
pip install -e .[dev]
pytest
TODO
Note this library is still in beta.
- Write documentation
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
luno-0.3.6.tar.gz
(9.8 kB
view details)
File details
Details for the file luno-0.3.6.tar.gz
.
File metadata
- Download URL: luno-0.3.6.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b19e14ff1eba644f77350565bd1ed6462f5c537d018c95976d59ee60be141e50 |
|
MD5 | 49dbab35e5e76196ee3b09f6d3596336 |
|
BLAKE2b-256 | 91b15364c98e2f124255f5911da93133adc201cc3d908f048b67c828c2152e6c |