danaildichev / enphase-API-and-reporting

A Python CLI tool to get data from Enphase API and accompanying dashboard for reporting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enphase-API-and-reporting

Static Badge

A Python CLI tool to get data from Enphase API and accompanying dashboard for reporting.

UNDER CONSTRUCTION

Table of Contents

Live Demo

Coming soon.

Install

Coming soon.

Usage

MVP

See script/mvp for an example of how to call the Enphase API. Requires a valid access token.

Version 1

Assuming you have a valid access token, the simplest way to print a response from Enphase is to call the try_to_get() function:

from utils.Enphase import Enphase
# initialize with json configs
enphase = Enphase(APP, API, AUTH, SYS, is_verbose=True)
enphase.try_to_get("systems") # https://api.enphaseenergy.com/api/v4/systems

With the EnphaseEndpointLibrary class, you can call the record_response() function to record responses as JSON to the 'response_logs' folder.

from utils.Enphase import Enphase
from utils.EnphaseEndpointLibrary import EnphaseEndpointLibrary
from utils.FileWriter import FileWriter
from utils.JsonCopier import JsonCopier

# initialize JSON configs

enphase = Enphase(_APP, _API, _AUTH, _SYS, is_verbose=True)
file_writer = FileWriter('./response_logs/')
enphase_api = EnphaseEndpointLibrary(enphase, file_writer)

enphase_api.record_response('systems.json', 'systems') # https://api.enphaseenergy.com/api/v4/systems

API

Additional descriptions for using modules in version 1 coming soon.

Issues

Open an issue or hit me up.

Contributing

PRs accepted.

To Do

  1. Build a Reporting Module for turning responses into formatted JSON for the web UI.
  2. Build the web UI.

License

MIT

Diagrams

Generating an Enphase API Access Token

get_lifetime_data_for() loop

Plan for what the Reporting Module will do

About

A Python CLI tool to get data from Enphase API and accompanying dashboard for reporting.

License:MIT License


Languages

Language:Python 99.9%Language:HTML 0.1%