Skip to main content

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

Release files for luno 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for luno 0.3.6
File Size Uploaded
luno-0.3.6.tar.gz 9.8 kB Details

Release files / luno-0.3.6.tar.gz

Download URL luno-0.3.6.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b19e14ff1eba644f77350565bd1ed6462f5c537d018c95976d59ee60be141e50
BLAKE2b-256 checksum
How to use checksums
91b15364c98e2f124255f5911da93133adc201cc3d908f048b67c828c2152e6c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.3.6 This release

1 release file

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page