Skip to main content

Tests Code Quality Package version

Apophis: A python client for Kraken

Apophis is a Python client for Kraken's REST API. It provides a common interface for both Kraken and Kraken Future.

You want to say thanks?

Buy Me A Coffee: https://www.buymeacoffee.com/tupui

Quickstart

Public endpoints can be accessed without authentication.

from apophis import Kraken

with Kraken() as exchange:
    price = exchange.market_price(pair='XXRPZEUR')
    print(price)

# 0.51081

For placing orders, authentication is necessary:

from apophis import Kraken

key = ...
secret = ...
with Kraken(key, secret) as exchange:
    order = exchange.buy(pair='XXRPZEUR', volume=1000, price=0.5)

# Buying 1000 XXRPZEUR at 0.5 -> 500.0€

Alternatively, the low level API can be directly used to perform any kind of query.

from apophis import Apophis

with Apophis() as client:
    response = client.query('Ticker', {'pair': 'XXRPZEUR'})
    print(response['result'])

# {'XXRPZEUR': {'a': ['0.48683000', '33129', '33129.000'],
#               'b': ['0.48659000', '2915', '2915.000'],
#               'c': ['0.48719000', '41.55695712'],
#               'v': ['13015397.92184023', '46789050.96995769'],
#               'p': ['0.48149626', '0.47328592'],
#               't': [5110, 19079],
#               'l': ['0.45331000', '0.44697000'],
#               'h': ['0.49354000', '0.49681000'],
#               'o': '0.45730000'}}

Last but not least, there is a fully functional CLI:

❯ apophis query Ticker pair=XXRPZEUR
{'error': [], 'result': {'XXRPZEUR': {'a': ['0.45586000', '6356', '6356.000'], 'b': ['0.45561000', '63000', '63000.000'], 'c': ['0.45521000', '71.58800000'], 'v': ['27100060.07361936', '45765330.64314690'], 'p': ['0.43901689', '0.45396762'], 't': [11527, 19747], 'l': ['0.41500000', '0.41500000'], 'h': ['0.46588000', '0.49300000'], 'o': '0.46153000'}}}
❯ apophis price "XXRPZEUR"
XXRPZEUR: 0.45352

Installation

The latest stable release (and older versions) can be installed from PyPI:

pip install apophis

You may instead want to use the development version from Github. Poetry is needed and can be installed either from PyPI or:

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

Then once you cloned the repository, you can install it with:

poetry install

Contributing

Want to add a cool logo, more doc, tests or new features? Contributors are more than welcome! Feel free to open an issue or even better propose changes with a PR. Have a look at the contributing guide.

Metadata

Release files for apophis 1.0.5

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

Source distribution (sdist)

Source distribution for apophis 1.0.5
File Size Uploaded
apophis-1.0.5.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apophis 1.0.5
File Interpreter ABI Platform
apophis-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 23.3 kB

Release files / apophis-1.0.5.tar.gz

Download URL apophis-1.0.5.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
60922eb7dc192667662b8b8f3ae168764848c7c9c0f94ff32d7b3afa16e0a91a
BLAKE2b-256 checksum
How to use checksums
71ba7d7027906a028d427e27d800906568ce102b85ee9a1ce786396c49d103d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.7 Linux/5.4.0-1036-azure

Release files / apophis-1.0.5-py3-none-any.whl

Download URL apophis-1.0.5-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9764e629e9e2fb61191063059c1028280379c3124208ec4d92edbc40c141f932
BLAKE2b-256 checksum
How to use checksums
12bc61bb03be268cfcdd9d658b9b3967c57a7d5f6a0bfd565d7b8fb1fadc96d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.7 Linux/5.4.0-1036-azure

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

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