Skip to content

Commit

Permalink
server timestamp correction +1h fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robjharrison committed Jun 3, 2024
1 parent a209198 commit 2eb95a6
Show file tree
Hide file tree
Showing 4 changed files with 4,089 additions and 4,084 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<h1>Ofsted ILACS Summary</h1>
<p>Summarised outcomes of published short and standard ILACS inspection reports by Ofsted, refreshed daily.<br/>An expanded version of the shown summary sheet, refreshed concurrently, is available to <a href="ofsted_childrens_services_overview.xlsx">download here</a> as an .xlsx file. <br/>Data summary is based on the original <i>ILACS Outcomes Summary</i> published periodically by the ADCS: <a href="https://adcs.org.uk/inspection/article/ilacs-outcomes-summary">https://adcs.org.uk/inspection/article/ilacs-outcomes-summary</a>. <a href="https://github.com/data-to-insight/ofsted-ilacs-scrape-tool/blob/main/README.md">Read the tool/project background details and future work.</a>.</p>
<p>Disclaimer: This summary is built from scraped data direct from https://reports.ofsted.gov.uk/ published PDF inspection report files. As a result of the nuances|variance within the inspection report content or pdf encoding, we're noting some problematic data extraction for a small number of LAs*.<br/> *LA extraction issues: southend-on-sea, [overall, help_and_protection_grade,care_leavers_grade], nottingham,[inspection_framework, inspection_date], redcar and cleveland,[inspection_framework, inspection_date], knowsley,[inspector_name], stoke-on-trent,[inspector_name]<br/><a href="mailto:[email protected]?subject=Ofsted-Scrape-Tool">Feedback</a> on specific problems|inaccuracies|suggestions welcomed.*</p>
<p><b>Summary data last updated: 03 06 2024 13:04</b></p>
<p><b>Summary data last updated: 03 06 2024 13:13</b></p>
<p><b>LA inspections last updated: []</b></p>
<div class="container">
<table border="1" class="dataframe">
Expand Down
11 changes: 8 additions & 3 deletions ofsted_childrens_services_inspection_scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
import numpy as np
from bs4 import BeautifulSoup
import re
from datetime import datetime
from datetime import datetime, timedelta # timedelta enables server time adjustment
import json
import git

Expand Down Expand Up @@ -1226,13 +1226,18 @@ def save_to_html(data, column_order, local_link_column=None, web_link_column=Non
# remove the inspection_reports_folder path prefix from the file paths, create last updated list
las_with_new_inspection_list = [os.path.relpath(file, inspection_reports_folder) for file in changed_files]


# print(las_with_new_inspection_list)

except Exception as e:
print(f"Error processing repository: {e}")
raise
# end of Most-recent-reports generate
# Chk + remove onward use of variable las_with_new_inspection_list IF running locally



# current time, add one hour to the current time to correct git server time
adjusted_timestamp_str = (datetime.now() + timedelta(hours=1)).strftime("%d %m %Y %H:%M")

# init HTML content with title and CSS
html_content = f"""
Expand Down Expand Up @@ -1263,7 +1268,7 @@ def save_to_html(data, column_order, local_link_column=None, web_link_column=Non
<h1>{page_title}</h1>
<p>{intro_text}</p>
<p>{disclaimer_text}</p>
<p><b>Summary data last updated: {datetime.now().strftime("%d %m %Y %H:%M")}</b></p>
<p><b>Summary data last updated: {adjusted_timestamp_str}</b></p>
<p><b>LA inspections last updated: {las_with_new_inspection_list}</b></p>
<div class="container">
"""
Expand Down
Binary file modified ofsted_childrens_services_overview.xlsx
Binary file not shown.
Loading

0 comments on commit 2eb95a6

Please sign in to comment.