Package: covid19poland
Web Scraper of COVID-19 data for PolandPython packagecovid19polandis part of MFRatio project.It provides access to death data in Poland due to COVID-19 as well as overall deaths data.Setup and usageInstall frompipwithpipinstallcovid19polandSeveral data sources are in current versionCovid-19 deaths in Poland (offline) - manually checkedParser of Twitter of Polish Ministery of HealthCovid-19 deaths from WikipediaPackage is regularly updated. Update withpipinstall--upgradecovid19polandCovid-19 deathsDeaths can be acquired as dataframe of separate death cases with attributesimportcovid19polandasPLx=PL.covid_death_cases()or as death counts aggregated over 5y age groups, sex and region.x=PL.covid_deaths()Granularity of the region is parametrizable as 0 (whole Poland), 2 (NUTS-2) or 3 (NUTS-3, default).x=PL.covid_deaths(level=2)# setting region to be NUTS-2The NUTS-2 and NUTS-3 classification is done using offline clone of file fromhttps://ec.europa.eu/eurostat/web/nuts/local-administrative-units.Online readingIt is recommended to use the offline data, since they have been acquired
this way and manually checked. The data is offline acquirable with the packagecovid19poland.If online data from Twitter is wanted, it can be downloaded and parsed as well.data,filtered,checklist=PL.twitter(start="2020-06-01",end="2020-07-01")Turn on logs by typing following code before thetwitter()function call.importlogginglogging.basicConfig(level=logging.INFO)The result of thetwitter()call are three valuesdata - containing the deceased people with their place and date of deathfiltered - tweets, that were filtered out. Just for validation that nothing was missed.checklist - list of dates that the parser is not sure aboutThe data can be saved to output files withwithopen("data/6_in.json","w")asfd:json.dump(data,fd)withopen("data/6_out.json","w")asfd:json.dump(filtered,fd)print(checklist)Offline data can be validated towards deaths fromcovid19dhpackage,
the mismatching days are acquired byx=PL.mismatching_days()Covid-19 testsThe test counts come from two sources and are merged together:Parsed from Polish Ministery of Health (@MZ_GOV_PL)Wayback Machine (NUTS-3 data) from government pages. (not connected yet)Fetch the data withx=PL.covid_tests()Local copy of the data in the package is used.
To live-parse the data from the sourcex=PL.covid_tests(offline=False)DeathsThecovid19polandcan also fetch death data from GUS (Główny Urząd Statystycznyor Central Statistical Office of Poland). The data is taken fromhttp://demografia.stat.gov.pl/bazademografia/Tables.aspxand it is deaths per month and gender in years 2010 - 2018.x=PL.deaths()Local copy of the data in the package is used. To live-parse the data from the source, typex=PL.deaths(offline=False)WikipediaObsoleteThe table comes from version from beginning of June on Wikipedia pagehttps://en.wikipedia.org/wiki/COVID-19_pandemic_in_Polandx=PL.wiki()Once better tabular source is found, it will replace the current one.Level is a setting for granularity of dataCountry level (default)State level# country levelx1=PL.fetch(level=1)# state levelx2=PL.fetch(level=2)ContributionDeveloped byMartin Benes.Join onGitHub.