Name | python-kraken-sdk JSON |
Version |
3.1.1
JSON |
| download |
home_page | None |
Summary | Command-line tool and collection of REST and websocket clients to interact with the Kraken cryptocurrency exchange. |
upload_time | 2024-09-14 08:08:01 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2023 Benjamin Thomas Schwertfeger Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
keywords |
crypto
trading
kraken
exchange
api
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<h1 align="center">Futures, Spot and NFT - REST and Websocket API Python SDK for the Kraken Cryptocurrency Exchange 🐙</h1>
<div align="center">
[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/btschwertfeger/python-kraken-sdk)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Generic badge](https://img.shields.io/badge/python-3.11+-blue.svg)](https://shields.io/)
[![Downloads](https://static.pepy.tech/personalized-badge/python-kraken-sdk?period=total&units=abbreviation&left_color=grey&right_color=orange&left_text=downloads)](https://pepy.tech/project/python-kraken-sdk)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Typing](https://img.shields.io/badge/typing-mypy-informational)](https://mypy-lang.org/)
[![CI/CD](https://github.com/btschwertfeger/python-kraken-sdk/actions/workflows/cicd.yaml/badge.svg?branch=master)](https://github.com/btschwertfeger/python-kraken-sdk/actions/workflows/cicd.yaml)
[![codecov](https://codecov.io/gh/btschwertfeger/python-kraken-sdk/branch/master/badge.svg)](https://app.codecov.io/gh/btschwertfeger/python-kraken-sdk)
[![OpenSSF ScoreCard](https://img.shields.io/ossf-scorecard/github.com/btschwertfeger/python-kraken-sdk?label=openssf%20scorecard&style=flat)](https://securityscorecards.dev/viewer/?uri=github.com/btschwertfeger/python-kraken-sdk)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8673/badge)](https://www.bestpractices.dev/projects/8673)
[![release](https://shields.io/github/release-date/btschwertfeger/python-kraken-sdk)](https://github.com/btschwertfeger/python-kraken-sdk/releases)
[![release](https://img.shields.io/pypi/v/python-kraken-sdk)](https://pypi.org/project/python-kraken-sdk/)
[![DOI](https://zenodo.org/badge/510751854.svg)](https://zenodo.org/badge/latestdoi/510751854)
[![Documentation Status Stable](https://readthedocs.org/projects/python-kraken-sdk/badge/?version=stable)](https://python-kraken-sdk.readthedocs.io/en/stable)
</div>
> ⚠️ This is an unofficial collection of REST and websocket clients for Spot and
> Futures trading on the Kraken cryptocurrency exchange using Python. Payward
> Ltd. and Kraken are in no way associated with the authors of this package and
> documentation.
>
> Please note that this project is independent and not endorsed by Kraken or
> Payward Ltd. Users should be aware that they are using third-party software,
> and the authors of this project are not responsible for any issues, losses, or
> risks associated with its usage.
## 📌 Disclaimer
There is no guarantee that this software will work flawlessly at this or later
times. Of course, no responsibility is taken for possible profits or losses.
This software probably has some errors in it, so use it at your own risk. Also
no one should be motivated or tempted to invest assets in speculative forms of
investment. By using this software you release the author(s) from any liability
regarding the use of this software.
---
## Features
General:
- command-line interface
- access both public and private, REST and websocket endpoints
- responsive error handling and custom exceptions
- extensive example scripts (see `/examples` and `/tests`)
- tested using the [pytest](https://docs.pytest.org/en/7.3.x/) framework
- releases are permanently archived at [Zenodo](https://zenodo.org/badge/latestdoi/510751854)
Available Clients:
- Spot REST Clients (sync and async; including access to NFT trading)
- Spot Websocket Client (using Websocket API v2)
- Spot Orderbook Client (using Websocket API v2)
- Futures REST Clients (sync and async)
- Futures Websocket Client
Documentation:
- [https://python-kraken-sdk.readthedocs.io/en/stable](https://python-kraken-sdk.readthedocs.io/en/stable)
- [https://python-kraken-sdk.readthedocs.io/en/latest](https://python-kraken-sdk.readthedocs.io/en/latest)
---
## ❗️ Attention
**ONLY** tagged releases are available at PyPI. So the content of the master may
not match with the content of the latest release. - Please have a look at the
release specific READMEs and changelogs.
It is also recommended to _pin the used version_ to avoid unexpected behavior on
new releases.
---
## Table of Contents
- [ Installation and setup ](#installation)
- [ Command-line interface ](#cliusage)
- [ Spot Clients ](#spotusage)
- [ Futures Clients ](#futuresusage)
- [ Troubleshooting ](#trouble)
- [ Contributions ](#contribution)
- [ Notes ](#notes)
- [ Considerations ](#considerations)
- [ References ](#references)
<a name="installation"></a>
# 🛠 Installation and setup
### 1. Install the package into the desired environment
```bash
python3 -m pip install python-kraken-sdk
```
### 2. Register at [Kraken](https://www.kraken.com) and generate API keys
- Spot Trading: https://www.kraken.com/u/security/api
- Futures Trading: https://futures.kraken.com/trade/settings/api (see _[help](https://docs.futures.kraken.com/#introduction-generate-api-keys)_)
- Futures Sandbox: https://demo-futures.kraken.com/settings/api
### 3. Start using the provided example scripts
### 4. Error handling
If any unexpected behavior occurs, please check <b style="color: yellow">your
API permissions</b>, <b style="color: yellow">rate limits</b>, update the
python-kraken-sdk, see the [Troubleshooting](#trouble) section, and if the error
persists please open an issue.
<a name="cliusage"></a>
# 📍 Command-line interface
The python-kraken-sdk provides a command-line interface to access the Kraken API
using basic instructions while performing authentication tasks in the
background. The Spot, NFT and Futures API are accessible and follow the pattern
`kraken {spot,futures} [OPTIONS] URL`. See examples below.
```bash
# get server time
kraken spot https://api.kraken.com/0/public/Time
{'unixtime': 1716707589, 'rfc1123': 'Sun, 26 May 24 07:13:09 +0000'}
# get user's balances
kraken spot --api-key=<api-key> --secret-key=<secret-key> -X POST https://api.kraken.com/0/private/Balance
{'ATOM': '17.28229999', 'BCH': '0.0000077100', 'ZUSD': '1000.0000'}
# get user's trade balances
kraken spot --api-key=<api-key> --secret-key=<secret-key> -X POST https://api.kraken.com/0/private/TradeBalance --data '{"asset": "DOT"}'
{'eb': '2.8987347115', 'tb': '1.1694303513', 'm': '0.0000000000', 'uv': '0', 'n': '0.0000000000', 'c': '0.0000000000', 'v': '0.0000000000', 'e': '1.1694303513', 'mf': '1.1694303513'}
# get 1D candles for a futures instrument
kraken futures https://futures.kraken.com/api/charts/v1/spot/PI_XBTUSD/1d
{'candles': [{'time': 1625616000000, 'open': '34557.84000000000', 'high': '34803.20000000000', 'low': '33816.32000000000', 'close': '33880.22000000000', 'volume': '0' ...
# get user's open futures positions
kraken futures --api-key=<api-key> --secret-key=<secret-key> https://futures.kraken.com/derivatives/api/v3/openpositions
{'result': 'success', 'openPositions': [], 'serverTime': '2024-05-26T07:15:38.91Z'}
```
... All endpoints of the Kraken Spot and Futurs API can be accessed like that.
<a name="spotusage"></a>
# 📍 Spot Clients
The python-kraken-sdk provides lots of functions to easily access most of the
REST and websocket endpoints of the Kraken Cryptocurrency Exchange API. Since
these endpoints and their parameters may change, all implemented endpoints are
tested on a regular basis.
The Kraken Spot API can be accessed by executing requests to the endpoints
directly using the `request` method provided by any client. This is demonstrated
below.
See https://docs.kraken.com/api/docs/guides/global-intro for information about
the available endpoints and their usage.
### `SpotClient`
The Spot client provides access to all un-and authenticated endpoints of
Kraken's Spot and NFT API.
```python
from kraken.spot import SpotClient
client = SpotClient(key="<your-api-key>", secret="<your-secret-key>")
print(client.request("POST", "/0/private/Balance"))
```
### `SpotAsyncClient`
The async Spot client allows for asynchronous access to Kraken's Spot and NFT API endpoints. Below are two examples demonstrating its usage.
Using SpotAsyncClient without a context manager; In this example, the client is manually closed after the request is made.
```python
import asyncio
from kraken.spot import SpotAsyncClient
async def main():
client = SpotAsyncClient(key="<your-api-key>", secret="<your-secret-key>")
try:
response = await client.request("POST", "/0/private/Balance")
print(response)
finally:
await client.async_close()
asyncio.run(main())
```
Using SpotAsyncClient as a context manager; This example demonstrates the use of the context manager, which ensures the client is automatically closed after the request is completed.
```python
import asyncio
from kraken.spot import SpotAsyncClient
async def main():
async with SpotAsyncClient(key="<your-api-key>", secret="<your-secret-key>") as client:
response = await client.request("POST", "/0/private/Balance")
print(response)
asyncio.run(main())
```
<a name="spotws"></a>
### `SpotWSClient` (Websocket API)
Kraken offers two versions of their websocket API (V1 and V2). Since V2 is
offers more possibilities, is way faster and easier to use, only the never
version is supported by this SDK.
The official documentation for can be found at:
- https://docs.kraken.com/api/docs/guides/global-intro
- https://docs.kraken.com/websockets-v2
Note that authenticated Spot websocket clients can also un-/subscribe from/to
public feeds.
The example below can be found in an extended way in
`examples/spot_ws_examples.py`.
```python
import asyncio
from kraken.spot import SpotWSClient
class Client(SpotWSClient):
"""Can be used to create a custom trading strategy"""
async def on_message(self, message):
"""Receives the websocket messages"""
if message.get("method") == "pong" \
or message.get("channel") == "heartbeat":
return
print(message)
# Here we can access lots of methods, for example to create an order:
# if self.is_auth: # only if the client is authenticated …
# await self.send_message(
# message={
# "method": "add_order",
# "params": {
# "limit_price": 1234.56,
# "order_type": "limit",
# "order_userref": 123456789,
# "order_qty": 1.0,
# "side": "buy",
# "symbol": "BTC/USD",
# "validate": True,
# },
# }
# )
# … it is also possible to call regular REST endpoints
# but using the websocket messages is more efficient.
# You can also un-/subscribe here using self.subscribe/self.unsubscribe.
async def main():
# Public/unauthenticated websocket client
client = Client() # only use this one if you don't need private feeds
await client.start()
await client.subscribe(
params={"channel": "ticker", "symbol": ["BTC/USD", "DOT/USD"]}
)
await client.subscribe(
params={"channel": "book", "depth": 25, "symbol": ["BTC/USD"]}
)
# wait because unsubscribing is faster than unsubscribing … (just for that example)
await asyncio.sleep(3)
# print(client.active_public_subscriptions) # to list active subscriptions
await client.unsubscribe(
params={"channel": "ticker", "symbol": ["BTC/USD", "DOT/USD"]}
)
# …
# AS default, the authenticated client starts two websocket connections,
# one for authenticated and one for public messages. If there is no need
# for a public connection, it can be disabled using the ``no_public``
# parameter.
client_auth = Client(key="api-key", secret="secret-key", no_public=True)
await client_auth.start()
await client_auth.subscribe(params={"channel": "balances"})
while not client.exception_occur and not client_auth.exception_occur:
await asyncio.sleep(6)
if __name__ == "__main__":
try:
asyncio.run(main())
except KeyboardInterrupt:
pass
# The websocket client will send {'event': 'asyncio.CancelledError'}
# via on_message so you can handle the behavior/next actions
# individually within your strategy.
```
<a name="futuresusage"></a>
# Futures Clients
The Kraken Spot API can be accessed by executing requests to the endpoints
directly using the `request` method provided by any client. This is demonstrated
below.
See https://docs.kraken.com/api/docs/guides/global-intro for information about
the available endpoints and their usage.
### `FuturesClient`
The simple Futures client provides access to all un-and authenticated endpoints.
```python
from kraken.futures import FuturesClient
client = FuturesClient(key="<your-api-key>", secret="<your-secret-key>")
print(client.request("GET", "/derivatives/api/v3/accounts"))
```
### `FuturesAsyncClient`
The async Futures client allows for asynchronous access to Kraken's Futures
endpoints. Below are two examples demonstrating its usage.
Using FuturesAsyncClient without a context manager; In this example, the client
is manually closed after the request is made.
```python
import asyncio
from kraken.futures import FuturesAsyncClient
async def main():
client = FuturesAsyncClient(key="<your-api-key>", secret="<your-secret-key>")
try:
response = await client.request("GET", "/derivatives/api/v3/accounts")
print(response)
finally:
await client.async_close()
asyncio.run(main())
```
Using FuturesAsyncClient as context manager; This example demonstrates the use
of the context manager, which ensures the client is automatically closed after
the request is completed.
```python
import asyncio
from kraken.futures import FuturesAsyncClient
async def main():
async with FuturesAsyncClient(key="<your-api-key>", secret="<your-secret-key>") as client:
response = await client.request("GET", "/derivatives/api/v3/accounts")
print(response)
asyncio.run(main())
```
<a name="futuresws"></a>
### `FuturesWSClient` (Websocket API)
Not only REST, also the websocket API for Kraken Futures is available. Examples
are shown below and demonstrated in `examples/futures_ws_examples.py`.
- https://docs.futures.kraken.com/#websocket-api
Note: Authenticated Futures websocket clients can also un-/subscribe from/to
public feeds.
```python
import asyncio
from kraken.futures import FuturesWSClient
class Client(FuturesWSClient):
async def on_message(self, event):
print(event)
async def main():
# Public/unauthenticated websocket connection
client = Client()
await client.start()
products = ["PI_XBTUSD", "PF_ETHUSD"]
# subscribe to a public websocket feed
await client.subscribe(feed="ticker", products=products)
# await client.subscribe(feed="book", products=products)
# …
# unsubscribe from a public websocket feed
# await client.unsubscribe(feed="ticker", products=products)
# Private/authenticated websocket connection (+public)
client_auth = Client(key="key-key", secret="secret-key")
await client_auth.start()
# print(client_auth.get_available_private_subscription_feeds())
# subscribe to a private/authenticated websocket feed
await client_auth.subscribe(feed="fills")
await client_auth.subscribe(feed="open_positions")
await client_auth.subscribe(feed="open_orders")
# …
# unsubscribe from a private/authenticated websocket feed
await client_auth.unsubscribe(feed="fills")
while not client.exception_occur and not client_auth.exception_occur:
await asyncio.sleep(6)
if __name__ == "__main__":
try:
asyncio.run(main())
except KeyboardInterrupt:
# do some exception handling …
pass
```
---
<a name="contribution"></a>
# 🆕 Contributions
… are welcome - but:
- First check if there is an existing issue or PR that addresses your
problem/solution. If not - create one first - before creating a PR.
- Typo fixes, project configuration, CI, documentation or style/formatting PRs
will be rejected. Please create an issue for that.
- PRs must provide a reasonable, easy to understand and maintain solution for an
existing problem. You may want to propose a solution when creating the issue
to discuss the approach before creating a PR.
- Please have a look at [CONTRIBUTION.md](./CONTRIBUTING.md).
---
<a name="trouble"></a>
# 🚨 Troubleshooting
- Check if you downloaded and installed the **latest version** of the
python-kraken-sdk.
- Check the **permissions of your API keys** and the required permissions on the
respective endpoints.
- If you get some Cloudflare or **rate limit errors**, please check your Kraken
Tier level and maybe apply for a higher rank if required.
- **Use different API keys for different algorithms**, because the nonce
calculation is based on timestamps and a sent nonce must always be the highest
nonce ever sent of that API key. Having multiple algorithms using the same
keys will result in invalid nonce errors.
---
<a name="notes"></a>
# 📝 Notes
The versioning scheme follows the pattern `v<Major>.<Minor>.<Patch>`. Here's
what each part signifies:
- **Major**: This denotes significant changes that may introduce new features or
modify existing ones. It's possible for these changes to be breaking, meaning
backward compatibility is not guaranteed. To avoid unexpected behavior, it's
advisable to specify at least the major version when pinning dependencies.
- **Minor**: This level indicates additions of new features or extensions to
existing ones. Typically, these changes do not break existing implementations.
- **Patch**: Here, you'll find bug fixes, documentation updates, and changes
related to continuous integration (CI). These updates are intended to enhance
stability and reliability without altering existing functionality.
Coding standards are not always followed to make arguments and function names as
similar as possible to those of the Kraken API documentations.
<a name="considerations"></a>
# Considerations
The tool aims to be fast, easy to use and maintain. In the past, lots of clients
were implemented, that provided functions for almost all available endpoints of
the Kraken API. The effort to maintain this collection grew to a level where it
was not possible to check various changelogs to apply new updates on a regular
basis. Instead, it was decided to concentrate on the `request` functions of
the `SpotClient`, `SpotAsyncClient`, `FuturesClient` and the
`FuturesAsyncClient` (as well as their websocket client implementations). All
those clients named "User", "Trade", "Market", "Funding" and so on will no
longer be extended, but maintained to a certain degree.
<a name="references"></a>
# 🔭 References
- https://python-kraken-sdk.readthedocs.io/en/stable
- https://docs.kraken.com/api/
- https://docs.kraken.com/api/docs/guides/global-intro
- https://docs.kraken.com/rest
- https://docs.kraken.com/websockets-v2
- https://docs.futures.kraken.com
- https://support.kraken.com/hc/en-us/sections/360012894412-Futures-API
---
Raw data
{
"_id": null,
"home_page": null,
"name": "python-kraken-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Benjamin Thomas Schwertfeger <contact@b-schwertfeger.de>",
"keywords": "crypto, trading, kraken, exchange, api",
"author": null,
"author_email": "Benjamin Thomas Schwertfeger <contact@b-schwertfeger.de>",
"download_url": "https://files.pythonhosted.org/packages/11/81/9a75138d22d65694467a01525905d9f4116eb5eccfb2bbe6225d4193e58f/python_kraken_sdk-3.1.1.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">Futures, Spot and NFT - REST and Websocket API Python SDK for the Kraken Cryptocurrency Exchange \ud83d\udc19</h1>\n\n<div align=\"center\">\n\n[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/btschwertfeger/python-kraken-sdk)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Generic badge](https://img.shields.io/badge/python-3.11+-blue.svg)](https://shields.io/)\n[![Downloads](https://static.pepy.tech/personalized-badge/python-kraken-sdk?period=total&units=abbreviation&left_color=grey&right_color=orange&left_text=downloads)](https://pepy.tech/project/python-kraken-sdk)\n\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Typing](https://img.shields.io/badge/typing-mypy-informational)](https://mypy-lang.org/)\n[![CI/CD](https://github.com/btschwertfeger/python-kraken-sdk/actions/workflows/cicd.yaml/badge.svg?branch=master)](https://github.com/btschwertfeger/python-kraken-sdk/actions/workflows/cicd.yaml)\n[![codecov](https://codecov.io/gh/btschwertfeger/python-kraken-sdk/branch/master/badge.svg)](https://app.codecov.io/gh/btschwertfeger/python-kraken-sdk)\n\n[![OpenSSF ScoreCard](https://img.shields.io/ossf-scorecard/github.com/btschwertfeger/python-kraken-sdk?label=openssf%20scorecard&style=flat)](https://securityscorecards.dev/viewer/?uri=github.com/btschwertfeger/python-kraken-sdk)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8673/badge)](https://www.bestpractices.dev/projects/8673)\n\n[![release](https://shields.io/github/release-date/btschwertfeger/python-kraken-sdk)](https://github.com/btschwertfeger/python-kraken-sdk/releases)\n[![release](https://img.shields.io/pypi/v/python-kraken-sdk)](https://pypi.org/project/python-kraken-sdk/)\n[![DOI](https://zenodo.org/badge/510751854.svg)](https://zenodo.org/badge/latestdoi/510751854)\n[![Documentation Status Stable](https://readthedocs.org/projects/python-kraken-sdk/badge/?version=stable)](https://python-kraken-sdk.readthedocs.io/en/stable)\n\n</div>\n\n> \u26a0\ufe0f This is an unofficial collection of REST and websocket clients for Spot and\n> Futures trading on the Kraken cryptocurrency exchange using Python. Payward\n> Ltd. and Kraken are in no way associated with the authors of this package and\n> documentation.\n>\n> Please note that this project is independent and not endorsed by Kraken or\n> Payward Ltd. Users should be aware that they are using third-party software,\n> and the authors of this project are not responsible for any issues, losses, or\n> risks associated with its usage.\n\n## \ud83d\udccc Disclaimer\n\nThere is no guarantee that this software will work flawlessly at this or later\ntimes. Of course, no responsibility is taken for possible profits or losses.\nThis software probably has some errors in it, so use it at your own risk. Also\nno one should be motivated or tempted to invest assets in speculative forms of\ninvestment. By using this software you release the author(s) from any liability\nregarding the use of this software.\n\n---\n\n## Features\n\nGeneral:\n\n- command-line interface\n- access both public and private, REST and websocket endpoints\n- responsive error handling and custom exceptions\n- extensive example scripts (see `/examples` and `/tests`)\n- tested using the [pytest](https://docs.pytest.org/en/7.3.x/) framework\n- releases are permanently archived at [Zenodo](https://zenodo.org/badge/latestdoi/510751854)\n\nAvailable Clients:\n\n- Spot REST Clients (sync and async; including access to NFT trading)\n- Spot Websocket Client (using Websocket API v2)\n- Spot Orderbook Client (using Websocket API v2)\n- Futures REST Clients (sync and async)\n- Futures Websocket Client\n\nDocumentation:\n\n- [https://python-kraken-sdk.readthedocs.io/en/stable](https://python-kraken-sdk.readthedocs.io/en/stable)\n- [https://python-kraken-sdk.readthedocs.io/en/latest](https://python-kraken-sdk.readthedocs.io/en/latest)\n\n---\n\n## \u2757\ufe0f Attention\n\n**ONLY** tagged releases are available at PyPI. So the content of the master may\nnot match with the content of the latest release. - Please have a look at the\nrelease specific READMEs and changelogs.\n\nIt is also recommended to _pin the used version_ to avoid unexpected behavior on\nnew releases.\n\n---\n\n## Table of Contents\n\n- [ Installation and setup ](#installation)\n- [ Command-line interface ](#cliusage)\n- [ Spot Clients ](#spotusage)\n- [ Futures Clients ](#futuresusage)\n- [ Troubleshooting ](#trouble)\n- [ Contributions ](#contribution)\n- [ Notes ](#notes)\n- [ Considerations ](#considerations)\n- [ References ](#references)\n\n<a name=\"installation\"></a>\n\n# \ud83d\udee0 Installation and setup\n\n### 1. Install the package into the desired environment\n\n```bash\npython3 -m pip install python-kraken-sdk\n```\n\n### 2. Register at [Kraken](https://www.kraken.com) and generate API keys\n\n- Spot Trading: https://www.kraken.com/u/security/api\n- Futures Trading: https://futures.kraken.com/trade/settings/api (see _[help](https://docs.futures.kraken.com/#introduction-generate-api-keys)_)\n- Futures Sandbox: https://demo-futures.kraken.com/settings/api\n\n### 3. Start using the provided example scripts\n\n### 4. Error handling\n\nIf any unexpected behavior occurs, please check <b style=\"color: yellow\">your\nAPI permissions</b>, <b style=\"color: yellow\">rate limits</b>, update the\npython-kraken-sdk, see the [Troubleshooting](#trouble) section, and if the error\npersists please open an issue.\n\n<a name=\"cliusage\"></a>\n\n# \ud83d\udccd Command-line interface\n\nThe python-kraken-sdk provides a command-line interface to access the Kraken API\nusing basic instructions while performing authentication tasks in the\nbackground. The Spot, NFT and Futures API are accessible and follow the pattern\n`kraken {spot,futures} [OPTIONS] URL`. See examples below.\n\n```bash\n# get server time\nkraken spot https://api.kraken.com/0/public/Time\n{'unixtime': 1716707589, 'rfc1123': 'Sun, 26 May 24 07:13:09 +0000'}\n\n# get user's balances\nkraken spot --api-key=<api-key> --secret-key=<secret-key> -X POST https://api.kraken.com/0/private/Balance\n{'ATOM': '17.28229999', 'BCH': '0.0000077100', 'ZUSD': '1000.0000'}\n\n# get user's trade balances\nkraken spot --api-key=<api-key> --secret-key=<secret-key> -X POST https://api.kraken.com/0/private/TradeBalance --data '{\"asset\": \"DOT\"}'\n{'eb': '2.8987347115', 'tb': '1.1694303513', 'm': '0.0000000000', 'uv': '0', 'n': '0.0000000000', 'c': '0.0000000000', 'v': '0.0000000000', 'e': '1.1694303513', 'mf': '1.1694303513'}\n\n# get 1D candles for a futures instrument\nkraken futures https://futures.kraken.com/api/charts/v1/spot/PI_XBTUSD/1d\n{'candles': [{'time': 1625616000000, 'open': '34557.84000000000', 'high': '34803.20000000000', 'low': '33816.32000000000', 'close': '33880.22000000000', 'volume': '0' ...\n\n# get user's open futures positions\nkraken futures --api-key=<api-key> --secret-key=<secret-key> https://futures.kraken.com/derivatives/api/v3/openpositions\n{'result': 'success', 'openPositions': [], 'serverTime': '2024-05-26T07:15:38.91Z'}\n```\n\n... All endpoints of the Kraken Spot and Futurs API can be accessed like that.\n\n<a name=\"spotusage\"></a>\n\n# \ud83d\udccd Spot Clients\n\nThe python-kraken-sdk provides lots of functions to easily access most of the\nREST and websocket endpoints of the Kraken Cryptocurrency Exchange API. Since\nthese endpoints and their parameters may change, all implemented endpoints are\ntested on a regular basis.\n\nThe Kraken Spot API can be accessed by executing requests to the endpoints\ndirectly using the `request` method provided by any client. This is demonstrated\nbelow.\n\nSee https://docs.kraken.com/api/docs/guides/global-intro for information about\nthe available endpoints and their usage.\n\n### `SpotClient`\n\nThe Spot client provides access to all un-and authenticated endpoints of\nKraken's Spot and NFT API.\n\n```python\nfrom kraken.spot import SpotClient\n\nclient = SpotClient(key=\"<your-api-key>\", secret=\"<your-secret-key>\")\nprint(client.request(\"POST\", \"/0/private/Balance\"))\n```\n\n### `SpotAsyncClient`\n\nThe async Spot client allows for asynchronous access to Kraken's Spot and NFT API endpoints. Below are two examples demonstrating its usage.\n\nUsing SpotAsyncClient without a context manager; In this example, the client is manually closed after the request is made.\n\n```python\nimport asyncio\nfrom kraken.spot import SpotAsyncClient\n\nasync def main():\n client = SpotAsyncClient(key=\"<your-api-key>\", secret=\"<your-secret-key>\")\n try:\n response = await client.request(\"POST\", \"/0/private/Balance\")\n print(response)\n finally:\n await client.async_close()\n\nasyncio.run(main())\n```\n\nUsing SpotAsyncClient as a context manager; This example demonstrates the use of the context manager, which ensures the client is automatically closed after the request is completed.\n\n```python\nimport asyncio\nfrom kraken.spot import SpotAsyncClient\n\nasync def main():\n async with SpotAsyncClient(key=\"<your-api-key>\", secret=\"<your-secret-key>\") as client:\n response = await client.request(\"POST\", \"/0/private/Balance\")\n print(response)\n\nasyncio.run(main())\n```\n\n<a name=\"spotws\"></a>\n\n### `SpotWSClient` (Websocket API)\n\nKraken offers two versions of their websocket API (V1 and V2). Since V2 is\noffers more possibilities, is way faster and easier to use, only the never\nversion is supported by this SDK.\n\nThe official documentation for can be found at:\n\n- https://docs.kraken.com/api/docs/guides/global-intro\n- https://docs.kraken.com/websockets-v2\n\nNote that authenticated Spot websocket clients can also un-/subscribe from/to\npublic feeds.\n\nThe example below can be found in an extended way in\n`examples/spot_ws_examples.py`.\n\n```python\nimport asyncio\nfrom kraken.spot import SpotWSClient\n\nclass Client(SpotWSClient):\n \"\"\"Can be used to create a custom trading strategy\"\"\"\n\n async def on_message(self, message):\n \"\"\"Receives the websocket messages\"\"\"\n if message.get(\"method\") == \"pong\" \\\n or message.get(\"channel\") == \"heartbeat\":\n return\n\n print(message)\n # Here we can access lots of methods, for example to create an order:\n # if self.is_auth: # only if the client is authenticated \u2026\n # await self.send_message(\n # message={\n # \"method\": \"add_order\",\n # \"params\": {\n # \"limit_price\": 1234.56,\n # \"order_type\": \"limit\",\n # \"order_userref\": 123456789,\n # \"order_qty\": 1.0,\n # \"side\": \"buy\",\n # \"symbol\": \"BTC/USD\",\n # \"validate\": True,\n # },\n # }\n # )\n # \u2026 it is also possible to call regular REST endpoints\n # but using the websocket messages is more efficient.\n # You can also un-/subscribe here using self.subscribe/self.unsubscribe.\n\nasync def main():\n\n # Public/unauthenticated websocket client\n client = Client() # only use this one if you don't need private feeds\n await client.start()\n await client.subscribe(\n params={\"channel\": \"ticker\", \"symbol\": [\"BTC/USD\", \"DOT/USD\"]}\n )\n await client.subscribe(\n params={\"channel\": \"book\", \"depth\": 25, \"symbol\": [\"BTC/USD\"]}\n )\n # wait because unsubscribing is faster than unsubscribing \u2026 (just for that example)\n await asyncio.sleep(3)\n # print(client.active_public_subscriptions) # to list active subscriptions\n await client.unsubscribe(\n params={\"channel\": \"ticker\", \"symbol\": [\"BTC/USD\", \"DOT/USD\"]}\n )\n # \u2026\n\n # AS default, the authenticated client starts two websocket connections,\n # one for authenticated and one for public messages. If there is no need\n # for a public connection, it can be disabled using the ``no_public``\n # parameter.\n client_auth = Client(key=\"api-key\", secret=\"secret-key\", no_public=True)\n await client_auth.start()\n await client_auth.subscribe(params={\"channel\": \"balances\"})\n\n while not client.exception_occur and not client_auth.exception_occur:\n await asyncio.sleep(6)\n\n\nif __name__ == \"__main__\":\n try:\n asyncio.run(main())\n except KeyboardInterrupt:\n pass\n # The websocket client will send {'event': 'asyncio.CancelledError'}\n # via on_message so you can handle the behavior/next actions\n # individually within your strategy.\n```\n\n<a name=\"futuresusage\"></a>\n\n# Futures Clients\n\nThe Kraken Spot API can be accessed by executing requests to the endpoints\ndirectly using the `request` method provided by any client. This is demonstrated\nbelow.\n\nSee https://docs.kraken.com/api/docs/guides/global-intro for information about\nthe available endpoints and their usage.\n\n### `FuturesClient`\n\nThe simple Futures client provides access to all un-and authenticated endpoints.\n\n```python\nfrom kraken.futures import FuturesClient\n\nclient = FuturesClient(key=\"<your-api-key>\", secret=\"<your-secret-key>\")\nprint(client.request(\"GET\", \"/derivatives/api/v3/accounts\"))\n```\n\n### `FuturesAsyncClient`\n\nThe async Futures client allows for asynchronous access to Kraken's Futures\nendpoints. Below are two examples demonstrating its usage.\n\nUsing FuturesAsyncClient without a context manager; In this example, the client\nis manually closed after the request is made.\n\n```python\nimport asyncio\nfrom kraken.futures import FuturesAsyncClient\n\nasync def main():\n client = FuturesAsyncClient(key=\"<your-api-key>\", secret=\"<your-secret-key>\")\n try:\n response = await client.request(\"GET\", \"/derivatives/api/v3/accounts\")\n print(response)\n finally:\n await client.async_close()\n\nasyncio.run(main())\n```\n\nUsing FuturesAsyncClient as context manager; This example demonstrates the use\nof the context manager, which ensures the client is automatically closed after\nthe request is completed.\n\n```python\nimport asyncio\nfrom kraken.futures import FuturesAsyncClient\n\nasync def main():\n async with FuturesAsyncClient(key=\"<your-api-key>\", secret=\"<your-secret-key>\") as client:\n response = await client.request(\"GET\", \"/derivatives/api/v3/accounts\")\n print(response)\n\nasyncio.run(main())\n```\n\n<a name=\"futuresws\"></a>\n\n### `FuturesWSClient` (Websocket API)\n\nNot only REST, also the websocket API for Kraken Futures is available. Examples\nare shown below and demonstrated in `examples/futures_ws_examples.py`.\n\n- https://docs.futures.kraken.com/#websocket-api\n\nNote: Authenticated Futures websocket clients can also un-/subscribe from/to\npublic feeds.\n\n```python\nimport asyncio\nfrom kraken.futures import FuturesWSClient\n\nclass Client(FuturesWSClient):\n\n async def on_message(self, event):\n print(event)\n\nasync def main():\n # Public/unauthenticated websocket connection\n client = Client()\n await client.start()\n\n products = [\"PI_XBTUSD\", \"PF_ETHUSD\"]\n\n # subscribe to a public websocket feed\n await client.subscribe(feed=\"ticker\", products=products)\n # await client.subscribe(feed=\"book\", products=products)\n # \u2026\n\n # unsubscribe from a public websocket feed\n # await client.unsubscribe(feed=\"ticker\", products=products)\n\n # Private/authenticated websocket connection (+public)\n client_auth = Client(key=\"key-key\", secret=\"secret-key\")\n await client_auth.start()\n\n # print(client_auth.get_available_private_subscription_feeds())\n\n # subscribe to a private/authenticated websocket feed\n await client_auth.subscribe(feed=\"fills\")\n await client_auth.subscribe(feed=\"open_positions\")\n await client_auth.subscribe(feed=\"open_orders\")\n # \u2026\n\n # unsubscribe from a private/authenticated websocket feed\n await client_auth.unsubscribe(feed=\"fills\")\n\n while not client.exception_occur and not client_auth.exception_occur:\n await asyncio.sleep(6)\n\nif __name__ == \"__main__\":\n try:\n asyncio.run(main())\n except KeyboardInterrupt:\n # do some exception handling \u2026\n pass\n```\n\n---\n\n<a name=\"contribution\"></a>\n\n# \ud83c\udd95 Contributions\n\n\u2026 are welcome - but:\n\n- First check if there is an existing issue or PR that addresses your\n problem/solution. If not - create one first - before creating a PR.\n- Typo fixes, project configuration, CI, documentation or style/formatting PRs\n will be rejected. Please create an issue for that.\n- PRs must provide a reasonable, easy to understand and maintain solution for an\n existing problem. You may want to propose a solution when creating the issue\n to discuss the approach before creating a PR.\n- Please have a look at [CONTRIBUTION.md](./CONTRIBUTING.md).\n\n---\n\n<a name=\"trouble\"></a>\n\n# \ud83d\udea8 Troubleshooting\n\n- Check if you downloaded and installed the **latest version** of the\n python-kraken-sdk.\n- Check the **permissions of your API keys** and the required permissions on the\n respective endpoints.\n- If you get some Cloudflare or **rate limit errors**, please check your Kraken\n Tier level and maybe apply for a higher rank if required.\n- **Use different API keys for different algorithms**, because the nonce\n calculation is based on timestamps and a sent nonce must always be the highest\n nonce ever sent of that API key. Having multiple algorithms using the same\n keys will result in invalid nonce errors.\n\n---\n\n<a name=\"notes\"></a>\n\n# \ud83d\udcdd Notes\n\nThe versioning scheme follows the pattern `v<Major>.<Minor>.<Patch>`. Here's\nwhat each part signifies:\n\n- **Major**: This denotes significant changes that may introduce new features or\n modify existing ones. It's possible for these changes to be breaking, meaning\n backward compatibility is not guaranteed. To avoid unexpected behavior, it's\n advisable to specify at least the major version when pinning dependencies.\n- **Minor**: This level indicates additions of new features or extensions to\n existing ones. Typically, these changes do not break existing implementations.\n- **Patch**: Here, you'll find bug fixes, documentation updates, and changes\n related to continuous integration (CI). These updates are intended to enhance\n stability and reliability without altering existing functionality.\n\nCoding standards are not always followed to make arguments and function names as\nsimilar as possible to those of the Kraken API documentations.\n\n<a name=\"considerations\"></a>\n\n# Considerations\n\nThe tool aims to be fast, easy to use and maintain. In the past, lots of clients\nwere implemented, that provided functions for almost all available endpoints of\nthe Kraken API. The effort to maintain this collection grew to a level where it\nwas not possible to check various changelogs to apply new updates on a regular\nbasis. Instead, it was decided to concentrate on the `request` functions of\nthe `SpotClient`, `SpotAsyncClient`, `FuturesClient` and the\n`FuturesAsyncClient` (as well as their websocket client implementations). All\nthose clients named \"User\", \"Trade\", \"Market\", \"Funding\" and so on will no\nlonger be extended, but maintained to a certain degree.\n\n<a name=\"references\"></a>\n\n# \ud83d\udd2d References\n\n- https://python-kraken-sdk.readthedocs.io/en/stable\n- https://docs.kraken.com/api/\n- https://docs.kraken.com/api/docs/guides/global-intro\n- https://docs.kraken.com/rest\n- https://docs.kraken.com/websockets-v2\n- https://docs.futures.kraken.com\n- https://support.kraken.com/hc/en-us/sections/360012894412-Futures-API\n\n---\n",
"bugtrack_url": null,
"license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License. \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\" \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"{}\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives. Copyright 2023 Benjamin Thomas Schwertfeger Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
"summary": "Command-line tool and collection of REST and websocket clients to interact with the Kraken cryptocurrency exchange.",
"version": "3.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/btschwertfeger/python-kraken-sdk/issues",
"Documentation": "https://python-kraken-sdk.readthedocs.io/en/stable/",
"Homepage": "https://github.com/btschwertfeger/python-kraken-sdk"
},
"split_keywords": [
"crypto",
" trading",
" kraken",
" exchange",
" api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fb29dae3105a6623c3195993398215f886644c515f23ea95a3f5787ca719b5da",
"md5": "09637e240bb043a4a7df487f6c431043",
"sha256": "3fd4e6f952951cc3d2695d064977e388afad62a5d5b6491c78123e183c4e61ab"
},
"downloads": -1,
"filename": "python_kraken_sdk-3.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "09637e240bb043a4a7df487f6c431043",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 104226,
"upload_time": "2024-09-14T08:07:59",
"upload_time_iso_8601": "2024-09-14T08:07:59.359247Z",
"url": "https://files.pythonhosted.org/packages/fb/29/dae3105a6623c3195993398215f886644c515f23ea95a3f5787ca719b5da/python_kraken_sdk-3.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "11819a75138d22d65694467a01525905d9f4116eb5eccfb2bbe6225d4193e58f",
"md5": "3f9e19bc4b195b0fd900a43ccd144107",
"sha256": "dbf985855d8bdb501f8c3ab29c6d7fd8a748153839bfd9b23432ba3a27cbd88a"
},
"downloads": -1,
"filename": "python_kraken_sdk-3.1.1.tar.gz",
"has_sig": false,
"md5_digest": "3f9e19bc4b195b0fd900a43ccd144107",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 116278,
"upload_time": "2024-09-14T08:08:01",
"upload_time_iso_8601": "2024-09-14T08:08:01.223412Z",
"url": "https://files.pythonhosted.org/packages/11/81/9a75138d22d65694467a01525905d9f4116eb5eccfb2bbe6225d4193e58f/python_kraken_sdk-3.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-14 08:08:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "btschwertfeger",
"github_project": "python-kraken-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "python-kraken-sdk"
}