Skip to content

rewiringamerica/ra-api-rem-py

Repository files navigation

rewiringamerica-rem

An API for REM, the Residential Electrification Model. The other Rewiring America APIs and methodology for REM are here.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.1.0
  • Package version: 0.3.0
  • Generator version: 7.10.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

For more information, please visit https://www.rewiringamerica.org/

Requirements.

Python 3.8+

Installation & Usage

pip install

Run:

pip install rewiringamerica-rem

Then import the package:

import rewiringamerica_rem

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import rewiringamerica_rem

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import rewiringamerica_rem
from rewiringamerica_rem.models.heating_fuel_input import HeatingFuelInput
from rewiringamerica_rem.models.savings import Savings
from rewiringamerica_rem.models.supported_upgrade import SupportedUpgrade
from rewiringamerica_rem.rest import ApiException
from pprint import pprint
import os

# Defining the host is optional and defaults to https://api.rewiringamerica.org
# See configuration.py for a list of all supported configuration parameters.
configuration = rewiringamerica_rem.Configuration(
    host = "https://api.rewiringamerica.org"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: auth
configuration = rewiringamerica_rem.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with rewiringamerica_rem.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = rewiringamerica_rem.ResidentialElectrificationModelApi(api_client)
    upgrade = rewiringamerica_rem.SupportedUpgrade() # SupportedUpgrade | The upgrade whose effects we want to analyze. Supported values are as follows: - `basic_enclosure`: A basic weatherization upgrade for the home   as described in measure package 1 (on page 4) of [this   document](https://oedi-data-lake.s3.amazonaws.com/nrel-pds-building-stock/end-use-load-profiles-for-us-building-stock/2022/EUSS_ResRound1_Technical_Documentation.pdf). - `min_eff_hp_elec_backup`: A relatively-low efficiency heat pump upgrade for the home’s HVAC   system as described in measure package 3 (on page 5) of [this   document](https://oedi-data-lake.s3.amazonaws.com/nrel-pds-building-stock/end-use-load-profiles-for-us-building-stock/2022/EUSS_ResRound1_Technical_Documentation.pdf). - `high_eff_hp_elec_backup`: A high efficiency heat pump upgrade for the home’s HVAC system as   described in measure package 4 (on page 6) of [this   document](https://oedi-data-lake.s3.amazonaws.com/nrel-pds-building-stock/end-use-load-profiles-for-us-building-stock/2022/EUSS_ResRound1_Technical_Documentation.pdf). - `whole_home_electric_max_eff_basic_enclosure`: A whole-home upgrade including a high   efficiency heat pump for the home’s HVAC system, basic weatherization, a heat pump water heater, a heat pump dryer,   and an induction stove as described in measure package 9 (on page 9) of [this   document](https://oedi-data-lake.s3.amazonaws.com/nrel-pds-building-stock/end-use-load-profiles-for-us-building-stock/2022/EUSS_ResRound1_Technical_Documentation.pdf). - `med_eff_hp_hers_sizing_no_setback`: A medium-efficiency heat pump upgrade for   the home's HVAC system. Rewiring America simulated this upgrade using the same tools NREL uses for ResStock. - `med_eff_hp_hers_sizing_no_setback_basic_enclosure`: A custom upgrade based on a   medium-efficiency heat pump and basic weatherization upgrade for the home. Rewiring America simulated this upgrade   using the same tools NREL uses for ResStock. 
    address = 'address_example' # str | The address of the home being upgraded.
    heating_fuel = rewiringamerica_rem.HeatingFuelInput() # HeatingFuelInput | The heating fuel used in the home before the upgrade. Supported values are as follows: - `electricity`: the home was heated with electric heating, such as   baseboard heating, an electric boiler, or an electric furnace. - `natural_gas`: The home was heated with a natural gas furnace. - `fuel_oil`: The home was heated with a fuel oil boiler or furnace. - `propane`:  The home was heated with a propane furnace. 

    try:
        # Get By Address
        api_response = api_instance.get_by_address(upgrade, address, heating_fuel)
        print("The response of ResidentialElectrificationModelApi->get_by_address:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ResidentialElectrificationModelApi->get_by_address: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.rewiringamerica.org

Class Method HTTP request Description
BuildingProfilerApi get_home_profile GET /api/v1/building_profiler/home Get Home Profile
ResidentialElectrificationModelApi get_by_address GET /api/v1/rem/address Get By Address
ResidentialElectrificationModelApi get_by_profile POST /api/v1/rem/profile Get By Profile
ResidentialElectrificationModelApi get_impl_version GET /api/v1/rem/server_version Get Impl Version

Documentation For Models

Documentation For Authorization

Sign up for an API key here.

Authentication schemes defined for the API:

auth

  • Type: Bearer authentication

Author

[email protected]

About

Python client stubs for the REM API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published