Python API For Flick Electric in New Zealand
Project description
PyFlick
A quick and dirty Python API for Flick Electric.
Usage
from pyflick import FlickAPI
from pyflick.authentication import SimpleFlickAuth
from aiohttp import ClientSession
def async get_flick_pricing():
async with ClientSession() as session:
auth = SimpleFlickAuth("USERNAME", "PASSWORD", session)
api = FlickAPI(auth)
return await api.getPricing()
The SimpleFlickAuth
client can also accept custom client ID and secret (this can be found by sniffing the client).
API will return a FlickPrice
object for accessing the price information.
You can also get the raw data via FlickPrice.raw
.
This will return a price object that looks a little like this:
{
"kind": "mobile_provider_price",
"customer_state": "active",
"needle": {
"price": "11.163",
"status": "urn:flick:market:price:no_contract",
"unit_code": "cents",
"per": "kwh",
"start_at": "2020-04-19T02:30:00Z",
"end_at": "2020-04-19T02:59:59Z",
"now": "2020-04-19T02:34:38.410Z",
"type": "rated",
"charge_methods": [
"kwh"
],
"components": [
{
"kind": "component",
"charge_method": "kwh",
"charge_setter": "retailer",
"value": "4.26",
"quantity": "1.0",
"unit_code": "cents",
"per": "kwh",
"flow_direction": "import",
"metadata": {
"content_code": "UN",
"channel_number": 1,
"meter_serial_number": "RD1111111",
"hours_of_availability": 24
},
"_links": {}
},
...
]
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
PyFlick-0.0.2.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file PyFlick-0.0.2.tar.gz
.
File metadata
- Download URL: PyFlick-0.0.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 705c82d8caedfff19117c8859cc1b4f56e15ab8dbc0d64d63b79d8634007897f |
|
MD5 | 305a5514df312d564671c37be22896b0 |
|
BLAKE2b-256 | bfb32714f824b14c9617db6c27ddd4d6ac5b472be2be5bbc3eeaa9d04dbddf44 |
File details
Details for the file PyFlick-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: PyFlick-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccfad87f34fff7cd34ab4f78fb1d2d9f519a994526e3da38447a7fa00b75f4df |
|
MD5 | 6d7887ac8db1080cb98c88f16e27972b |
|
BLAKE2b-256 | c61cd3bce567e1a494ad61d255a021b9c3f1a553cb4e61428d87ae3fcd1c61fc |