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.1.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file PyFlick-0.0.1.tar.gz
.
File metadata
- Download URL: PyFlick-0.0.1.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 | 33ce823979c9a13e7699f3d980611d78b821887c91a9b5ef08ae0895103b61c9 |
|
MD5 | a9cd4b5ece91e70a9d98e06af31bbbb5 |
|
BLAKE2b-256 | a8f8cb4a9910a5ed5831f8a18f6c7a9b792f660229a333b7df01e6d0db5a7412 |
File details
Details for the file PyFlick-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: PyFlick-0.0.1-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 | e16218d28c9b35a4a58b7ff1b3222fc79644f2ab0e99620297d4a9741f27818a |
|
MD5 | 726b987848d6a3b3e72fa4454e82a446 |
|
BLAKE2b-256 | f0c6a8c5f63efb46501d8e7e03d688be9d133eb8ebee11cb6fa5a5da57323fec |