-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Merge main into develop after release (#21) * Release 0.3.0 (#20) * precommit * Fix delete cycle progress key and race condition (#24) * Release 0.3.0 (#20) * precommit * add progress key to delete cycles * Remove deprecated APIs, fix typos (#23) * Update README.rst * update license (#26) * Updates to support 179d, includes creating property, downloading property reports from ESPM, and updating building search(#22) * adding create_building and update_building methods * modify search_buildings to provide appropriate cycle id * adding client methods for creating extra data columns * add pass throughs for file downloads * updates for audit template workflow * method to download property xlsx --------- Co-authored-by: Alex Swindler <[email protected]> Co-authored-by: Nicholas Long <[email protected]> Co-authored-by: Nicholas Long <[email protected]> * prep release * increase timeout for server start * increase timeout for server start (#31) * cleanup before release (#32) * configure seed to load small EEEJ dataset for integration test (#33) --------- Co-authored-by: Nicholas Long <[email protected]> Co-authored-by: Alex Swindler <[email protected]> Co-authored-by: Nicholas Long <[email protected]>
- Loading branch information
1 parent
7f0cef9
commit bcb3d89
Showing
20 changed files
with
689 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,9 +45,19 @@ jobs: | |
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements-test.txt | ||
- name: Build and run stack | ||
- name: Install more recent docker compose | ||
uses: ndeloof/[email protected] | ||
with: | ||
version: v2.20.0 | ||
legacy: true | ||
- name: Print versions | ||
run: | | ||
printenv | ||
docker --version | ||
docker-compose --version | ||
which docker-compose | ||
- name: Build and run stack | ||
run: | | ||
docker volume create --name=pyseed_media | ||
# verify that the stack wasn't cached | ||
docker-compose -f tests/integration/docker-compose.yml stop | ||
|
@@ -56,22 +66,27 @@ jobs: | |
- name: Wait for web server | ||
uses: nev7n/wait_for_response@v1 | ||
with: | ||
# Increase the timeout significanlty, the EEEJ census tract | ||
# migration take ~6 minutes to run along. | ||
url: "http://localhost:8000/" | ||
responseCode: 200 | ||
timeout: 120000 | ||
interval: 2000 | ||
timeout: 640000 | ||
interval: 5000 | ||
- name: Wait another 30s | ||
uses: jakejarvis/wait-action@master | ||
with: | ||
time: "30s" | ||
- name: Dump docker logs before tests | ||
uses: jwalton/gh-docker-logs@v1 | ||
uses: jwalton/gh-docker-logs@v2 | ||
- name: Extract API credentials from SEED docker instance | ||
run: | | ||
docker exec seed_web ./manage.py create_test_user_json --username [email protected] --host http://localhost:8000 --pyseed > seed-config.json | ||
docker exec pyseed_web ./manage.py create_test_user_json --username [email protected] --host http://localhost:8000 --pyseed > seed-config.json | ||
- name: Run tests with pytest | ||
env: | ||
SEED_PM_UN: ${{ secrets.SEED_PM_UN }} | ||
SEED_PM_PW: ${{ secrets.SEED_PM_PW }} | ||
run: | | ||
pytest -m "integration" -s | ||
- name: Dump docker logs on failure | ||
if: failure() | ||
uses: jwalton/gh-docker-logs@v1 | ||
uses: jwalton/gh-docker-logs@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,23 @@ Py-SEED | |
|
||
A python API client for the SEED Platform. This is an updated version of the Client. It is compatible with the latest version of the SEED Platform (>2.17.4). This client still has access to the previous format of generating a lower level API client by accessing `seed_client_base.SEEDOAuthReadOnlyClient`, `seed_client_base.SEEDOAuthReadWriteClient`, `seed_client_base.SEEDReadOnlyClient`, and `seed_client_base.SEEDReadWriteClient`. This lower level API is documented below under the `Low-Level Documentation` | ||
|
||
Stakeholders | ||
------------- | ||
|
||
The following list of stakeholders should be considered when making changes to this module | ||
|
||
- 179D Tax Deduction Web Application | ||
- Earth Advantage Green Building Registry | ||
- User scripts for managing building data | ||
- ECAM | ||
|
||
Documentation | ||
------------- | ||
The SEED client is a read-write client. To install the client run: | ||
|
||
.. code-block:: bash | ||
pip install pyseed | ||
pip install py-seed | ||
Within Python you can use the client like this: | ||
|
||
|
@@ -24,7 +34,7 @@ Within Python you can use the client like this: | |
from pathlib import Path | ||
from pyseed.seed_client import SeedClient | ||
# The seed-config.json file defines the hosting locaiton and credentials for your SEED instance. | ||
# 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 [email protected] --host http://localhost:8000 --file ./seed-config.json --pyseed | ||
|
@@ -97,11 +107,22 @@ Usage: | |
# get a single property | ||
seed_client.get(property_pk, endpoint='properties') | ||
Local Testing | ||
------------- | ||
|
||
Tests can be run via the `pytest` command. | ||
|
||
You will need to export environment variables for a test portfolio manager account to test integration. Environment variables should be named: | ||
|
||
..code-block:: bash | ||
|
||
SEED_PM_UN | ||
SEED_PM_PW | ||
|
||
|
||
License | ||
------- | ||
py-SEED is released under the terms of the MIT license. Full details in LICENSE file. | ||
Full details in LICENSE file. | ||
|
||
Changelog | ||
--------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"version": "0.2", | ||
"ignorePaths": [], | ||
"dictionaryDefinitions": [], | ||
"dictionaries": [], | ||
"words": [ | ||
"apibase", | ||
"buildingsync", | ||
"codeauthor", | ||
"dname", | ||
"durl", | ||
"ECAM", | ||
"ESPM", | ||
"excpt", | ||
"geocoded", | ||
"greenbuildingregistry", | ||
"JSONAPI", | ||
"Munday", | ||
"officedocument", | ||
"openxmlformats", | ||
"pyseed", | ||
"pytest", | ||
"sdist", | ||
"SEEDO", | ||
"seedrecords", | ||
"spreadsheetml", | ||
"subclassing", | ||
"taxlot", | ||
"taxlots" | ||
], | ||
"ignoreWords": [], | ||
"import": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
copyright (c) 2016 Earth Advantage. All rights reserved. | ||
..codeauthor::Paul Munday <[email protected]> | ||
Functionality for calls to external API's""" | ||
Functionality for calls to external APIs""" | ||
|
||
# Imports from Third Party Modules | ||
import re | ||
|
@@ -47,24 +47,24 @@ def __init__(self, url=None, use_ssl=True, timeout=None, use_json=False, | |
# pylint: disable=too-many-arguments | ||
"""Set url,api key, auth usage, ssl usage, timeout etc. | ||
:param url: url to use, http(s)://can be omitted, an error will | ||
will be used if it is supplied and dose not match use_ssl | ||
:param: use_ssl: connect over https, defaults to true | ||
:param url: url to use, http(s):// can be omitted, an error will | ||
be used if it is supplied and does not match `use_ssl` | ||
:param: use_ssl: connect over https, defaults to True | ||
:param use_auth: use authentication | ||
..Note: | ||
if use_auth is True the default is to use http basic | ||
If `use_auth` is True the default is to use http basic | ||
authentication if self.auth is not set. (You will need to | ||
to this by overriding __init__ and setting this before | ||
do this by overriding __init__ and setting this before | ||
calling super. | ||
This requires username and password to be supplied as | ||
keyword arguments. N.B. api keys using basic auth e.g. SEED | ||
keyword arguments. N.B. api keys using basic auth e.g., SEED | ||
should be supplied as password. | ||
To use Digest Authentication set auth_method='digest' | ||
If use_ssl is False and the url you supply starts with https | ||
If `use_ssl` is False and the url you supply starts with https | ||
an error will be thrown. | ||
""" | ||
self.timeout = timeout | ||
|
@@ -80,7 +80,7 @@ def __init__(self, url=None, use_ssl=True, timeout=None, use_json=False, | |
def _construct_payload(self, params): | ||
"""Construct parameters for an api call. | ||
. | ||
:param params: An dictionary of key-value pairs to include | ||
:param params: A dictionary of key-value pairs to include | ||
in the request. | ||
:return: A dictionary of k-v pairs to send to the server | ||
in the request. | ||
|
@@ -319,7 +319,7 @@ def _get_auth(self): | |
def _construct_payload(self, params): | ||
"""Construct parameters for an api call. | ||
. | ||
:param params: An dictionary of key-value pairs to include | ||
:param params: A dictionary of key-value pairs to include | ||
in the request. | ||
:return: A dictionary of k-v pairs to send to the server | ||
in the request. | ||
|
@@ -355,8 +355,8 @@ def _get_access_token(self): | |
|
||
def _construct_payload(self, params): | ||
"""Construct parameters for an api call. | ||
. | ||
:param params: An dictionary of key-value pairs to include | ||
:param params: A dictionary of key-value pairs to include | ||
in the request. | ||
:return: A dictionary of k-v pairs to send to the server | ||
in the request. | ||
|
Oops, something went wrong.