https://github.com/gisce/liquicomun
Liquicomun
https://github.com/gisce/liquicomun
api esios hacktoberfest parser python ree
Last synced: 10 months ago
JSON representation
Liquicomun
- Host: GitHub
- URL: https://github.com/gisce/liquicomun
- Owner: gisce
- License: agpl-3.0
- Created: 2017-09-05T13:09:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-21T08:16:11.000Z (over 4 years ago)
- Last Synced: 2025-03-26T02:32:19.328Z (11 months ago)
- Topics: api, esios, hacktoberfest, parser, python, ree
- Language: Python
- Homepage:
- Size: 4.43 MB
- Stars: 4
- Watchers: 16
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Liquicomun lib
It provides a simple interface to reach ESIOS Liquicomun data.
Handled data:
- Perdidas (losses)
- Precios (prices)
## Installation
```
pip install liquicomun
```
## Usage
### Fetch all available losses for a concrete date
It provides an iterator that handle all the available losses for the requested scenario.
For each iteration it return the related `next` Perdida instance (loss).
Start and end dates are mandatory.
Tariffs and subsystems list are optional, and override the default list of elements to process.
```
from liquicomun import Perdidas
scenario = {
'date_start': '20171001',
'date_end': '20171031',
#'tariffs': ['2.0A'], # Optional tariffs list
#'subsystems': ["baleares", "ceuta"], # Optional subsystems list
}
losses = Perdidas(**scenario)
# Iterate losses
for a_loss in losses:
current_tariff = a_loss.tariff
current_subsystem = a_loss.subsystem
data_matrix = a_loss.matrix
data_version = a_loss.version
```
### Fetch just the losses for one tariff and subsystem
It return a Loss instance
The expected tariff, start and end dates are mandatory.
Subsystem and version are optional. If no subsystem is provided will fetch the peninsular data.
```
from liquicomun import Perdida
scenario = {
'date_start': '20171001',
'date_end': '20171031',
'tariff': '2.0A',
#'subsystem': "baleares", # default "" -> peninsula
}
a_loss = Perdida(**scenario)
data_matrix = a_loss.matrix
data_version = a_loss.version
current_tariff = a_loss.tariff
current_subsystem = a_loss.subsystem
```