mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-08 11:17:29 +00:00
survery data processor
This commit is contained in:
parent
be208961d3
commit
32fb397ca1
5 changed files with 13 additions and 10 deletions
|
|
@ -31,10 +31,9 @@ class pdfReaderToText():
|
|||
if len(self.text_list) > 1:
|
||||
if "Quidos Ltd using Argyle software BRE approved calculator".lower() in self.text_list[0].lower():
|
||||
self.type = ReportType.QUIDOS_PRESITE_NOTE
|
||||
return self.type
|
||||
else:
|
||||
return None
|
||||
# raise NotImplementedError("New type of file - please contact Jun-te Kim")
|
||||
pass
|
||||
return self.type
|
||||
|
||||
def get_reader(self):
|
||||
self.get_file_type()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from etl.scraper.scraper import SharePointScraper, SharePointInstaller
|
||||
from pprint import pformat
|
||||
from etl.pdfReader.pdfReaderToText import pdfReaderToText
|
||||
from etl.surveyedData.surveryedData import surveyedDataProcessor
|
||||
|
||||
|
||||
def get_type_of_file(path):
|
||||
|
|
@ -9,12 +11,8 @@ def main():
|
|||
south_coast_scraper = SharePointScraper(SharePointInstaller.SOUTH_COAST_INSULATION, development=True)
|
||||
file_paths = south_coast_scraper.download_file_for_each_address()
|
||||
|
||||
print(pformat(file_paths))
|
||||
|
||||
for eachAddress in file_paths:
|
||||
print(eachAddress)
|
||||
|
||||
# Download presite notes and add it to pdf reader class
|
||||
survey = surveyedDataProcessor(eachAddress)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
|
|
@ -243,9 +243,9 @@ class SharePointScraper():
|
|||
if 'file' not in address:
|
||||
# Only directories
|
||||
allAddress.append(address['name'])
|
||||
address_paths = {}
|
||||
for address in allAddress:
|
||||
for i, address in enumerate(allAddress):
|
||||
path = f"/{name}/{WEEK_COMMENCING}/{house_ass}/{address}"
|
||||
address_paths = {}
|
||||
files_to_download_sharepoint_info = self.get_folders_in_path(path)
|
||||
if 'value' not in files_to_download_sharepoint_info:
|
||||
raise RuntimeError("Failed to get files to download")
|
||||
|
|
|
|||
0
etl/surveyedData/__init__.py
Normal file
0
etl/surveyedData/__init__.py
Normal file
6
etl/surveyedData/surveryedData.py
Normal file
6
etl/surveyedData/surveryedData.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class surveyedDataProcessor():
|
||||
def __init__(self, address_to_files):
|
||||
for key, value in address_to_files.items():
|
||||
self.address = key
|
||||
self.files = value
|
||||
print(f"Address is {self.address}, with all files at location {self.files}")
|
||||
Loading…
Add table
Reference in a new issue