Giter Site home page Giter Site logo

connorrr / opennempy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opennem/opennempy

0.0 1.0 0.0 7.66 MB

OpenNEM Australian Energy Data Python Client

Home Page: https://opennem.org.au/

Python 80.93% Shell 12.33% Makefile 2.72% Jupyter Notebook 4.01%

opennempy's Introduction

OpenNEM Energy Market Data Access

PyPI Tests PyPI - License

The OpenNEM project aims to make the wealth of public National Electricity Market (NEM) data more accessible to a wider audience.

This client library for Python enables accessing the Opennem API and data sets.

Project homepage at https://opennem.org.au

Developer documentation at https://developers.opennem.org.au/

Currently supporting the following energy networks:

1. Requirements

  • Python 3.8+ (see .python-version with pyenv)
  • Docker and docker-compose if you want to run the local dev stack

2. Quickstart

$ pip install opennem
>>> import opennem

3. Development

3.1 Auto setup and install

For contributions and development of this repository you need to install all the requirements. There are some helper scripts in the scripts/ folder.

$ ./scripts/init.sh

By default the venv is installed in the user local cache folder and not in the project path. To link the venv so that it can be found automatically by the shell or editors run the helper script

$ ./scripts/link_venv.sh
Created .venv

3.2 Manual Setup

3.2.1 Prerequisites

For MacOS and Linux require pyenv and poetry

3.2.2 Initialize python

We use pyenv for python versioning as it allows a system to run multiple version of python. The version for this project is specified in the .python-version file in the root of the repository.

To install the locally required python version

$ pyenv install `cat .python-version`

To initialize and use the local python version

$ pyenv version local
3.9.6 (set by /Users/user/Projects/Opennem/opennempy/.python-version)

To test the install is correct

❯ python -V
Python 3.9.6
❯ which python
/Users/n/.pyenv/shims/python

3.2.3 Install with poetry

To manually setup the local development environment, simply create the virtual environment, link it and setup the PYTHONPATH

$ poetry install
$ ln -s `poetry env info -p` .venv
$ source .venv/bin/activate
$ pwd > .venv/lib/python3.9/site-packages/local.pth

Alternatively to actiavate the virtual environment poetry has a shell command:

$ poetry shell
Spawning shell within /Users/n/Library/Caches/pypoetry/virtualenvs/opennem-pFt2SfpM-py3.9
$ which python
/Users/n/Library/Caches/pypoetry/virtualenvs/opennem-pFt2SfpM-py3.9/bin/python

3.2.4 Install with venv

Alternatively if you do not wish to use poetry you can setup a simple venv in the local folder and activate it.

$ python -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt

3.3 Test Install

You should be able to run a Python REPL (like iPython) and import the opennem module

$ ipython
Python 3.9.6 (default, Jun 28 2021, 19:24:41)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.23.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import opennem

In [2]:

opennempy's People

Contributors

nc9 avatar dylan-climate-energy-college avatar dylanjmcconnell avatar

Watchers

James Cloos 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.