A simple Python client for the BloomSky API.
Project description
A simple Python client for the BloomSky API.
Note: Neither this package nor its maintainer are affiliated with BloomSky.
For more information about the BloomSky device and its API, see: http://weatherlution.com/bloomsky-api/
Prerequisites
Python (2.7, 3.3, 3.4, 3.5)
BloomSky API key (get it here: https://dashboard.bloomsky.com/)
Getting Started
Installation
pip install BloomSky-API
To install optional command-line interface (requires click):
pip install BloomSky-API[cli]
Usage
You can either store the API key in an environment variable named BLOOMSKY_API_KEY or provide it as an argument when creating the client.
Stored in environment variable:
import bloomsky_api
client = bloomsky_api.BloomSkyAPIClient()
data = client.get_data()
Provided via argument:
import bloomsky_api
client = bloomsky_api.BloomSkyAPIClient(api_key='Your-real-API-key-goes-here')
data = client.get_data()
Command Line Interface
If you install the optional command-line interface, the bloomsky-api command will be available. Usage:
Usage: bloomsky-api [OPTIONS]
Retrieve data from the BloomSky API and output it as JSON.
Options:
--api-key TEXT BloomSky API key (can be set via env var
BLOOMSKY_API_KEY).
--api-url TEXT Override BloomSky API endpoint URL.
--json-indent INTEGER Number of spaces to indent nested JSON levels.
-i, --intl-units Use SI units instead of the default US.
--raw Return raw response instead of remapped keys.
--help Show this message and exit.
Data
The returned data contains all of the information from the API response but with more Pythonic names and data types.
History
0.3.0 - 2017-01-07
Include device_type in response
0.2.0 - 2016-08-22
Add CLI
0.1.0 - 2016-08-21
Convert timestamp to ISO timestamp accounting for offset
0.0.1 - 2016-08-20
Initial 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
File details
Details for the file BloomSky-API-0.3.0.tar.gz
.
File metadata
- Download URL: BloomSky-API-0.3.0.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee01084fb53f909ab3e6b141e73592c896a01b110e6a36a7a6bce7d3a9ec0c4f |
|
MD5 | 665c92f0ec8e109c6b0e856851aaeda3 |
|
BLAKE2b-256 | 80298fc5d102aa3e1f37ed700ad0ba02592eb76a485271297451858ec94c0402 |
File details
Details for the file BloomSky_API-0.3.0-py2.py3-none-any.whl
.
File metadata
- Download URL: BloomSky_API-0.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 746fb80e970f2f53fcf36a7939072fb3e1fad6fca31441030aaea429b557437f |
|
MD5 | afdd1aa4feb630f66cb98720e027b751 |
|
BLAKE2b-256 | 2c5c89f6f08913cfcc0360361f3136190c7e0da8b2c0fc769ac0f48137fb7f76 |