diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e176832b..4d898973 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -31,3 +31,7 @@ RUN pip install -r requirements.txt # 5) Workdir WORKDIR /workspaces/model + +# 6) Make Python find your package +# Add project root to PYTHONPATH for all processes +ENV PYTHONPATH=/workspaces/model:${PYTHONPATH} diff --git a/asset_list/__init__.py b/asset_list/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/asset_list/app.py b/asset_list/app.py index 3aaa3462..8cb9481d 100644 --- a/asset_list/app.py +++ b/asset_list/app.py @@ -15,8 +15,6 @@ from backend.SearchEpc import SearchEpc load_dotenv(dotenv_path="backend/.env") EPC_AUTH_TOKEN = os.getenv("EPC_AUTH_TOKEN") -print("hello world") - def extract_address1(asset_list, full_address_col, postcode_col, method="first_two_words"): if method == "first_two_words": @@ -59,26 +57,25 @@ def app(): EPC recommendations Property UPRN """ - - # Lambeth - data_folder = "/Users/khalimconn-kowlessar/Documents/hestia/Customers/Lambeth" - data_filename = "LAMBETH Asset List ( Incomplete).xlsx" - sheet_name = "Green properties" - postcode_column = 'SX3 Postcode' - address1_column = "SX3 Short Address" + # Adhoc script for Nick Sout + data_folder = "../../home/Downloads" + data_filename = "nick.xlsx" + sheet_name = "not_on_SAL" + postcode_column = 'Postcode' + address1_column = "Address 1" address1_method = None fulladdress_column = None - address_cols_to_concat = ["SX3 Short Address"] + address_cols_to_concat = ["Address 1"] missing_postcodes_method = None landlord_year_built = None landlord_os_uprn = None - landlord_property_type = "Property Type" + landlord_property_type = None landlord_built_form = None landlord_wall_construction = None landlord_roof_construction = None landlord_heating_system = None landlord_existing_pv = None - landlord_property_id = "row_id" + landlord_property_id = "Property Sequence Number" landlord_sap = None outcomes_filename = None outcomes_sheetname = None @@ -94,6 +91,40 @@ def app(): asset_list_header = 0 landlord_block_reference = None + # # Lambeth + # data_folder = "/Users/khalimconn-kowlessar/Documents/hestia/Customers/Lambeth" + # data_filename = "LAMBETH Asset List ( Incomplete).xlsx" + # sheet_name = "Green properties" + # postcode_column = 'SX3 Postcode' + # address1_column = "SX3 Short Address" + # address1_method = None + # fulladdress_column = None + # address_cols_to_concat = ["SX3 Short Address"] + # missing_postcodes_method = None + # landlord_year_built = None + # landlord_os_uprn = None + # landlord_property_type = "Property Type" + # landlord_built_form = None + # landlord_wall_construction = None + # landlord_roof_construction = None + # landlord_heating_system = None + # landlord_existing_pv = None + # landlord_property_id = "row_id" + # landlord_sap = None + # outcomes_filename = None + # outcomes_sheetname = None + # outcomes_postcode = None + # outcomes_houseno = None + # outcomes_id = None + # outcomes_address = None + # master_filepaths = [] + # master_id_colnames = [] + # master_to_asset_list_filepath = None + # phase = False + # ecosurv_landlords = None + # asset_list_header = 0 + # landlord_block_reference = None + # # Colchester # data_folder = "/Users/khalimconn-kowlessar/Documents/hestia/Customers/Colchester/Aug2025 202 inspections" # data_filename = "Colchester Borough Homes - Inspections - Additional 202 Addresses JW 280725 copy.xlsx" @@ -163,38 +194,38 @@ def app(): # landlord_block_reference = None # Freebridge - data_folder = "/Users/khalimconn-kowlessar/Documents/hestia/Customers/Freebridge/Aug2025 programme" - data_filename = "Domna - FCH property data May 25 copy.xlsx" - sheet_name = "EPC Data" - postcode_column = 'Post Code' - address1_column = "Address 1" - address1_method = None - fulladdress_column = None - address_cols_to_concat = ["Address 1", "Address 4"] - missing_postcodes_method = None - landlord_year_built = "Build Date" - landlord_os_uprn = None - landlord_property_type = "Property Type" - landlord_built_form = None - landlord_wall_construction = "Walls Description" - landlord_heating_system = "Heating Type" - landlord_existing_pv = None - landlord_property_id = "Place Ref" - landlord_roof_construction = "Roof Description" - landlord_sap = "Current SAP" - outcomes_filename = [] - outcomes_sheetname = [] - outcomes_postcode = [] - outcomes_houseno = [] - outcomes_address = [] - outcomes_id = [] - master_filepaths = [] - master_to_asset_list_filepath = None - asset_list_header = 0 - landlord_block_reference = None - master_id_colnames = [] - phase = False # Inspections not complete, produce a partial view - ecosurv_landlords = None + # data_folder = "/Users/khalimconn-kowlessar/Documents/hestia/Customers/Freebridge/Aug2025 programme" + # data_filename = "Domna - FCH property data May 25 copy.xlsx" + # sheet_name = "EPC Data" + # postcode_column = 'Post Code' + # address1_column = "Address 1" + # address1_method = None + # fulladdress_column = None + # address_cols_to_concat = ["Address 1", "Address 4"] + # missing_postcodes_method = None + # landlord_year_built = "Build Date" + # landlord_os_uprn = None + # landlord_property_type = "Property Type" + # landlord_built_form = None + # landlord_wall_construction = "Walls Description" + # landlord_heating_system = "Heating Type" + # landlord_existing_pv = None + # landlord_property_id = "Place Ref" + # landlord_roof_construction = "Roof Description" + # landlord_sap = "Current SAP" + # outcomes_filename = [] + # outcomes_sheetname = [] + # outcomes_postcode = [] + # outcomes_houseno = [] + # outcomes_address = [] + # outcomes_id = [] + # master_filepaths = [] + # master_to_asset_list_filepath = None + # asset_list_header = 0 + # landlord_block_reference = None + # master_id_colnames = [] + # phase = False # Inspections not complete, produce a partial view + # ecosurv_landlords = None # data_folder = "/Users/khalimconn-kowlessar/Documents/hestia/Customers/Broadlands" # data_filename = "Broadlands Asset List.xlsx" @@ -1327,3 +1358,4 @@ def app(): if not asset_list.geographical_areas.empty: asset_list.geographical_areas.to_excel(writer, sheet_name="Geographical Areas", index=False) + print("done") diff --git a/asset_list/requirements.txt b/asset_list/requirements.txt index b68706be..547e6ff0 100644 --- a/asset_list/requirements.txt +++ b/asset_list/requirements.txt @@ -12,4 +12,4 @@ msgpack beautifulsoup4 pydantic>=1.10.7 typing-extensions>=4.5.0 -requests>=2.28.2 +requests>=2.28.2 \ No newline at end of file