Git Product home page Git Product logo

entsog's Introduction

entsog

The goal of entsog is to wrap the ENTSO-G API.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("krose/entsog")

Example

Most of the functions have a lot of paramaters you can use to filter. The ones shown below are just very basic.

Here is how to get data. We load the relevant packages and extract the data from the api:

library(entsog)
library(tidyverse)
#> Warning: package 'tidyverse' was built under R version 3.6.2
#> -- Attaching packages ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- tidyverse 1.3.0 --
#> v ggplot2 3.2.1     v purrr   0.3.3
#> v tibble  2.1.3     v dplyr   0.8.3
#> v tidyr   1.0.0     v stringr 1.4.0
#> v readr   1.3.1     v forcats 0.4.0
#> Warning: package 'tidyr' was built under R version 3.6.2
#> -- Conflicts ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- tidyverse_conflicts() --
#> x dplyr::filter() masks stats::filter()
#> x dplyr::lag()    masks stats::lag()

Get all the connections between transmission system operators and their respective balancing zones

glimpse(eg_agg(countryKey = "DE"))
#> Observations: 129
#> Variables: 27
#> $ id                   <chr> "1AggregatesDEDE-NCG-----DE-TSO-0007entry...
#> $ dataSet              <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
#> $ dataSetLabel         <chr> "Aggregates", "Aggregates", "Aggregates",...
#> $ indicator            <chr> "Nomination/Renomination", "Allocation", ...
#> $ periodType           <chr> "day", "day", "day", "day", "day", "day",...
#> $ periodFrom           <dttm> 2020-09-09 06:00:00, 2020-09-09 06:00:00...
#> $ periodTo             <dttm> 2020-09-09 04:00:00, 2020-09-10 04:00:00...
#> $ countryKey           <chr> "DE", "DE", "DE", "DE", "DE", "DE", "DE",...
#> $ countryLabel         <chr> "Germany", "Germany", "Germany", "Germany...
#> $ bzKey                <chr> "DE-NCG-----", "DE-NCG-----", "DE-NCG----...
#> $ bzShort              <chr> "NCG", "NCG", "NCG", "NCG", "NCG", "NCG",...
#> $ bzLong               <chr> "NCG Balancing Zone", "NCG Balancing Zone...
#> $ operatorKey          <chr> "DE-TSO-0007", "DE-TSO-0007", "DE-TSO-000...
#> $ operatorLabel        <chr> "Fluxys TENP GmbH", "Fluxys TENP GmbH", "...
#> $ tsoEicCode           <chr> "21X000000001133M", "21X000000001133M", "...
#> $ directionKey         <chr> "entry", "entry", "entry", "entry", "entr...
#> $ adjacentSystemsKey   <chr> "TransmissionBE-LUX------", "Transmission...
#> $ adjacentSystemsLabel <chr> "BeLux", "BeLux", "Switzerland", "Switzer...
#> $ year                 <dbl> 2020, 2020, 2020, 2020, 2020, 2020, 2020,...
#> $ month                <dbl> 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,...
#> $ day                  <dbl> 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,...
#> $ unit                 <chr> "kWh/d", "kWh/d", "kWh/d", "kWh/d", "kWh/...
#> $ value                <dbl> 0, 0, 0, 0, 15983568, 1753533, 0, 0, 8378...
#> $ countPointPresents   <dbl> 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1,...
#> $ flowStatus           <chr> "Provisionnal", "Provisionnal", "Provisio...
#> $ pointsNames          <chr> "Eynatten (BE) // Lichtenbusch / Raeren (...
#> $ lastUpdateDateTime   <dttm> 2020-09-09 15:51:00, 2020-09-09 15:17:00...

Get Interconnection points

glimpse(eg_connectionpoints())
#> Warning: 756 parsing failures.
#> row col   expected     actual         file
#>   1  -- 29 columns 30 columns literal data
#>   2  -- 29 columns 30 columns literal data
#>   3  -- 29 columns 30 columns literal data
#>   4  -- 29 columns 30 columns literal data
#>   5  -- 29 columns 30 columns literal data
#> ... ... .......... .......... ............
#> See problems(...) for more details.
#> Observations: 756
#> Variables: 29
#> $ pointKey               <chr> "DIS-00001", "DIS-00002", "DIS-00005", ...
#> $ pointLabel             <chr> "Distribution (PT)", "Distribution (PL)...
#> $ isSingleOperator       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
#> $ pointTooltip           <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ pointEicCode           <chr> NA, NA, "21Y0000000000581", "21Y0000000...
#> $ controlPointType       <chr> "O_P_INCOUN_IN_DIS", "O_V_INCOUN_IN_DIS...
#> $ tpMapX                 <dbl> -117.42, 40.08, -3.00, 38.14, -77.21, -...
#> $ tpMapY                 <dbl> -51.81, 1.71, -47.50, 4.39, 39.23, 38.3...
#> $ commercialType         <chr> "Distribution Point", "Distribution Poi...
#> $ importFromCountryKey   <chr> "Physical", "Virtual", "Physical", "Phy...
#> $ importFromCountryLabel <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ hasVirtualPoint        <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ virtualPointKey        <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ virtualPointLabel      <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ hasData                <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ isPlanned              <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
#> $ isInterconnection      <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ isImport               <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
#> $ infrastructureKey      <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ infrastructureLabel    <chr> "DIS", "DIS", "DIS", "DIS", "DIS", "DIS...
#> $ isCrossBorder          <chr> "Distribution", "Distribution", "Distri...
#> $ euCrossing             <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ isInvalid              <chr> "EU", "EU", "EU", "EU", "EU", "EU", "EU...
#> $ isMacroPoint           <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ isCAMRelevant          <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ isPipeInPipe           <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ isCMPRelevant          <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ id                     <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ dataSet                <chr> "2DIS-00001", "2DIS-00002", "2DIS-00005...

Here I get the physical flow for Malnow, but you can use this function to get Nomination, Renominations, Allocations, Physical Flows, GCV, Wobbe Index, Capacities and Interruptions.

# Get Malnow flows.

malnow_phys <- eg_op(indicator = "Physical Flow", pointDirection = "DE-TSO-0001ITP-00096entry", from = Sys.Date() - 2, to = Sys.Date() +2, periodType = "hour")
malnow_noms <- eg_op(indicator = "Nomination", pointDirection = "DE-TSO-0001ITP-00096entry", from = Sys.Date() - 2, to = Sys.Date() +2, periodType = "hour")

malnow <- dplyr::bind_rows(malnow_phys, malnow_noms)

glimpse(malnow_phys)
#> Observations: 63
#> Variables: 31
#> $ id                     <chr> "1Physical Flowhour2020-09-07 04:00:00 ...
#> $ dataSet                <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
#> $ indicator              <chr> "Physical Flow", "Physical Flow", "Phys...
#> $ periodType             <chr> "hour", "hour", "hour", "hour", "hour",...
#> $ periodFrom             <dttm> 2020-09-07 06:00:00, 2020-09-07 07:00:...
#> $ periodTo               <dttm> 2020-09-07 07:00:00, 2020-09-07 08:00:...
#> $ operatorKey            <chr> "DE-TSO-0001", "DE-TSO-0001", "DE-TSO-0...
#> $ tsoEicCode             <chr> "21X-DE-H-A0A0A-L", "21X-DE-H-A0A0A-L",...
#> $ operatorLabel          <chr> "GASCADE Gastransport", "GASCADE Gastra...
#> $ pointKey               <chr> "ITP-00096", "ITP-00096", "ITP-00096", ...
#> $ pointLabel             <chr> "Mallnow", "Mallnow", "Mallnow", "Malln...
#> $ tsoItemIdentifier      <chr> "21Z000000000056S", "21Z000000000056S",...
#> $ directionKey           <chr> "entry", "entry", "entry", "entry", "en...
#> $ unit                   <chr> "kWh/h", "kWh/h", "kWh/h", "kWh/h", "kW...
#> $ itemRemarks            <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ generalRemarks         <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ value                  <dbl> 36188963, 36167404, 36133786, 36146788,...
#> $ lastUpdateDateTime     <dttm> 2020-09-08 09:57:00, 2020-09-08 09:57:...
#> $ isUnlimited            <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ flowStatus             <chr> "Confirmed", "Confirmed", "Confirmed", ...
#> $ interruptionType       <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ restorationInformation <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ capacityType           <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ capacityBookingStatus  <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ isCamRelevant          <chr> "1", "1", "1", "1", "1", "1", "1", "1",...
#> $ isNA                   <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ originalPeriodFrom     <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA...
#> $ isCmpRelevant          <chr> "1", "1", "1", "1", "1", "1", "1", "1",...
#> $ bookingPlatformKey     <chr> "PRISMA", "PRISMA", "PRISMA", "PRISMA",...
#> $ bookingPlatformLabel   <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
#> $ bookingPlatformURL     <chr> "https://platform.prisma-capacity.eu/",...

ggplot(malnow, aes(periodFrom, value, col = indicator)) + 
  geom_line() + 
  theme_light()

Note

This if from Entso-G:

โ€ฆ the API is publicly available, there are some restrictions in the use of API to ensure that the limited resources of the ENTSOG TP are shared fairly with all TP users. There is a timeout value on all queries to be 60 seconds. Additional filters should be used such as data ranges, specific points, operators and/or indicators to return a successful result set.

entsog's People

Contributors

krose avatar

Stargazers

 avatar Claus Hesseling avatar Johannes Emmerling avatar Slawomir Matuszak avatar Konstantin Taranov avatar

Watchers

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