Skip to main content

Apophis: A python client for Kraken

Project description

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.

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

apophis-1.0.3.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

apophis-1.0.3-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file apophis-1.0.3.tar.gz.

File metadata

  • Download URL: apophis-1.0.3.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1031-azure

File hashes

Hashes for apophis-1.0.3.tar.gz
Algorithm Hash digest
SHA256 e5cbed7a8fe3a631834f22d2356611ce9d6e20f3b867974197a609eef7142bbd
MD5 733a758004908eeaa4981ba925f56383
BLAKE2b-256 291aa4b97fa2687ee0f0511340d37b6e8204b0eeed0c5df5210650784ada5734

See more details on using hashes here.

Provenance

File details

Details for the file apophis-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: apophis-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/5.4.0-1031-azure

File hashes

Hashes for apophis-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3db58f10608a552c47eb0e85fb457629d0de9dbde48566eaf0b32e9b09a4adc1
MD5 4e479f8941661c2ae30a83329410a1c1
BLAKE2b-256 c1205b4b35bee11213ff839c5736a1695cae0a581f1d106e7b0d7c6f817725ce

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page