Skip to content

Commit

Permalink
Version 0.4.2 (#40)
Browse files Browse the repository at this point in the history
* 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)

* add analysis retrieve methods (#34)

* Added multiple cycle upload argument (#27)

* Added multiple cycle upload argument

* Responded to comments and fixed failing tests

* Converted to using kwargs

* Pre-commit

* Cleanup README.rst  (#35)

* cleanup readme

* populate description in pypi

* precommit fix

* Endpoint to download an Audit Template Report Submission and store in SEED (#36)

* start of AT report download method

* adding endpoint to download AT report submission and store in SEED

* add analysis retrieve methods (#34)

* Added multiple cycle upload argument (#27)

* Added multiple cycle upload argument

* Responded to comments and fixed failing tests

* Converted to using kwargs

* Pre-commit

* Cleanup README.rst  (#35)

* cleanup readme

* populate description in pypi

* precommit fix

* Endpoint to download an Audit Template Report Submission and store in SEED (#36)

* start of AT report download method

* adding endpoint to download AT report submission and store in SEED

* prep 0.4.1 (#37)

* Update CHANGELOG.rst

* update release instruction

* Update README.rst

* Update README.rst

* add new method to get AT submission metadata (#39)

* Update CHANGELOG.rst

* Update setup.cfg

---------

Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: Alex Swindler <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: Alex Chapin <[email protected]>
  • Loading branch information
5 people authored Jan 18, 2024
1 parent 35b25f0 commit 51c8eec
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

0.4.2
-----
What's Changed
**************

* add new method to get AT submission metadata by @kflemin in https://github.com/SEED-platform/py-seed/pull/39

0.4.1
-----

Expand Down
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
py-SEED
=======
===========


.. image:: https://github.com/seed-platform/py-seed/actions/workflows/ci.yml/badge.svg?branch=develop
:target: https://github.com/seed-platform/py-seed/actions/workflows/ci.yml/badge.svg
Expand Down Expand Up @@ -125,6 +126,7 @@ Full details in LICENSE file.
Releasing
---------

* Configure your PyPi with token access `https://pypi.org/manage/account/token/ <https://pypi.org/manage/account/token/>`_.
* Merge down to main
* Tag release on GitHub and add in the change log
* Release via command line
Expand All @@ -136,4 +138,4 @@ Releasing
pip install twine
# make sure to check the dist package for errors in the RST files
twine check dist/*
twine upload dist/*
twine upload --repository py-seed dist/*
27 changes: 26 additions & 1 deletion pyseed/seed_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,27 @@ def retrieve_at_building_and_update(self, audit_template_building_id: int, cycle

return response

def retrieve_at_submission_metadata(self, audit_template_submission_id: int) -> dict:
"""Connect to audit template and retrieve audit report json (metadata only) by submission ID
Args:
audit_template_submission_id (int): ID of the AT submission report (different than building ID)
Returns:
dict: Response from the SEED API
"""

# api/v3/audit_template/pk/get_submission
response = self.client.get(
None,
required_pk=False,
endpoint="audit_template_submission",
url_args={"PK": audit_template_submission_id},
report_format='json'
)

return response

def retrieve_at_submission_and_update(self, audit_template_submission_id: int, cycle_id: int, seed_id: int, report_format: str = 'pdf', filename: str = None) -> dict:
"""Connect to audit template and retrieve audit report by submission ID
Expand All @@ -1444,6 +1465,7 @@ def retrieve_at_submission_and_update(self, audit_template_submission_id: int, c

# api/v3/audit_template/pk/get_submission
# accepts pdf or xml

response = self.client.get(
None,
required_pk=False,
Expand All @@ -1454,6 +1476,8 @@ def retrieve_at_submission_and_update(self, audit_template_submission_id: int, c

if response['status'] == 'success':
if report_format.lower() == 'pdf':

# for PDF, store pdf report as inventory document
pdf_file = response['content']
if not filename:
filename = 'at_submission_report_' + str(audit_template_submission_id) + '.pdf'
Expand All @@ -1470,7 +1494,8 @@ def retrieve_at_submission_and_update(self, audit_template_submission_id: int, c
)
response2['pdf_report'] = pdf_file
else:
# assume XML

# assume XML. for XML, update property with BuildingSync
# now post to api/v3/properties/PK/update_with_buildingsync
xml_file = response['content']
if not filename:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name=py-seed
version=0.4.1
version=0.4.2
description=A Python API client for the SEED Platform
author=Nicholas Long, Katherine Fleming, Fable Turas, Paul Munday
author_email[email protected], [email protected], [email protected]
Expand Down

0 comments on commit 51c8eec

Please sign in to comment.