mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
38 lines
959 B
Python
38 lines
959 B
Python
"""
|
|
This script will create an input csv for the recommendation engine and upload it to S3, which can be used for
|
|
testing
|
|
"""
|
|
import os
|
|
|
|
import pandas as pd
|
|
from utils.s3 import save_csv_to_s3
|
|
|
|
EPC_AUTH_TOKEN = os.getenv("EPC_AUTH_TOKEN", None)
|
|
USER_ID = 8
|
|
PORTFOLIO_ID = 59
|
|
|
|
|
|
def app():
|
|
pilot_file = pd.DataFrame(
|
|
[
|
|
{"address": "10 Elm Close", "postcode": "CV37 8XL", "Notes": None},
|
|
{"address": "21, Spring Lane", "postcode": "MK17 0QP", "Notes": None},
|
|
]
|
|
)
|
|
|
|
# Store the data in s3
|
|
filename = f"{USER_ID}/{PORTFOLIO_ID}/the_guiness_partnership_pilot_file.csv"
|
|
save_csv_to_s3(
|
|
dataframe=pilot_file,
|
|
bucket_name="retrofit-plan-inputs-dev",
|
|
file_name=filename
|
|
)
|
|
|
|
body = {
|
|
"portfolio_id": str(PORTFOLIO_ID),
|
|
"housing_type": "Social",
|
|
"goal": "Increase EPC",
|
|
"goal_value": "C",
|
|
"trigger_file_path": filename
|
|
}
|
|
print(body)
|