Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Pure Python 3 open source library to handle Iberian electricity market data published by OMIE.

Project description

aomie is a pure Python 3 open source library that helps you handle Iberian electricity market data published by OMIE.

Over 80 statistical indicators of historical data of the Iberian electricity market are published at http://www.omie.es/aplicaciones/datosftp/datosftp.jsp. These indicators are available as downloadable zip files containing text files of daily data with different levels of aggregation (by bidding unit, technology, etc.). To analyse these indicators over time or to make comparison between them you need to follow these steps:

  • Download all the data files covering the time horizon of interest
  • Extract the daily text files from the downloaded zip files
  • Combine the content of potentially thousands of files

aomie automates this workflow. It downloads all files of the required metric over a user-specified time period, unzips the downloaded files and inserts their content into a SQLite database. Once in the database, data analysis can be conveniently performed using SQLite directly or with tools such as pandas in Python or dplyr in R.

  • Free software: MIT license

Installation

pip install aomie

Usage

Import the aomie library into your Python libraries, scripts or applications as usual:

import aomie

amoie includes a succint command line interface that make OMIE data handling extremely easy. Some usage examples follow.

A typical aomie starts by jointly setting the required configuration parameters through a toml configuration file

omie -f myconfig.toml

The configuration settings included in myconfig.toml are now avalaible to omie commands without having to explicitly call the toml config file again, e.g. to download data just type

omie download

Obviously you can use a different config file at any time

omie -f otherconfig.toml download

or just change some of the configuration settings

omie -c end 200512

To check the current configuration settings type

omie -d

Once the zip files have been downloaded we can extract them like this

omie extract

To complete the workflow by inserting the extracted data into a SQLite database type

omie insert

The aomie commmand fetch bundles all the key data handling tasks. To run these tasks in a single step just type

omie -f myconfig.toml -c end 200512 fetch

Given the convenience of the fetch command, other commands that just perform one of the steps in omie workflow may seem redundant. Note however that omie data handling tasks covering long time horizons may involve downloading and processing hundreds of MBs that are disk and time consuming, and you may therefore prefer to proceed cautiously step by step.

More information can be found in the command line help, e.g. to learn more about aomie commands such as download type

omie download --help

From this help we learn that we can download and extract in a single step by typing

omie download -e

TIP: you can save your self some typing in the command line replacing omie with om, e.g. like this

om download -e

Development

To run all the tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows
set PYTEST_ADDOPTS=--cov-append
tox
Other
PYTEST_ADDOPTS=--cov-append tox

Changelog

0.0.0 (2019-09-15)

  • First release on GitHub.
  • First release on PyPI (2019-09-17)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aomie, version 0.0.0
Filename, size File type Python version Upload date Hashes
Filename, size aomie-0.0.0-py2.py3-none-any.whl (8.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size aomie-0.0.0.tar.gz (16.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page