https://github.com/garybake/power_usage
download power usage data
https://github.com/garybake/power_usage
Last synced: 3 months ago
JSON representation
download power usage data
- Host: GitHub
- URL: https://github.com/garybake/power_usage
- Owner: garybake
- License: mit
- Created: 2022-12-18T22:33:41.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T06:40:22.000Z (about 2 years ago)
- Last Synced: 2024-12-06T20:38:23.053Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Small script to download energy usage data using the octopus energy api.
API docs
https://developer.octopus.energy/docs/api/
Dashboard
https://octopus.energy/dashboard/developer/
Use the dashboard to obtain api keys.
Create a .env file and populate as in the example below with your own values
DB_FILE=logs.db
BASE_URL=https://api.octopus.energy/v1/
API_KEY=***
ELECTRICITY_MPAN=***
ELECTRICITY_SERIAL=***
Outputs a sqlite db with a CONSUMPTION table showing half hourly usage.
To read into a dataframe (for science!)
con = sqlite3.connect(db_file)
df = pd.read_sql_query("SELECT * from CONSUMPTION", con)
con.close()