Skip to main content

Kraken WebSockets Client in Python

Sample Kraken WebSockets client in Python. This client was created for demonstration purposes only. It is neither maintained nor supported.

Installation

pip install kraken-wsclient-py

Sample Usage

from kraken_wsclient_py import kraken_wsclient_py as client

def my_handler(message):
    # Here you can do stuff with the messages
    print(message)

my_client = client.WssClient()
my_client.start()

# Sample public-data subscription:

my_client.subscribe_public(
    subscription = {
        'name': 'trade'
    },
    pair = ['XBT/USD', 'XRP/USD'],
    callback = my_handler
)

# Sample private-data subscription:

my_client.subscribe_private(
    subscription = {
        'name': 'openOrders',
        'token': '__WS_TOKEN_HERE__'
    },
    callback = my_handler
)

# Sample order-entry call:

my_client.request(
    request = {
        'token': '__WS_TOKEN_HERE__',
        'event': 'addOrder',
        'type': 'buy',
        'ordertype': 'limit',
        'pair': 'XBT/USD',
        'price': '9000',
        'volume': '0.01',
        'userref': '666'
    },
    callback = my_handler
)

Compatibility

This code has been tested on Python 3.7.

Contributing

Pull requests are not monitored and likely will be ignored.

Metadata

Release files for kraken-wsclient-py 0.0.9

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

Source distribution (sdist)

Source distribution for kraken-wsclient-py 0.0.9
File Size Uploaded Provenance Actions
kraken-wsclient-py-0.0.9.tar.gz 4.0 kB Without provenance Details for kraken-wsclient-py-0.0.9.tar.gz

Release files / kraken-wsclient-py-0.0.9.tar.gz

Download URL kraken-wsclient-py-0.0.9.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cc80aab5e048616a2f592e423d82273c9f4cb2421b8b4fd25776bdd7996ecc77
BLAKE2b-256 checksum
How to use checksums
1b78b4a060af43031ba2f4a8bffcfc2dce827f5700be4a4466324b13bd341306
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

Security for kraken-wsclient-py 0.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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