Package: py-SEED
py-SEED serves as a Python client for the SEED Platform API. This library is purpose-built for Python applications, enabling interaction with the SEED Platform API to access property lists, create properties, establish connections, and retrieve data from ENERGY STAR(R) Portfolio Manager, BETTER, and other sources. The SEED Platform has a robust API, granting users access to every front-end feature seamlessly via the API. Currently, this library exposes the most commonly used SEED API endpoints and will undergo continuous updates tailored to the community’s evolving needs. py-SEED offers two interaction levels: a high-level API providing familiar endpoints for easy connectivity to SEED’s API, and a low-level API that allows read-write access to any SEED API, demanding a deeper understanding of the SEED API architecturepy-SEED is compatible with the latest version of the SEED Platform (>2.17.4) and only support SEED API Version 3.More information can be found here:https://seed-platform.orghttps://energy.gov/eere/buildings/standard-energy-efficiency-data-platformhttps://github.com/SEED-platformhttps://buildingdata.energy.gov/#/seedhttps://github.com/SEED-platform/pyseed-examplesStakeholdersThe following list of stakeholders should be considered when making changes to this module179D Tax Deduction Web ApplicationEarth Advantage Green Building RegistryUser scripts for managing building dataECAMDocumentationThe SEED client is a read-write client. To install the client run:pipinstallpy-seedWithin Python you can use the client like this:frompathlibimportPathfrompyseed.seed_clientimportSeedClient# The seed-config.json file defines the hosting location and credentials for your SEED instance.# If running SEED locally for testing, then you can run the following from your SEED root directory:#    ./manage.py create_test_user_json --username user@seed-platform.org --host http://localhost:8000 --file ./seed-config.json --pyseedconfig_file=Path('seed-config.json')organization_id=1seed_client=SeedClient(organization_id,connection_config_filepath=config_file)# Get/create the new cycle and upload the data. Make sure to set the cycle ID so that the# data end up in the correct cyclecycle=seed_client.get_or_create_cycle('pyseed-api-test',date(2021,6,1),date(2022,6,1),set_cycle_id=True)seed_client.upload_and_match_datafile('pyseed-properties-test','tests/data/test-seed-data.xlsx','Single Step Column Mappings','tests/data/test-seed-data-mappings.csv')# See the projects unit tests for more examples. https://github.com/SEED-platform/py-seed/blob/develop/tests/test_seed_client.py# Or look at the py-SEED examples repository: https://github.com/SEED-platform/pyseed-examplesLow-Level DocumentationThis client has access to the lower level API client by accessingseed_client_base.SEEDOAuthReadOnlyClient,seed_client_base.SEEDOAuthReadWriteClient,seed_client_base.SEEDReadOnlyClient, andseed_client_base.SEEDReadWriteClient. This provides two user authentication based Python clients and two authentication methods, basic andOAuth2. More information on authentication can be seen in the following py-SEED classes:SEEDOAuthReadOnlyClient
SEEDOAuthReadWriteClient
SEEDReadOnlyClient
SEEDReadWriteClientNote the clients do not provide per api-call methods, but does provide the standard CRUD methods: get, list, put, post, patch, delete. The intended use of these clients is to be further subclassed or wrapped in functions to provide the desired functionality. The CRUD methods are provided via mixins so its possible to create a client for example without the ability to delete by subclassing SEEDUserAuthBaseClient, or SEEDOAuthBaseClient, and adding only the mixins that provided the Create, Read and Update capabilities. Basic usage for the provided low-level clients is as follows:frompyseedimportSEEDReadWriteClientseed_client=SEEDReadWriteClient(your_org_id,username=your_username,password=your_password,base_url=url_of_your_seed_host,)# list all propertiesseed_client.list(endpoint='properties')# get a single propertyseed_client.get(property_pk,endpoint='properties')TestingTests can be run via thepytestcommand.You will need to export environment variables for a test portfolio manager account to test integration. Environment variables should be named:..code-block:: bashSEED_PM_UN
SEED_PM_PWSEED PlatformSEED (Standard Energy Efficiency Data Platform™) is an open source “web-based application that helps organizations easily manage data on the energy performance of large groups of buildings” funded by the United States Department of Energy.LicenseFull details in LICENSE file.ReleasingConfigure your PyPi with token accesshttps://pypi.org/manage/account/token/.Merge down to mainTag release on GitHub and add in the change logRelease via command linerm-rfdistpythonsetup.pysdistpipinstalltwine# make sure to check the dist package for errors in the RST filestwinecheckdist/*twineupload--repositorypy-seeddist/*