Python wrapper around Live Coin Watch API
Project description
LiveCoinWatch API wrapper
Python3 wrapper around the LiveCoinWatch API
Installation
PyPI
pip install pylivecoinwatch
or from source
git clone https://github.com/PlayErphil/pylivecoinwatch.git
cd pylivecoinwatch
python3 setup.py install
Usage
Create the class.
from pylivecoinwatch import LiveCoinWatchAPI
lcw = LiveCoinWatchAPI("<YOUR_API_KEY>")
The package has no API key, so make sure to get one from the API playground and pass it as a parameter when creating the class.
API Key Error
If your API key is wrong or you didn't specify one, the class will raise 401 Error.
401 Error example:
>>> from pylivecoinwatch import LiveCoinWatchAPI
>>> lcw = LiveCoinWatchAPI()
>>> lcw.overview()
Traceback (most recent call last):
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.livecoinwatch.com/overview
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
ValueError: {'error': {'code': 401, 'status': 'Unauthorized', 'description': 'The requester is not authorized to access the resource. This is similar to 403 but is used in cases where authentication is expected but has failed or has not been provided.'}}
If you wished to change your API key at any point you can use the following function:
lcw.set_api_key("<NEW_API_KEY>")
# This will change your API key to <NEW_API_KEY>
Usage
The required parameters for each endpoint are defined as required (mandatory) parameters for the corresponding functions. Any optional parameters can be passed using same names, as defined in LiveCoinWatch API Documentation
**Note that it returns a response object from the request library
Usage examples:
>>> lcw.status
VERSION 0.2
- Functions now return dict
- Tests implemented with new API
VERSION 0.1
- All endpoints added
- Tests implemented
- First release
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
Built Distribution
Hashes for pylivecoinwatch-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27a8dfed2b6f0dcb07e92b9e538daa65d153ee8f9043cd127ea96452ddee4fbb |
|
MD5 | e678c7b1469ab9ca57a96be799cfd2e8 |
|
BLAKE2b-256 | 0da9c83e24b76b5a3fb5dbb6c004f0cb43df8aeb2f4e18ec3d44dbe56feef862 |