Skip to content

Temp repo to show new REM Python client stubs as I work through automation

Notifications You must be signed in to change notification settings

rewiringamerica/ra-api-rem-py-test

Repository files navigation

rewiringamerica-rem

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

Rewiring America's other APIs can be found at our main API site.

Example code demonstrating how to use the APIs can be found in the api_demos Github repo.

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

  • API version: 0.1.0
  • Package version: 0.3.4
  • Generator version: 7.11.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

You can install using:

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

Sign up for an API key and follow the installation procedure. Then, run the following:

import rewiringamerica_rem
from rewiringamerica_rem.rest import ApiException
from pprint import pprint
import os


# 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.BuildingProfilerApi(api_client)
    address = 'address_example' # str | The location of a home.

    try:
        # Get Home Profile
        api_response = api_instance.get_home_profile(address)
        print("The response of get_home_profile:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling get_home_profile: %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

Temp repo to show new REM Python client stubs as I work through automation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published