Skip to main content

Python API For Flick Electric in New Zealand

Project description

PyFlick

Build Status PyPI version

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

pyflick-1.1.3.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

PyFlick-1.1.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

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

Hashes for pyflick-1.1.3.tar.gz
Algorithm Hash digest
SHA256 8ededb9fecab8d9828a93d15977e2a918819318b5548979a0925a1f5e2a97e4e
MD5 81082a7e8a3b296f76c252f2fc4c5030
BLAKE2b-256 c42f15af7421b8445ad2252ef1aa4ea9394acde47a9bfe0a8c6ff76a537685d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyflick-1.1.3.tar.gz:

Publisher: build-and-deploy.yml on ZephireNZ/PyFlick

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for PyFlick-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 eb1d269792178299bc268e2f4c60716e4b1633a6499f6dfad5269b59b0dc5983
MD5 538c9cfd0b40766fcd1e8e8b8b8e5540
BLAKE2b-256 3662fba2058c02022c1e73ecb05ae3cfbbee31bb368f3612747b0b05bb65072a

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyFlick-1.1.3-py3-none-any.whl:

Publisher: build-and-deploy.yml on ZephireNZ/PyFlick

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page