Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

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](https://github.com/requests/requests) library and an async library built with [treq](https://github.com/twisted/treq) and [twisted](https://github.com/twisted/twisted).

## Sync client

```python
from luno.clients.sync import LunoSyncClient

api_key = ''
api_secret = ''

client = LunoSyncClient(api_key=api_key, secret=api_secret)
client.ticker('XBTZAR')
```


## Async client

```python
from typing import Dict
from twisted.internet import reactor
from luno.clients.async 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.

```bash
pip install luno
```

The async client is an optional extra and may be installed as follows.

```bash
pip install luno[async]
```

To install the version on this repository follow the steps below.

```bash
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.

```bash
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
- Write test suite for async client

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
luno-0.3.5-py3-none-any.whl (13.9 kB) Copy SHA256 hash SHA256 Wheel py3 Jun 3, 2018
luno-0.3.5.tar.gz (8.8 kB) Copy SHA256 hash SHA256 Source None Jun 3, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page