From 6bfab1d585098c64a80e45b9ab50fb1af646c5b5 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 14 Apr 2025 10:00:53 +0000 Subject: [PATCH] hubspot_to_deem --- .devcontainer/devcontainer.json | 4 +++- etl/hubspot_to_deem.py | 3 +++ etl/scraper/scraper.py | 1 + etl/surveyPrice/surveyPrice.py | 11 ++++++++--- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 etl/hubspot_to_deem.py diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 823f974..1ccb286 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,7 +20,9 @@ "mechatroner.rainbow-csv", "ms-toolsai.datawrangler", "lindacong.vscode-book-reader", - "4ops.terraform" + "4ops.terraform", + "fabiospampinato.vscode-todo-plus", + "jgclark.vscode-todo-highlight" ] } } diff --git a/etl/hubspot_to_deem.py b/etl/hubspot_to_deem.py new file mode 100644 index 0000000..46a06fe --- /dev/null +++ b/etl/hubspot_to_deem.py @@ -0,0 +1,3 @@ +from etl.surveyPrice.surveyPrice import SurveyPrice + + diff --git a/etl/scraper/scraper.py b/etl/scraper/scraper.py index dadaf7b..21a76f5 100644 --- a/etl/scraper/scraper.py +++ b/etl/scraper/scraper.py @@ -27,6 +27,7 @@ class SharePointInstaller(Enum): BAXTER_KELLY = os.getenv("BAXTER_KELLY_SERVICE_SHAREPOINT_ID", "6f930bf3-572d-4f91-b1ae-ec536fa319e2") DOMNA = os.getenv("DOMNA_SHAREPOINT_ID", "8ab64924-ccde-4b56-b0dc-4e11596446e4") OSMOSIS = os.getenv("OSMOSIS_SHAREPOINT_ID", "350a3b48-8311-4506-8abb-69bafc280d6f") + WARMFRONT = os.getenv("WARMFRONT_SHARPOINT_ID", "bea71c30-d366-454c-a484-ae4d6fd95bc4") class SharePointScraper(): """ diff --git a/etl/surveyPrice/surveyPrice.py b/etl/surveyPrice/surveyPrice.py index 38a224f..ecd7d00 100644 --- a/etl/surveyPrice/surveyPrice.py +++ b/etl/surveyPrice/surveyPrice.py @@ -1,13 +1,16 @@ +from etl.scraper.scraper import SharePointScraper, SharePointInstaller -class surveyPrice(): +class SurveyPrice(): """ - A class to work out all prices and uploads to sharepoint + A class to work out all prices and uploads to sharepoint for review """ def __init__(self): + self.sharepoint_client = SharePointScraper(SharePointInstaller.WARMFRONT) pass def download_price_card(self): + self.sharepoint_client.get_folders_in_path("/Documents/Commercials/Rate Cards") pass def get_price_card(): @@ -17,9 +20,11 @@ class surveyPrice(): -# Step one +# TODO # Make a copy of the rate card and work out each price matrix # Make the price card downloadable as a single excelt sheet for viewing + + # For other things, do some TDD so it is a little robust # The script can run weekly, for development I can just get one data # Expected input, expect output etc