Project environment setup

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-07 15:57:22 +01:00
parent 3826b0a647
commit d48a40c64b
9 changed files with 79 additions and 11 deletions

17
.gitignore vendored
View file

@ -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

2
.idea/Model.iml generated
View file

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.11 (hestia-data)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

2
.idea/misc.xml generated
View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (hestia-data)" project-jdk-type="Python SDK" />
</project>

15
epc_data/Property.py Normal file
View file

@ -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
"""

30
epc_data/README.md Normal file
View file

@ -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.

0
epc_data/__init__.py Normal file
View file

View file

@ -0,0 +1 @@
epc-api-python

15
epc_data/temp_inputs.py Normal file
View file

@ -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"
}
]

8
epc_data/tests/app.py Normal file
View file

@ -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