Package: covid-daily
🦠 COVID-19 Daily Data 🦠This repository allows any user to easily download COVID-19 daily data fromWorldometers. Data is disaggregated per country, so you can retrieve COVID real time daily data from your own country and analyze it.Contentsscraper/: contains the Jupyter Notebooks where the Web Scraper was developed and the "scripts" so as to download all the data by yourself.covid_daily/: this is the Python Package directory, which contains the previously developed functions integrated into a simple Python package so that any user can easily access the data by themselves.data/: contains a folder per country with all the available data as provided by Worldometers.tests/: contains the tests using pytest to ensure that after each commit the package is still working properly.docs/: contains the generated sphinx documentation, but you can see it athttps://covid_daily.readthedocs.ioFeaturesDetailed data from every country available at worldometers.info/coronavirus, which is indeed every country affected by the pandemic.Data is updated daily so you can track its evolution day by day.A general overview on how the pandemic is affecting every country (real-time).InstallationIn order to get this package working you will need toinstall it via pip(with a Python3.5 version or higher) on the terminal by typing:$ pip install covid_dailyDocumentationYou can find thecomplete developer documentationat:https://covid_daily.readthedocs.io/, hosted onRead the Docsand generated usingsphinxwith the themesphinx_rtd_themewhich is the standard Read the Docs theme for sphinx.KaggleYou can find a Kaggle Notebook explaining all the features on detail and providing some useful plots at:https://www.kaggle.com/alvarob96/covid-daily-data-retrieval-plot. Make sure to upvote the Kaggle Notebook and follow me at Kaggle so as to stay tuned for all the updates:https://www.kaggle.com/alvarob96UsageRetrieve the World's overviewimportcovid_dailyoverview=covid_daily.overview(as_json=False)print(overview.head())As already mentioned, this function retrieves an overview of the COVID-19 from all the available countries as indexed in Worldometers.info/coronavirusCountry,Other  TotalCases  NewCases  TotalDeaths  NewDeaths  TotalRecovered  \
0         World     6282377     23127       374232        535         2854425   
1           USA     1837170         0       106195          0          599867   
2        Brazil      514992       143        29341         27          206555   
3        Russia      414878      9035         4855        162          175877   
4         Spain      286509         0        27127          0          196958   

   ActiveCases  Serious,Critical  TotCases/1M pop  Deaths/1M pop  TotalTests  \
0      3053720             53397              806             48           0   
1      1131108             17075             5553            321    17672567   
2       279096              8318             2424            138      930013   
3       234146              2300             2843             33    10923108   
4        62424               617             6128            580     4063843   

   Tests/1M pop  Population  
0             0           0  
1         53417   330843477  
2          4378   212434518  
3         74852   145929507  
4         86921    46753345Retrieve chart's data from every countryimportcovid_dailydata=covid_daily.data(country='spain',chart='total-currently-infected-linear',as_json=False)print(data.head())Which returns apandas.DataFramecontaining all the information provided by Worldometers related to the total amoun of infected people because of the COVID-19 in Spain, in this case.Currently Infected
Date                          
2020-05-09               63148
2020-05-10               61603
2020-05-11               63553
2020-05-12               62130
2020-05-13               60764Note that this functions lets the user change the country and the chart type from which data will be retrieved, containing different statistics. All the available countries can be found atAVAILABLE_COUNTRIESand all the available chart types atAVAILABLE_CHARTS.Retrieve & Plot all the available charts for any countryimportcovid_dailyfromcovid_daily.constantsimportAVAILABLE_CHARTSimportmatplotplib.pyplotaspltfig,axs=plt.subplots(3,3,figsize=(20,15))fromitertoolsimportproductpairs=list(product((range(3)),(range(3))))foridx,available_chartinenumerate(AVAILABLE_CHARTS):data=covid_daily.data(country='spain',chart=available_chart,as_json=False)data.plot(ax=axs[pairs[idx]],title=available_chart)fig.tight_layout()fig.show()The resulting figure containing all the data (charts) from Spain, as previously retrieved, is shown below, generated after the previous code block.ContributeAs this is an open source project it isopen to contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas. There is an open tab ofissueswhere anyone can open new issues if needed or navigate through them in order to solve them or contribute to its solving. Remember thatissues are not threads to describe multiple problems, this does not mean that issues can't be discussed, but so to keep a structured project management, the same issue should not describe different problems, just the main one and some nested/related errors that may be found.CitationWhen citing this repository on your publications please use the followingBibTeXcitation:@misc{
    covid_daily,
    author = { Alvaro Bartolome del Canto },
    title = { covid_daily - COVID-19 Daily Data from Worldometers with Python },
    year = { 2020 },
    publisher = {GitHub},
    journal = {GitHub Repository},
    howpublished = {\url{https://github.com/alvarobartt/covid-daily}}
}All the data contained in this repository is updated once a day until the COVID-19 pandemic ends.