A tool to download and parse historical BPA transmission data
Project description
Bpa Fetch
A tool to fetch and parse historical Balancing Authority (power generation) data published by the Bonneville Power Administration (BPA). Data is provided in 5 minute increments as far back as 2007 and the full set can be found here (under item 5).
Output Columns
The following columns are in the output data, all power numbers are in megawatts. Note that the available columns has changed over time so what columns are present will depend on what years you've pulled.
time- UTC timestamp for the data. [Always Available]load- Load in BPA area. Note that BPA provides power to other Transmission Authorities so load will likely not be equal to the sum of generation. [Always Available]nuclear_generation- Generation from nuclear sources. [Available 2017 Onwards]hydro_generation- Generation from hydroelectric sources. [Always Available]wind_generation- Generation from wind farms. [Always Available]fossil_generation- Generation from fossil fuel and biomass sources. [Available 2017 Onwards]solar_generation- Generation from commercial solar farms. [Available 2022 Onwards]thermal_generation- Generation from thermal sources including fossil fuels and nuclear. [Available Until 2017]wind_forecast- Forecasted output provided by operators. [Available 2018 Onward]wind_basepoint- Sum of dispatches when BPA is participating in the EIM, otherwise operator forecasts. [Available 2022 Onward]solar_forecast- Forecasted output provided by operators. [Available 2022 Onward]solar_basepoint- Sum of dispatches when BPA is participating in the EIM, otherwise operator forecasts. [Available 2022 Onward]year- Year the data is for. [Always Available]
NOTE: For wind farms with output split between Transmission Authorities, only the portion sent to BPA is reported.
Installation
This tool is distributed through PyPi and can be installed using pip install bpa_fetch
Usage
bpa-fetch [DATES ...] -r -o file.format -f format
This is meant to be a primarily command line tool, and provides the command bpa-fetch for users when installed.
It is also possible to execute directly with python by calling python -m bpa_fetch which takes the same arguments as described below.
The follow arguments are available:
DATES: A list of space seperated years to pull (ig:2010 2013 2020). If no dates are provided, all years will be pulled.--out -o: The file to save pulled data to. If not specified,out-{timestamp}.[format]will be used.--range -r: If this flag is used, two years will be expected forDATESand all years betweenDATE 1andDATE 2will be pulled (inclusive).--format -f: The format of the saved data, options areParquet1 andPandas. When using pandas, the default file extension is.pkl.gzunless set using-o. Defaults toPARQUET
1 - Parquet is a file format developed by the Apache Software Foundation for data analysis workloads and provides small file sizes and fast, efficient queries. To view and work with Parquet, tools like Tad and DuckDB can be used.
Examples
- To pull all years and save as the default filename and format:
bpa-fetch - To pull all years between 2010 & 2016 and save as pandas to the default filename:
bpa-fetch 2010 2016 -r -f pandas - To pull years 2012, 2015, and 2016 and save as a parquet to
output/year-data.parquet:bpa-fetch 2012 2015 2016 -o "output/year-data.parquet" - To pull only 2017:
bpa-fetch 2017
User Functions
The function bpa_fetch.pull_years is also available and returns a pandas Dataframe of the pulled data.
It takes two arguments:
yearsis a list of years (asints) to pull, ifNonethan all years will be pulled.working_diris apathlib.Pathobject pointing to the directory to use during execution. Defaults to./bpa_data
Caching
To speed up execution and reduce network traffic, rudimentary caching system is used that saves the BPA files to disk at working_dir on first run and then only downloads the current year going forwards.
This implementation has some potential issues including failing to pull updated data if run in the new year, leaving the previous year missing data. Improvements to this system are in development
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bpa_fetch-1.0.1.tar.gz.
File metadata
- Download URL: bpa_fetch-1.0.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
226b96a75b2569dc18ea137dd9d49a94e3ad8a3e09fee9fa9b407162ddc637d6
|
|
| MD5 |
05ec8038020a83de1197dae5189d4fee
|
|
| BLAKE2b-256 |
a74763e28dd3872c9dd43c349111a947003fa7f43a51110113042e60957f8cd2
|
File details
Details for the file bpa_fetch-1.0.1-py3-none-any.whl.
File metadata
- Download URL: bpa_fetch-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce9f92f118dbc350f0f81fa339fa94488247ff4a262fd5dd018926c628364174
|
|
| MD5 |
688082d5707aea0e6081dd1354bda8a7
|
|
| BLAKE2b-256 |
d3174ae324823f92599e5a1e2b28bcd0f9908bbc197752d8edd7e648709930da
|