ElexonRCLIfrom SopherApps

Details

  • Name ElexonRCLI
  • Summary A commandline app for getting data from Elexon REST API, processing it and saving it in a PostgreSQL database
  • Price (Monthly) 0 UGX
  • Free FREE forever
  • Category ETL
  • Tags rest elexon bmrs extract
  • Download

Description

ElexonRCLI is a commandline application that can be used to extract historical market and system data of a given message type from data from the UK Electricity Balancing and Settlement Code (BSC) Systems (Elexon), as availed by Elexon's BMRS REST API.

It also saves the data in a PostgreSQL database of the user's choice.

Features

  • FreeIt is free to use forever.
  • CLIA fully-fledged CLI app with a help section
  • XML to DBExtracts the XML data processes it and saves it in a PostgreSQL database of your choice.
  • Automatic UpdatesAt start up, it checks for new updated versions automatically and advises the user to download if there are new versions. It continues to do these checks even when running and alerts the user when new versions are released.
  • ConfigurableAlmost everything about ElexonRCLI can be reconfigured. However, it comes with sensible defaults to get you running quickly.
  • Available for Major OSBinaries for Linux, Windows and MacOS (Darwin) have been provided.

Quick Start

  • Ensure you have already registered with Elexon's BMRS service so as to have an Elexon Scripting key. Learn more
  • Install PostgreSQL if you don't have it already. If you have a Cloud PostgreSQL instance like Amazon RDS, skip.
  • Install dbeaver database client
  • Download the latest version of the app for your operating system and computer architecture. Note: the commonest architecture is AMD64. That's the one you most probably have
Operating System Architecture Download
Windows AMD64 Download
Windows ARM Download
MacOS AMD64 Download
MacOS ARM64 Download
Linux AMD64 Download
Linux ARM64 Download

If you are interested in older versions, go to the download section

  • Open your terminal (command line). (For Ubuntu hit ctrl-alt-T)
  • Enter the directory where downloaded the app.
  • Run the application.

For Linux/MacOS ( Replace the things that have <> with your own values ):

./elexonrcli run \
    --key <Elexon scripting key> \
    --dbhost <PostgresSQL database host> \
    --dbport <PostgresSQL database port> \
    --dbname <PostgresSQL database name> \
    --dbuser <PostgresSQL database user> \
    --service <The BMRS service section you are interested in e.g BOD> 
    --from <The starting date for the data you want e.g. 2021-05-31>
    --to <The end date for the data you want e.g. 2021-05-31>

For Windows ( Replace the things that have <> with your own values ):

elexonrcli.exe run \
    --key <Elexon scripting key> \
    --dbhost <PostgresSQL database host> \
    --dbport <PostgresSQL database port> \
    --dbname <PostgresSQL database name> \
    --dbuser <PostgresSQL database user> \
    --service <The BMRS service section you are interested in e.g BOD> 
    --from <The starting date for the data you want e.g. 2021-05-31>
    --to <The end date for the data you want e.g. 2021-05-31>

Each of those flags have short forms. You can see these short forms from the help menu e.g. instead of --key, one could use -k

  • Open dbeaver.
  • If you have not connected to the database you chose in the command above, create a new PostgreSQL connection to that database using dbeaver. You can follow these instructions.

  • Look for the table within the public schema that has the same name as the 'message type' (not service but type e.g. MELS) you set in the command you ran.

PostgreSQL table list for elexonrcli

  • Double click that table and view the data returned. Do note that some very old data may not be available in Elexon's systems and thus you may need to tweak the from/to dates in order to see any data

sample BOD data as seen in dbeaver

  • To view the help menu instead of running the app, you can run the help command

For Linux/MacOS:

./elexonrcli run --help

For Windows:

elexonrcli.exe run --help
  • Note: When a new update is released, the application will ask you to download the update before it can run. You can choose to refuse however, and it will work as before.
Gotchas
  • Do note that this CLI can't be safely run in say systemd because it requires terminal interruction
  • Run it in a screen
 screen -S elexonrcli
elexonrcli run # etc...
  • Then detach them with Ctrl-A-D

Downloads