%global _empty_manifest_terminate_build 0 Name: python-PyFlick Version: 0.0.2 Release: 1 Summary: Python API For Flick Electric in New Zealand License: MIT License URL: https://github.com/ZephireNZ/PyFlick Source0: https://mirrors.nju.edu.cn/pypi/web/packages/bf/b3/2714f824b14c9617db6c27ddd4d6ac5b472be2be5bbc3eeaa9d04dbddf44/PyFlick-0.0.2.tar.gz BuildArch: noarch %description [![Build Status](https://travis-ci.org/ZephireNZ/PyFlick.png?branch=master)](https://travis-ci.org/ZephireNZ/PyFlick) [![PyPI version](https://badge.fury.io/py/PyFlick.svg)](https://pypi.org/project/PyFlick/) # PyFlick A quick and dirty Python API for [Flick Electric](https://flickelectric.co.nz). ### Usage ```python 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: ```json { "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": {} }, ... ] } } ``` %package -n python3-PyFlick Summary: Python API For Flick Electric in New Zealand Provides: python-PyFlick BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-PyFlick [![Build Status](https://travis-ci.org/ZephireNZ/PyFlick.png?branch=master)](https://travis-ci.org/ZephireNZ/PyFlick) [![PyPI version](https://badge.fury.io/py/PyFlick.svg)](https://pypi.org/project/PyFlick/) # PyFlick A quick and dirty Python API for [Flick Electric](https://flickelectric.co.nz). ### Usage ```python 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: ```json { "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": {} }, ... ] } } ``` %package help Summary: Development documents and examples for PyFlick Provides: python3-PyFlick-doc %description help [![Build Status](https://travis-ci.org/ZephireNZ/PyFlick.png?branch=master)](https://travis-ci.org/ZephireNZ/PyFlick) [![PyPI version](https://badge.fury.io/py/PyFlick.svg)](https://pypi.org/project/PyFlick/) # PyFlick A quick and dirty Python API for [Flick Electric](https://flickelectric.co.nz). ### Usage ```python 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: ```json { "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": {} }, ... ] } } ``` %prep %autosetup -n PyFlick-0.0.2 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-PyFlick -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri May 05 2023 Python_Bot - 0.0.2-1 - Package Spec generated