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
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 pyflick-1.1.3.tar.gz
.
File metadata
- Download URL: pyflick-1.1.3.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8ededb9fecab8d9828a93d15977e2a918819318b5548979a0925a1f5e2a97e4e
|
|
MD5 |
81082a7e8a3b296f76c252f2fc4c5030
|
|
BLAKE2b-256 |
c42f15af7421b8445ad2252ef1aa4ea9394acde47a9bfe0a8c6ff76a537685d6
|
Provenance
The following attestation bundles were made for pyflick-1.1.3.tar.gz
:
Publisher:
build-and-deploy.yml
on ZephireNZ/PyFlick
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pyflick-1.1.3.tar.gz
-
Subject digest:
8ededb9fecab8d9828a93d15977e2a918819318b5548979a0925a1f5e2a97e4e
- Sigstore transparency entry: 160907549
- Sigstore integration time:
-
Permalink:
ZephireNZ/PyFlick@65edf11ba3bd9d68b26b1694a38954671cb5c1af
-
Branch / Tag:
refs/tags/v1.1.3
- Owner: https://github.com/ZephireNZ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
build-and-deploy.yml@65edf11ba3bd9d68b26b1694a38954671cb5c1af
-
Trigger Event:
push
-
Statement type:
File details
Details for the file PyFlick-1.1.3-py3-none-any.whl
.
File metadata
- Download URL: PyFlick-1.1.3-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
eb1d269792178299bc268e2f4c60716e4b1633a6499f6dfad5269b59b0dc5983
|
|
MD5 |
538c9cfd0b40766fcd1e8e8b8b8e5540
|
|
BLAKE2b-256 |
3662fba2058c02022c1e73ecb05ae3cfbbee31bb368f3612747b0b05bb65072a
|
Provenance
The following attestation bundles were made for PyFlick-1.1.3-py3-none-any.whl
:
Publisher:
build-and-deploy.yml
on ZephireNZ/PyFlick
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pyflick-1.1.3-py3-none-any.whl
-
Subject digest:
eb1d269792178299bc268e2f4c60716e4b1633a6499f6dfad5269b59b0dc5983
- Sigstore transparency entry: 160907550
- Sigstore integration time:
-
Permalink:
ZephireNZ/PyFlick@65edf11ba3bd9d68b26b1694a38954671cb5c1af
-
Branch / Tag:
refs/tags/v1.1.3
- Owner: https://github.com/ZephireNZ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
build-and-deploy.yml@65edf11ba3bd9d68b26b1694a38954671cb5c1af
-
Trigger Event:
push
-
Statement type: