created basic script to create windows portfolio

This commit is contained in:
Khalim Conn-Kowlessar 2023-12-20 17:06:37 +00:00
parent 654a0715fa
commit c5af2c23bb

View file

@ -0,0 +1,43 @@
"""
This script will create an input csv for the recommendation engine and upload it to S3, which can be used for
testing
"""
import pandas as pd
from utils.s3 import save_csv_to_s3
USER_ID = 8
PORTFOLIO_ID = 56
def app():
"""
This portfolio is for testing windows recommendations
:return:
"""
test_file = pd.DataFrame(
[
{"address": "3 Church Terrace", "postcode": "LE13 0PW", "Notes": None},
{"address": "3, Main Street, Redmile", "postcode": "NG13 0GA", "Notes": None},
{"address": "The Hollies Farm House, Church Walk, Little Dalby", "postcode": "LE14 2UQ", "Notes": None},
{"address": "13 Main Street", "postcode": "LE14 2JU", "Notes": None},
{"address": "8 The Crescent, Coston Road, Buckminster", "postcode": "NG33 5SF", "Notes": None},
]
)
# Store the data in s3
filename = f"{USER_ID}/{PORTFOLIO_ID}/windows_portfolio_inputs.csv"
save_csv_to_s3(
dataframe=test_file,
bucket_name="retrofit-plan-inputs-dev",
file_name=filename
)
body = {
"portfolio_id": str(PORTFOLIO_ID),
"housing_type": "Social",
"goal": "Increase EPC",
"goal_value": "A",
"trigger_file_path": filename
}
print(body)