Giter VIP home page Giter VIP logo

energistream-py's Introduction

EnergiStream

EnergiStream is an open source Python client for interacting with EnergiStream API, from MelRok.

https://codecov.io/github/Melrok/energistream-py/coverage.svg?branch=master

Installation

To install EnergiStream from source, clone the git repository to your local machine

$ git clone [email protected]:melrok/energistream-py.git

In the energistream root directory (same one where you found this file after cloning the git repo), execute

$ sudo pip install -e .

Dependencies

EnergiStream has a few key dependancies:

All requirements are specified in the requirements.txt. One can attempt to install these alongside the EnergiStream installation via

$ sudo pip install -r requirements.txt -e .

EnergiStream Guide

A quick guide to some of the core EnergiStream functionality. Examples and additional documentation are available at GitHub Pages.

Note : Always refer to the doctrings for all methods for a detailed summary of functionality.

Importing

To import the energistream library :

import energistream as es

Client Instantiation and Authentication

EnergiStreamClient takes a valid username and password and establishes a unique session with temporary credentials.

stream = es.EnergiStreamClient('USER', 'PASS', include_sensors=True)

authenticate uses the user credentials to authenticate the instantiated client in the event that authentication was not previously established or has lapsed.

stream.authenticate

The is_authenticated method returns a simple boolean true or false when asked if the client authentication is still valid.

stream.is_authenticated

External Data

The get_weather method returns a dataframe of hourly temperature and relative humidity data for the instantiated client's associated physical location.

Note: This data is collected from third party sources. Weather ID is an energistream unique key and not associated to any third party ID schema.

stream.get_weather(weather_id = 102, start = '12/29/2014', end = '1/29/2015')

Energistream Data and Metadata

The get_energy method accepts a sensor ID and returns a dataframe relating active and reactive energy, current and voltage RMS, and total Energy.

stream.get_energy(3505, start = '12/29/2014', end = '1/29/2015', tz = 'local')

The search_group_tree method accepts a keyword and searches the instantiated client for matching sensor groups returning group names, sensor group ID, and assigned sensors.

stream.search_group_tree('Engineering', case = False)

The base_group_level column designates the grouping hierarchy by levels, with 0 being root groups.

stream.groups[stream.groups.base_group_level == 0]

The sensors method returns a dataframe describing the individual sensors associated with the instantiated energistream client ID. This includes the sensor ID, the associated group ID, time zone, and a multiplier based on the method of measurement i.e. one, two, or three channel.

stream.sensors

The get_boards method returns a dataframe describing the boards associated with the instantiated energistream client ID. This includes the boards serial number, version, display name, and model.

stream.get_boards

The get_demand method returns power data for a given sensor group(demand or generation) at multiple resolutions (1, 5, 10, 15, and 30 minutes, daily, weekly, monthly, and yearly). Start and end date may be specified as well as the timezone and desired resolution.

Note: Defaults to the last thirty days and fifteen minute resolution.

stream.get_demand(157)

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.