updating data
This commit is contained in:
@@ -163,7 +163,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<h2 class="heading"></h2>
|
<h2 class="heading"></h2>
|
||||||
<p>
|
<p>
|
||||||
<b>Check out your batch code</b> (Last updated: <span id="last_updated">March 11, 2022</span>)
|
<b>Check out your batch code</b> (Last updated: <span id="last_updated">March 18, 2022</span>)
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<table class="display" id="batchCodeTable">
|
<table class="display" id="batchCodeTable">
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -27,33 +27,33 @@
|
|||||||
"from dateutil.parser import parse\n",
|
"from dateutil.parser import parse\n",
|
||||||
"\n",
|
"\n",
|
||||||
"def needsUpdate():\n",
|
"def needsUpdate():\n",
|
||||||
" lastUpdatedBatchCodeTable = _getLastUpdatedBatchCodeTable()\n",
|
" lastUpdated = _getLastUpdated()\n",
|
||||||
" print('lastUpdatedBatchCodeTable:', lastUpdatedBatchCodeTable)\n",
|
" print(' lastUpdated:', lastUpdated)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" lastUpdatedOriginal = _getLastUpdatedOriginal()\n",
|
" lastUpdatedDataSource = _getLastUpdatedDataSource()\n",
|
||||||
" print('lastUpdatedOriginal:', lastUpdatedOriginal)\n",
|
" print('lastUpdatedDataSource:', lastUpdatedDataSource)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" return lastUpdatedBatchCodeTable < lastUpdatedOriginal\n",
|
" return lastUpdated < lastUpdatedDataSource\n",
|
||||||
" \n",
|
" \n",
|
||||||
"def _getLastUpdatedBatchCodeTable():\n",
|
"def _getLastUpdated():\n",
|
||||||
" return _getLastUpdated(\n",
|
" return __getLastUpdated(\n",
|
||||||
" url = \"https://knollfrank.github.io/HowBadIsMyBatch/batchCodeTable.html\",\n",
|
" url = \"https://knollfrank.github.io/HowBadIsMyBatch/batchCodeTable.html\",\n",
|
||||||
" getDateStr = lambda soup: soup.find(id = \"last_updated\").text)\n",
|
" getDateStr = lambda soup: soup.find(id = \"last_updated\").text)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"def _getLastUpdatedOriginal():\n",
|
"def _getLastUpdatedDataSource():\n",
|
||||||
" def getDateStr(soup):\n",
|
" def getDateStr(soup):\n",
|
||||||
" lastUpdated = soup.find(string = re.compile(\"Last updated\"))\n",
|
" lastUpdated = soup.find(string = re.compile(\"Last updated\"))\n",
|
||||||
" return re.search('Last updated: (.+).', lastUpdated).group(1)\n",
|
" return re.search('Last updated: (.+).', lastUpdated).group(1)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" return _getLastUpdated(url = \"https://vaers.hhs.gov/data/datasets.html\", getDateStr = getDateStr)\n",
|
" return __getLastUpdated(url = \"https://vaers.hhs.gov/data/datasets.html\", getDateStr = getDateStr)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"def _getLastUpdated(url, getDateStr):\n",
|
"def __getLastUpdated(url, getDateStr):\n",
|
||||||
" htmlContent = requests.get(url).text\n",
|
" htmlContent = requests.get(url).text\n",
|
||||||
" soup = BeautifulSoup(htmlContent, \"lxml\")\n",
|
" soup = BeautifulSoup(htmlContent, \"lxml\")\n",
|
||||||
" dateStr = getDateStr(soup)\n",
|
" dateStr = getDateStr(soup)\n",
|
||||||
" return parse(dateStr).date()\n",
|
" return parse(dateStr).date()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"print('needsUpdate: ', needsUpdate())"
|
"print('needsUpdate:', needsUpdate())"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -766,6 +766,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
|
"# FK-TODO: analog zu Intensivstationen.ipynb einen KreisOptionsSetter einsetzen zum automatischen Speichern der Options in der html-Datei\n",
|
||||||
"def printCountryOptions(countries):\n",
|
"def printCountryOptions(countries):\n",
|
||||||
" for country in countries:\n",
|
" for country in countries:\n",
|
||||||
" printCountryOption(country)\n",
|
" printCountryOption(country)\n",
|
||||||
@@ -805,6 +806,14 @@
|
|||||||
" country = 'Global',\n",
|
" country = 'Global',\n",
|
||||||
" minADRsForLethality = minADRsForLethality)"
|
" minADRsForLethality = minADRsForLethality)"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "9c70f2db",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
|||||||
Reference in New Issue
Block a user