- 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.
- 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
- 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