AlexGustafsson / kraftringen-exporter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kraftringen Exporter

Export metrics from Kraftringen's portal


Setting up

Quickstart

Run the login command and point it to a file you'd like to save your cookies to.

python3 -m main -- login > cookies.txt

Scan the QR code printed in the terminal with your Mobile BankID app.

█▀▀▀▀▀█   ▀█▀█▄▄▀  ▀█ █▀▀▀▀▀█
█ ███ █ █▀██▄▄█▄▀▄▄█▀ █ ███ █
█ ▀▀▀ █ █▄ █ ▄▀▄▀▄▀▀█ █ ▀▀▀ █
▀▀▀▀▀▀▀ █ █▄▀ ▀▄▀ ▀ ▀ ▀▀▀▀▀▀▀
▀▄█▀██▀ ▄▀▄█ ▄ ▀ ▀ ██ ███▀▀ ▄
▀█ ▄ ▀▀█ █▄▄▄█▀▀█▀█  ▄  █▀▀  
█▄▀▀  ▀▀█ █▀▄ ▀▀▄▀▄▄ ▄▄ ▄ ▀██
▄▄ ▄▄▀▀ █▄▀▀▄ ▄▀▄   ▄█▀▄█▄ ▄ 
█▀  ▀▄▀ ▄ ▄ ▄▄▄ ▄▀██▄▄▄█▄ ███
█ █▀▄▄▀▄▄▀ ▀▄█▀█▀ █▄   █ █ ▄ 
▀  ▀ ▀▀ ▄██▄█ ▀ ▄█▄▄█▀▀▀█▀▀ ▄
█▀▀▀▀▀█ ▄  ▀▀ ▄▀▀ ▄██ ▀ █▀▀▄▄
█ ███ █ ███ ▄ ▄ ▄█▄▄▀█▀▀▀ ▀▄▄
█ ▀▀▀ █ ▀█ ▀▀▀ ▀█▀ █▄█▀▀▀▄ █ 
▀▀▀▀▀▀▀ ▀ ▀  ▀▀  ▀ ▀ ▀ ▀  ▀  

Use the cookies to curl further, authorized resources.

curl -b cookies.txt "https://mittkraftringen.kraftringen.se/api/resources/consumption.aspx/specific/Page_Title/"

Documentation

For now, refer to the source.

Contributing

Any contribution is welcome. If you're not able to code it yourself, perhaps someone else is - so post an issue if there's anything on your mind.

Development

Clone the repository:

git clone https://github.com/AlexGustafsson/kraftringen-exporter

Setup a virtual environment and dependencies:

make setup

Write code and commit it.

Follow the conventions enforced:

make static-analysis

Test the project:

make test

About

License:MIT License


Languages

Language:Python 77.8%Language:Makefile 22.2%