BitEx Kraken - Plugin for Kraken’s API
Installation
Installation is simple, as it should be:
pip install bitex-kraken
Qickstart
After installing, requesting data is easy:
>>>from bitex import BitexSession
>>>session = BitexSession()
# bitex.BitexSession provides a set of methods to execute the most common queries
>>>r = session.ticker("kraken", "XBTUSD")
# The response objects returned are bitex.BitexResponses, which behave like regular requests.Response objects.
>>>r
<KrakenResponse [200]>
>>>r.json()
{
"error":[],
"result": {
"XXBTZUSD":{
"a":["3809.10000","1","1.000"],
"b":["3809.00000","1","1.000"],
"c":["3809.60000","0.11007700"],
"v":["1378.29558699","4120.69226171"],
"p":["3798.72908","3797.90051"],
"t":[1960,5958],
"l":["3776.90000","3775.80000"],
"h":["3817.60000","3819.30000"],
"o":"3796.20000"
}
}
}
# bitex-kraken also provides convenience methods for data piping
>>>r.key_value_dict()
{
"uid": "<uid>",
"received": "<ts>",
"ask_price": "52131.00000",
"ask_size": "1.000",
"ask_size": "52130.10000",
"bid_size": "2.000",
"last_price": "52130.20000",
"last_size": "0.04000000",
"vol": "1231.07009049",
"vol_24h": "6124.65870266",
"vwap": "52031.82478",
"vwap_24h": "51669.15093",
"trades": "14674",
"trades_24h": "59777",
"high": "52555.10000",
"high_24h": "52779.60000",
"low": "51370.00000",
"low_24h": "50519.00000",
"open": "52130.00000"
}
# Or for storing them as uid-label-value triples
>>>r.triples()
[
["<uid>", "ask_price", "52131.00000"],
["<uid>", "ask_size", "1.000"],
["<uid>", "ask_size", "52130.10000"],
["<uid>", "bid_size", "2.000"],
["<uid>", "last_price", "52130.20000"],
["<uid>", "last_size", "0.04000000"],
["<uid>", "vol", "1231.07009049"],
["<uid>", "vol_24h", "6124.65870266"],
["<uid>", "vwap", "52031.82478"],
["<uid>", "vwap_24h", "51669.15093"],
["<uid>", "trades", "14674"],
["<uid>", "trades_24h", "59777"],
["<uid>", "high", "52555.10000"],
["<uid>", "high_24h", "52779.60000"],
["<uid>", "low", "51370.00000"],
["<uid>", "low_24h", "50519.00000"],
["<uid>", "open", "52130.00000"],
["<uid>", "received", "<ts>"]
]
Development
If you’re looking to work on or with bitex-framework, you’ll want the development environment setup. We’ve supplied a few make targets to make your life easier:
# Install bitex and its development requirements make development
We also supply targets to run code formatters, linters and tests:
# Run code formatters make pretty # Verify code style make style-check # Run tests via tox tox -e testenv
If you’d like to contribute to the project, please have a look at CONTRIBUTING.rst on some general pointers about how development takes place, what the expected steps of you are and what requirements we have to merge a PR.
Metadata
Release files for bitex-kraken 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bitex-kraken-1.0.0.tar.gz | 9.7 kB | Without provenance | Details for bitex-kraken-1.0.0.tar.gz |
Release files / bitex-kraken-1.0.0.tar.gz
| Download URL | bitex-kraken-1.0.0.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5b97ebf8f4339c2a66ffa78327a784804e93c51410eb7b4db9fbbad0ca62b96
|
|
BLAKE2b-256 checksum How to use checksums |
e21a05d4ff4d77d88d32fe067c8d8cd43e129293b0ebb3f31d89d6857d32f5c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.5
|
Security for bitex-kraken 1.0.0
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.