Git Product home page Git Product logo

nemweb's Introduction

nemweb

This is a python3 package to directly download and process AEMO files from www.nemweb.com.au. Main module within the package downloads the nemweb files and inserts the tables into a local SQLite database.

This forms part of the backend of the OpenNEM platform. The OpenNEM backend utilises a normalised MySQL database (with foreign key and unique constraints). At present, this package only includes a simple sqlite interface without this support of capability. A mysql interface and module will be added (...eventually - see enhancements).

Getting started

Dependencies

Installation

nemweb can be installed through pip:

pip install opennem

Or by running:

python3 setup.py install

From the package directory. If installing by setup.py, a post-install script will prompt you input a directory for the sqlite database to live in. For example:

'Enter directory (abs path) to store for sqlite db:'/home/dylan/Data

This value will live in a configuration file in your root directory ($HOME/.nemweb_config.ini).

IMPORTANT If you install via pip you must manually enter the sqlite directory in a file named .nemweb_config.ini in your home directly post- install (...couldn't figure out how to make post-install scripts to work with pip).

Quick example

from nemweb import nemweb_current

nemweb_current.update_datasets(['dispatch_scada'])
DISPATCH_UNIT_SCADA doesn't exists. Enter start date [YYYYMMDD]: 20180624

The first time you add a new dataset to you sqlite db, it will prompt you for a date to start donwloading from. From then on, it will only download data beyond what you already have locally.

You can chose to print progress to screen, if desired. For example (and for a table that has already been initialised):

from nemweb import nemweb_current

nemweb_current.update_datasets(['dispatch_scada'], print_progress = True)
'Dispatch_SCADA 2018-06-24 13:40:00'
'Dispatch_SCADA 2018-06-24 13:45:00'
'Dispatch_SCADA 2018-06-24 13:50:00'
'Dispatch_SCADA 2018-06-24 13:55:00'
'...'

Currently, the following dataset are built in to the package, and can be added and downloaded automatically from the Current index of nemweb

  • next_day_actual_gen
  • rooftopPV_actual
  • trading_is
  • dispatch_scada
  • next_day_dispatch
  • dispatch_is

Other datasets can be add by using using the class factory function for containing data for 'Current' datasets (CurrentDataset) found in the nemweb_current module. The namedtuple from this can then be used with CurrentFileHandler class to download and process that dataset.

Documentation

Build Status

Find more information in the documentation at readthedocs.

TODO

In no particular order:

  • Add more datasets from Current index
  • Add module to process archived data (from Archive index)
  • Add more sophisticate support for sqlite database (e.g. selectively inserting fields, tables from dataset)
  • Add module for interfacing with mysql database

nemweb's People

Contributors

dylanjmcconnell avatar dylan-climate-energy-college avatar jufemaiz avatar adgefficiency avatar bje- avatar timb07 avatar dependabot[bot] 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.