mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-30 13:10:56 +00:00
moved files
This commit is contained in:
parent
3257852003
commit
baf93e220d
12 changed files with 57 additions and 10 deletions
|
|
@ -1 +1,27 @@
|
|||
#!/bin/bash
|
||||
cd etl && poetry install;
|
||||
|
||||
# Get the Poetry virtual environment path
|
||||
VENV_PATH=$(poetry env info --path 2>/dev/null)
|
||||
|
||||
if [ -z "$VENV_PATH" ]; then
|
||||
echo "No Poetry environment found. Did you run 'poetry install'?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure VS Code settings directory exists
|
||||
SETTINGS_DIR="/home/vscode/.vscode-server/data/Machine"
|
||||
SETTINGS_FILE="$SETTINGS_DIR/settings.json"
|
||||
|
||||
mkdir -p "$SETTINGS_DIR"
|
||||
|
||||
# If settings.json doesn't exist, create a default one
|
||||
if [ ! -f "$SETTINGS_FILE" ]; then
|
||||
echo "{}" > "$SETTINGS_FILE"
|
||||
fi
|
||||
|
||||
# Update VS Code settings to use the Poetry virtual environment
|
||||
jq --arg venv "$VENV_PATH/bin/python" '.["python.defaultInterpreterPath"] = $venv' \
|
||||
"$SETTINGS_FILE" > "$SETTINGS_FILE.tmp" && mv "$SETTINGS_FILE.tmp" "$SETTINGS_FILE"
|
||||
|
||||
echo "✅ Updated VS Code to use Poetry environment: $VENV_PATH"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import os
|
||||
from pdfReader.pdfReaderToText import pdfReaderToText
|
||||
from scraper.scraper import SharePointScraper, SharePointInstaller
|
||||
from etl.scraper.scraper import SharePointScraper, SharePointInstaller
|
||||
from pprint import pprint, pformat
|
||||
import logging
|
||||
import tempfile
|
||||
from utils.logger import Logger
|
||||
from etl.utils.logger import Logger
|
||||
|
||||
from etl.validator.validator import DomnaSharePointValidator
|
||||
|
||||
|
|
@ -29,9 +29,16 @@ def main():
|
|||
# logger.info(pformat(list_of_house_ass_names))
|
||||
|
||||
# POC of work completed
|
||||
south_coast_scraper = SharePointScraper(SharePointInstaller.SOUTH_COAST_INSULATION_SERVICE)
|
||||
surverys_completed = south_coast_scraper.get_number_of_surverys_completed()
|
||||
logger.info(pformat(surverys_completed))
|
||||
# south_coast_scraper = SharePointScraper(SharePointInstaller.SOUTH_COAST_INSULATION_SERVICE)
|
||||
# surverys_completed = south_coast_scraper.get_number_of_surverys_completed()
|
||||
# logger.info(pformat(surverys_completed))
|
||||
print("hello world")
|
||||
print("1")
|
||||
a = 1
|
||||
import sys
|
||||
print(sys.executable)
|
||||
print("Current working directory:", os.getcwd())
|
||||
|
||||
|
||||
# def create_temp_file(dict_content):
|
||||
# with tempfile.NamedTemporaryFile(mode='w+', delete=False, suffix='.txt') as temp_file:
|
||||
|
|
@ -46,12 +53,21 @@ if __name__ == "__main__":
|
|||
main()
|
||||
|
||||
|
||||
# Make a validaation checker for housing assosciation
|
||||
|
||||
# Get and read files
|
||||
|
||||
# CSV file of the survey number
|
||||
|
||||
|
||||
# Work out productivity metirc (number of address in submission folder, with at least one file included)
|
||||
|
||||
|
||||
# Khalim would like these metrics from the pdf
|
||||
# address, uprn, assessor's name validation, current sap rating, current annual emissions. DImension
|
||||
# address, uprn, assessor's name validation, current sap rating, current annual emissions. DImension
|
||||
|
||||
|
||||
|
||||
# next week mvp
|
||||
# Gather file data form sharepoint
|
||||
# Start making a scheme or csv with the data we 'care about'
|
||||
# {id: uuid, 'surveryor_name': 'khalim', 'address': '123 fake street', 'prorperty_type': 'house', sharepoint_loc}
|
||||
# data base of historical data. SQL data
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
from pprint import pformat
|
||||
from enum import Enum
|
||||
import os
|
||||
from utils.logger import Logger
|
||||
from etl.utils.logger import Logger
|
||||
import logging
|
||||
# Awesome Khalim's Sharepoint code that I'll probably will need to learn how it work in the future
|
||||
from utils.sharepoint.sharepoint import SharePointClient
|
||||
from etl.utils.sharepoint.sharepoint import SharePointClient
|
||||
from functools import wraps
|
||||
import re
|
||||
from etl.validator.validator import DomnaSharePointValidator
|
||||
|
|
@ -42,6 +42,7 @@ class SharePointScraper():
|
|||
self.surveyor_work_completed = {}
|
||||
|
||||
|
||||
|
||||
def ensure_surveyor_names_loaded(func):
|
||||
"""Decorator to ensure surveyor names are loaded before calling the function."""
|
||||
@wraps(func)
|
||||
|
|
@ -174,3 +175,7 @@ class SharePointScraper():
|
|||
self.surveyor_work_completed.update({name: len(address_folders['value'])})
|
||||
|
||||
return self.surveyor_work_completed
|
||||
|
||||
@ensure_housing_assosiation_is_loaded
|
||||
def download_file_for_each_address(self):
|
||||
pass
|
||||
Loading…
Add table
Reference in a new issue