Coder Social home page Coder Social logo

evergy's Introduction

⚡Evergy Client

Latest Version on PyPi Supported Python Versions Documentation Status Requriements Status

A simple utility that you can use to login to your Evergy account and retrieve you meter readings.

Note: This is an unofficial utility that uses Evergy's non-public API.

Previously known as "KCPL"

⚠ No Longer Maintained ⚠

I no longer have an Evergy account so I can't test this. If you would like to become a maintainer (or even just make small fixes) let me know 🙂

Install

pip install evergy

Usage

from evergy.evergy import Evergy

evergy = Evergy("<evergy-username>", "<evergy-password>")

data = evergy.get_usage()
print("Today's kWh: " + str(data[-1]["usage"]))

Output

The last element from the get_usage() will be the latest data. The usage is in kilowatt-hours. I believe the peakDateTime is the time during that day when your usage was the highest and the peakDemand is how many kilowatts you were drawing at that time.

Latest data:
{
    'period': 'Saturday',
    'billStart': '0001-01-01T00:00:00',
    'billEnd': '0001-01-01T00:00:00',
    'billDate': '2021-09-18T00:00:00',
    'date': '9/18/2021',
    'usage': 14.7756,
    'demand': 3.7992,
    'avgDemand': 0.0,
    'peakDemand': 3.7992,
    'peakDateTime': '12:45 p.m.',
    'maxTemp': 71.0,
    'minTemp': 71.0,
    'avgTemp': 71.0,
    'cost': 18.5748, 
    'isPartial': False
}

Home Assistant Integration

There is currently a Home Assistant integration that uses this library. Checkout TheBradleySanders/Evergy.

Related Projects

Development

Setup

python -m pip install --upgrade virtualenv
virtualenv venv
.\venv\Scripts\activate.ps1

Code Formatting

Install the dev dependencies and run isort and flake8 to properly format the code.

pip install -r requirements_dev.txt
isort evergy/
flake8 evergy/

Build Docs

Windows PowerShell:

pip install -r docs/requirements_docs.txt
docs\make.bat clean; docs\make.bat html

Release New Version

  • Bump __version__ in evergy/__init__.py
git commit -m "Bump version"
git tag -a v1.0.1 -m "v1.0.1"
git push --tags

Build Wheel

The --no-isolation flag tells it to use the existing virtual env

python -m build --no-isolation --wheel

Upload to PyPi

Test

twine upload --verbose --repository testpypi dist/*

Prod

twine upload --verbose --repository pypi dist/*

evergy's People

Contributors

lawrencefoley avatar ben-reg avatar thebradleysanders avatar patrickjmcd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.