pyCelsiusNetwork
Unofficial Python Wrapper for the Celcius Network API
See more on Github
What is this?
pyCelsiusNetwork is a Python API Wrapper for Celsius Network public API. This package also offers a short-and-sweet abstraction layer, with functions like depagination of API Results, reversing, and filtering, but the raw JSON response is always one paramether away.
Requirements
You will need:
- a Omnibus Treasury Partner Token, you can read on how to get one here.
- a Celsius Account API Key, you can read on how to generate one here
- a computer with
Python 3.5+andpipinstalled
Installation
$ pip install pycelsiusnetwork
Usage and Examples
Docs
Additional documentation is provided through the __doc__ attribute.
>> from pycelsiusnetwork import CelsiusNetwork
>> print(CelsiusNetwork.get_deposit_adress_for_coin.__doc__)
Initialization
from pycelsiusnetwork import CelsiusNetwork
api = CelsiusNetwork("PARTNER_TOKEN",
"USER_API_KEY")
### Filtering transactions
You don't neet to set all filtering options, only the ones you want.
> dt_from and dt_to also accepts datetime objects.
>
```python
filtered_transactions = api.get_transactions(dt_from="2020-01-01",
dt_to="2020-05-01",
state="confirmed",
nature="interest",
amount_lower_than=2,
amount_bigger_than=0.1)
Silence errors
By passing silent=True to any function or the API object itself, you can mute package exceptions, A.K.A. AbstractionFailure and CelsiusNetworkHTTPError, by doing so, None will be returned in the presence of an error instead of raising an Exception.
api = CelsiusNetwork("PARTNER_TOKEN",
"USER_API_KEY",
silent=True)
or
api.get_deposit_adress_for_coin('BTC', silent=True)
Also, if you pass silent=True to the API initialization, you can override it for any function by passing silent=False to it.
api = CelsiusNetwork("PARTNER_TOKEN",
"USER_API_KEY",
silent=True)
api.get_deposit_adress_for_coin('BTC', silent=False)
Getting the raw response
If you want to ignore the abstraction layer and get access to that juicy JSON directly, you can pass raw=True to any function, doing so, will make the function return the full response JSON.
api.get_supported_coins(raw=True)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Metadata
Release files for pycelsiusnetwork 0.3.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 | |
|---|---|---|---|---|
| pycelsiusnetwork-0.3.0.tar.gz | 7.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycelsiusnetwork-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.6 kB
Release files / pycelsiusnetwork-0.3.0.tar.gz
| Download URL | pycelsiusnetwork-0.3.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df3040d30691d2683e334ac2f5e8e0f96f823fde620f87f5e1b284a36fe0ff15
|
|
BLAKE2b-256 checksum How to use checksums |
70548589e8640a38bb188c2e9f37d235e1e0165f6655114f3a7211da74c2fb58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Release files / pycelsiusnetwork-0.3.0-py3-none-any.whl
| Download URL | pycelsiusnetwork-0.3.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50d609779c298b55a363cbbf21c9c9496ab5fcc47c61d343f9e3352d617ab961
|
|
BLAKE2b-256 checksum How to use checksums |
7274c2861ac67d5afff0e29c5fd6ce6afc92f8f220db1c368ba4a99b7bc62752
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Security for pycelsiusnetwork 0.3.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.