Web Scraper for Czechia COVID19 data.
Project description
Web Scraper of COVID-19 data for Czechia
Python package covid19czechia provides access to COVID-19 data of Czechia.
The data is scraped from
- Ministry of Health, Czech Republic
- Czech Statistical Office
Setup and usage
Install from pip with
pip install covid19czechia
Importing module is done such as
import covid19czechia as CZ
x = CZ.covid_deaths()
Package is regularly updated. Update with
pip install --upgrade covid19czechia
COVID-19 Cases
Get Covid-19 cases in Czechia.
x = CZ.covid_confirmed_cases()
Aggregated dataframe countrywise / regionwise / districtwise can be fetched using
x1 = CZ.covid_confirmed(level = 1) # country
x2 = CZ.covid_confirmed(level = 2) # region
x3 = CZ.covid_confirmed(level = 3) # district
The data contains counts by age, age group and sex and information of week. To aggregate results only over some of the groups (example - per day)
x = x\
.groupby(['date','week'])\
.aggregate({'confirmed': 'sum'})\
.reset_index()
Result of the example contains columns day, week and confirmed.
COVID-19 Tests
Get Covid-19 tests in Czechia.
x1 = CZ.covid_tests(level = 1) # country
x2 = CZ.covid_tests(level = 2) # region
x3 = CZ.covid_tests(level = 3) # district
COVID-19 Deaths
Get Covid-19 deaths in Czechia (weekly counts, by gender and age group)
x = CZ.covid_deaths()
The function returns Pandas dataframe. It can be stored to csv file with
x.to_csv("filename.csv", header = True, index = False)
Administrative unit setting
Optional parameter level
sets granularity of administrative units
the deaths are computed in.
Defaultly (level = 1
) the deaths are taken from the whole Czechia.
x = CZ.covid_deaths(level = 1) # same as no argument given (above)
Settings level = 2
corresponds with deaths in regions (kraje, NUTS 3).
x = CZ.covid_deaths(level = 2)
Setting level = 3
means deaths per district (okresy, LAU 1).
x = CZ.covid_deaths(level = 3)
Read more about administrative units of Czech Republic here.
Total weekly deaths
For total deaths check my another package eurostat_deaths.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for covid19czechia-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9db0dc0fdb4db84c22a1b9f89be6ecf6d31a12b24f515802bb3ee353f64d5c72 |
|
MD5 | c457479f811c09a03aa8371dcd132d5b |
|
BLAKE2b-256 | 7650ec9952f8a1217eab6f56b5e59b8816719f5244618c04f312ee30424076cd |