mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
started setting up asset list and gathering council tax bands
This commit is contained in:
parent
50cb58670d
commit
cf7627a8d7
1 changed files with 44 additions and 0 deletions
44
etl/customers/immo/pilot/asset_list.py
Normal file
44
etl/customers/immo/pilot/asset_list.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import os
|
||||
|
||||
import pandas as pd
|
||||
from tqdm import tqdm
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from utils.s3 import read_excel_from_s3
|
||||
from backend.SearchEpc import SearchEpc
|
||||
from epc_api.client import EpcClient
|
||||
from utils.s3 import save_csv_to_s3
|
||||
|
||||
# Read in the .env file in backend
|
||||
load_dotenv(dotenv_path="backend/.env")
|
||||
EPC_AUTH_TOKEN = os.getenv("EPC_AUTH_TOKEN")
|
||||
|
||||
USER_ID = 8
|
||||
PORTFOLIO_ID = 70
|
||||
|
||||
council_tax_bands = [
|
||||
{'address': '8 Corporation Road', 'postcode': 'DY2 7PX', 'band': 'A'},
|
||||
{'address': '21 Wells Road', 'postcode': 'DY5 3TB', 'band': 'A'},
|
||||
{'address': '27 Milton Road', 'postcode': 'WV14 8HZ', 'band': 'A'},
|
||||
{'address': '195 Ashenhurst Road', 'postcode': 'DY1 2JB', 'band': 'A'},
|
||||
{'address': '53 Bromley', 'postcode': 'DY5 4PJ', 'band': 'A'},
|
||||
{'address': '91 Osprey Drive', 'postcode': 'DY1 2JS', 'band': 'B'},
|
||||
{'address': '47 Fairfield Road', 'postcode': 'DY8 5UJ', 'band': 'B'},
|
||||
{'address': '150 Huntingtree Road', 'postcode': 'B63 4HP', 'band': 'C'},
|
||||
{'address': '6 Beech Road', 'postcode': 'DY1 4BP', 'band': 'A'},
|
||||
{'address': '5 Oaklands', 'postcode': 'B62 0JA', 'band': 'A'},
|
||||
]
|
||||
|
||||
|
||||
def app():
|
||||
raw_asset_list = read_excel_from_s3(
|
||||
bucket_name="retrofit-datalake-dev",
|
||||
file_key="customers/Immo/IMMO Sample Assets_Dudley.xlsx",
|
||||
header_row=0
|
||||
)
|
||||
raw_asset_list = raw_asset_list.drop(columns=["Unnamed: 0"])
|
||||
# Extract address and postcode
|
||||
raw_asset_list["address"] = raw_asset_list["Full Address"].str.split(",").str[0]
|
||||
raw_asset_list["postcode"] = raw_asset_list["Full Address"].str.split(",").str[-1].str.strip()
|
||||
|
||||
raw_asset_list[["address", "postcode"]].to_dict("records")
|
||||
Loading…
Add table
Reference in a new issue