From d48a40c64b683104ea269839dc57b27b0cda1327 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 7 Jun 2023 15:57:22 +0100 Subject: [PATCH] Project environment setup --- .gitignore | 17 ++++++++--------- .idea/Model.iml | 2 +- .idea/misc.xml | 2 +- epc_data/Property.py | 15 +++++++++++++++ epc_data/README.md | 30 ++++++++++++++++++++++++++++++ epc_data/__init__.py | 0 epc_data/requirements.txt | 1 + epc_data/temp_inputs.py | 15 +++++++++++++++ epc_data/tests/app.py | 8 ++++++++ 9 files changed, 79 insertions(+), 11 deletions(-) create mode 100644 epc_data/Property.py create mode 100644 epc_data/README.md create mode 100644 epc_data/__init__.py create mode 100644 epc_data/temp_inputs.py create mode 100644 epc_data/tests/app.py diff --git a/.gitignore b/.gitignore index bac04883..947e0397 100644 --- a/.gitignore +++ b/.gitignore @@ -192,14 +192,14 @@ cython_debug/ # When using Gradle or Maven with auto-import, you should exclude module files, # since they will be recreated, and may cause churn. Uncomment if using # auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr +.idea/artifacts +.idea/compiler.xml +.idea/jarRepositories.xml +.idea/modules.xml +.idea/*.iml +.idea/modules +*.iml +*.ipr # CMake cmake-build-*/ @@ -237,4 +237,3 @@ fabric.properties # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser - diff --git a/.idea/Model.iml b/.idea/Model.iml index d0876a78..c66b4576 100644 --- a/.idea/Model.iml +++ b/.idea/Model.iml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index d56657ad..46ea892f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/epc_data/Property.py b/epc_data/Property.py new file mode 100644 index 00000000..656bb0ec --- /dev/null +++ b/epc_data/Property.py @@ -0,0 +1,15 @@ +class Property: + + def __init__(self, postcode, address1, data=None): + self.postcode = postcode + self.address1 = address1 + self.data = data + + def search_address_epc(self): + """ + This method searches for an address in the EPC database and returns the first result + :return: property data + """ + + + diff --git a/epc_data/README.md b/epc_data/README.md new file mode 100644 index 00000000..46804b21 --- /dev/null +++ b/epc_data/README.md @@ -0,0 +1,30 @@ +# Environment setup + +We're using conda to manage environments to circumvent the +issues with Mac M1. This documentation will also cover Pycharm setup. + +We're working in python 3.11 so + +```commandline +conda create -n hestia-data python=3.11 +``` + +Then activate the environment + +```commandline +conda activate hestia-data +``` + +To set up with Pycharm, run + +```commandline +which python +``` + +and grab the path to the python executable. Then in Pycharm, go to +Settings > Project > Python Interpreter and click the gear icon +to add a new interpreter. Select Conda and either paste the path to the python executable +and click OK, or select the conda environment from the dropdown. + +You may need to restart Pycharm for the new interpreter to be recognised. + diff --git a/epc_data/__init__.py b/epc_data/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/epc_data/requirements.txt b/epc_data/requirements.txt index e69de29b..aba57da7 100644 --- a/epc_data/requirements.txt +++ b/epc_data/requirements.txt @@ -0,0 +1 @@ +epc-api-python \ No newline at end of file diff --git a/epc_data/temp_inputs.py b/epc_data/temp_inputs.py new file mode 100644 index 00000000..0b8b66a1 --- /dev/null +++ b/epc_data/temp_inputs.py @@ -0,0 +1,15 @@ +# Temporary input data +input_data = [ + { + "address1": "28 Distillery Wharf", + "postcode": "w6 9bf" + }, + { + "address1": "23 Bulter House", + "postcode": "e2 0pn" + }, + { + "address1": "Flat 14 Godley V C House", + "postcode": "E2 0LP" + } +] diff --git a/epc_data/tests/app.py b/epc_data/tests/app.py new file mode 100644 index 00000000..4c3658a3 --- /dev/null +++ b/epc_data/tests/app.py @@ -0,0 +1,8 @@ +from epc_data.temp_inputs import input_data + + +def handler(): + + # To begin with, the input data is a list of dictionaries, however we would read this file in + +