adding last_updated to VaccineDistributionByZipcode.html

This commit is contained in:
frankknoll
2023-06-16 21:53:07 +02:00
parent 7b0b59da25
commit f268bf28f8
3 changed files with 23 additions and 20 deletions

View File

@@ -42,12 +42,15 @@
</tr> </tr>
</thead> </thead>
</table> </table>
<p><b>Data Sources:</b> <dl>
<a href="https://vaers.hhs.gov/data/datasets.html" target="_blank">Vaccine Adverse Event Reporting System <dt>Data Sources:</dt>
(VAERS)</a> and <dd><a href="https://vaers.hhs.gov/data/datasets.html" target="_blank">Vaccine Adverse Event Reporting System
<a href="https://icandecide.org/wp-content/uploads/2022/09/Amended-22-01962-Pfizer-2022-0426-pulled-2022-0823.xlsx" (VAERS)</a></dd>
target="_blank">Vaccine Distribution by Zipcode</a> <dd><a href="https://icandecide.org/wp-content/uploads/2022/09/Amended-22-01962-Pfizer-2022-0426-pulled-2022-0823.xlsx"
</p> target="_blank">Vaccine Distribution by Zipcode</a></dd>
<dt>Last updated:</dt>
<dd id="last_updated">June 09, 2023</dd>
</dl>
</body> </body>
</html> </html>

View File

@@ -5,12 +5,10 @@ from HtmlUtils import getBatchcodeOptions, getBatchcodes
from DateProvider import DateProvider from DateProvider import DateProvider
def updateBatchCodeTableHtmlFile(batchCodeTable, batchCodeTableHtmlFile): def updateBatchCodeTableHtmlFile(batchCodeTable, batchCodeTableHtmlFile, lastUpdated):
batchcodeOptions = getBatchcodeOptions(getBatchcodes(batchCodeTable.sort_values(by = 'Adverse Reaction Reports', ascending = False))) batchcodeOptions = getBatchcodeOptions(getBatchcodes(batchCodeTable.sort_values(by = 'Adverse Reaction Reports', ascending = False)))
_saveBatchcodeOptions(batchcodeOptions, batchCodeTableHtmlFile) _saveBatchcodeOptions(batchcodeOptions, batchCodeTableHtmlFile)
saveLastUpdatedBatchCodeTable( saveLastUpdated2HtmlFile(lastUpdated, batchCodeTableHtmlFile)
DateProvider().getLastUpdatedDataSource(),
batchCodeTableHtmlFile)
def _saveBatchcodeOptions(batchcodeOptions, batchCodeTableHtmlFile): def _saveBatchcodeOptions(batchcodeOptions, batchCodeTableHtmlFile):
HtmlTransformerUtil().applySoupTransformerToFile( HtmlTransformerUtil().applySoupTransformerToFile(
@@ -22,12 +20,12 @@ def _saveBatchcodeOptions(batchcodeOptions, batchCodeTableHtmlFile):
options=batchcodeOptions), options=batchcodeOptions),
'lxml')) 'lxml'))
def saveLastUpdatedBatchCodeTable(lastUpdated, batchCodeTableHtmlFile): def saveLastUpdated2HtmlFile(lastUpdated, htmlFile):
def setLastUpdated(soup): def setLastUpdated(soup):
soup.find(id="last_updated").string.replace_with( soup.find(id="last_updated").string.replace_with(
lastUpdated.strftime(DateProvider.DATE_FORMAT)) lastUpdated.strftime(DateProvider.DATE_FORMAT))
return soup return soup
HtmlTransformerUtil().applySoupTransformerToFile( HtmlTransformerUtil().applySoupTransformerToFile(
file=batchCodeTableHtmlFile, file = htmlFile,
soupTransformer = setLastUpdated) soupTransformer = setLastUpdated)

View File

@@ -14,7 +14,7 @@
"from HistogramFactoryAndPersister import createAndSaveGlobalHistograms\n", "from HistogramFactoryAndPersister import createAndSaveGlobalHistograms\n",
"from SymptomByBatchcodeTableFactory import SymptomByBatchcodeTableFactory\n", "from SymptomByBatchcodeTableFactory import SymptomByBatchcodeTableFactory\n",
"from BatchCodeTablePersister import createGlobalBatchCodeTable\n", "from BatchCodeTablePersister import createGlobalBatchCodeTable\n",
"from BatchCodeTableHtmlUpdater import updateBatchCodeTableHtmlFile, saveLastUpdatedBatchCodeTable\n", "from BatchCodeTableHtmlUpdater import updateBatchCodeTableHtmlFile, saveLastUpdated2HtmlFile\n",
"from InternationalVaersCovid19Provider import getInternationalVaersCovid19, getInternationalVaersCovid19BeforeDeletion, get_international_VAERSVAX_VAERSSYMPTOMS_Covid19\n", "from InternationalVaersCovid19Provider import getInternationalVaersCovid19, getInternationalVaersCovid19BeforeDeletion, get_international_VAERSVAX_VAERSSYMPTOMS_Covid19\n",
"from DateProvider import DateProvider\n", "from DateProvider import DateProvider\n",
"from BarChartDescriptionTable2DictionaryConverter import BarChartDescriptionTable2DictionaryConverter\n", "from BarChartDescriptionTable2DictionaryConverter import BarChartDescriptionTable2DictionaryConverter\n",
@@ -151,9 +151,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"IOUtils.saveDataFrameAsJson(batchCodeTable, '../docs/data/batchCodeTables/Global.json')\n", "IOUtils.saveDataFrameAsJson(batchCodeTable, '../docs/data/batchCodeTables/Global.json')\n",
"saveLastUpdatedBatchCodeTable(\n", "saveLastUpdated2HtmlFile(dateProvider.getLastUpdatedDataSource(), \"../docs/batchCodes.html\")"
" DateProvider().getLastUpdatedDataSource(),\n",
" batchCodeTableHtmlFile = \"../docs/batchCodes.html\")"
] ]
}, },
{ {
@@ -163,7 +161,10 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"updateBatchCodeTableHtmlFile(batchCodeTable, batchCodeTableHtmlFile=\"../docs/HowBadIsMyBatch.html\")" "updateBatchCodeTableHtmlFile(\n",
" batchCodeTable,\n",
" batchCodeTableHtmlFile = \"../docs/HowBadIsMyBatch.html\",\n",
" lastUpdated = dateProvider.getLastUpdatedDataSource())"
] ]
}, },
{ {
@@ -364,7 +365,8 @@
"source": [ "source": [
"from IOUtils import IOUtils\n", "from IOUtils import IOUtils\n",
"\n", "\n",
"IOUtils.saveDataFrameAsJson(vaccineDistributionByZipcode, '../docs/data/vaccineDistributionByZipcode/VaccineDistributionByZipcode.json')" "IOUtils.saveDataFrameAsJson(vaccineDistributionByZipcode, '../docs/data/vaccineDistributionByZipcode/VaccineDistributionByZipcode.json')\n",
"saveLastUpdated2HtmlFile(dateProvider.getLastUpdatedDataSource(), \"../docs/VaccineDistributionByZipcode.html\")"
] ]
} }
], ],