Skip to main content

Build Status

nrelpy

Simple API to interact with the National Renewable Energy Laboratory's Annual Technology Baseline

Features and Datasets

nrelpy currently enables access to the following datasets:

  • Annual Technology Baseline
    • Transportation (2020)
    • Electricity (2019 - 2022)
  • GIS Renewable Energy Potential (state-level resolution)

Installing

This package may be installed from PyPI with

pip install nrelpy

Using

The motivation for this API is to relieve researchers of the need to carry datasets in their repositories. Therefore, the most basic function of nrelpy returns a dataset as a pandas dataframe. This basic usage is shown below.

ATB

Users can access either the ATB datasets for both transportation and electricity and interact with it as a pandas.DataFrame.

import nrelpy.atb as ATB

year = 2022
database = 'electricity'

df = ATB.as_dataframe(year=year, database=database)

Alternatively, users can import the ATBe class for a simpler interface to the data.

from nrelpy.atb import ATBe

atbe = ATBe(year=2022)

# Downloading NREL ATB electricity from 2022
# Download Successful.

atbe(technology='Nuclear',
     core_metric_parameter='LCOE',
     core_metric_case='R&D',
     scenario='Moderate',
     crpyears='60',
     ).head(5)
Out[3]: 
display_name          Nuclear - AP1000  Nuclear - Small Modular Reactor
core_metric_variable                                                   
2020                         65.987664                        65.665363
2021                         65.748826                        65.408952
2022                         65.520452                        65.163004
2023                         65.302550                        64.927528
2024                         64.205891                        64.681539

Renewable Potential

import nrelpy.re_potential as REP

df = REP.as_dataframe()

Testing

From the top-level nrelpy directory, run pytest.

You can also check the testing coverage with

pytest --cov-config=.coveragerc --cov=nrelpy
coverage html

coverage html creates a nicely formatted html page with the entire coverage report. Simply open the htmlcov/index.html file in your browser.

Contributing

Contributors should clone the repository and install an editable installation.

git clone https://github.com/samgdotson/nrelpy.git

cd nrelpy

pip install -e .

All pull requests must include appropriate, passing, tests.

Issues and feature requests are welcome.

Metadata

Release files for nrelpy 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nrelpy 0.3.2
File Size Uploaded
nrelpy-0.3.2.tar.gz 900.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nrelpy 0.3.2
File Interpreter ABI Platform
nrelpy-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / nrelpy-0.3.2.tar.gz

Download URL nrelpy-0.3.2.tar.gz
Size 900.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6fe6e6af312dbe7cc27fc209a3888f968ba8b4d2b2c207ae3fa1659cfe6ebf22
BLAKE2b-256 checksum
How to use checksums
aa6bca94e0dfdb98290ceb02323b75750848e06388d27dfc633bdda464acd261
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / nrelpy-0.3.2-py3-none-any.whl

Download URL nrelpy-0.3.2-py3-none-any.whl
Size 915.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79327fc5aedc272dcc3e508fea17fdb2afe05b0385b67b9272f93444eee76e1d
BLAKE2b-256 checksum
How to use checksums
5651f7b84b5ae6832d19c7cc17f4686a72787160fbff7f5ead887f7ddb804ef9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.2.1

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page