%global _empty_manifest_terminate_build 0 Name: python-covid19poland Version: 0.9.0 Release: 1 Summary: Web Scraper for Poland COVID19 data. License: MIT URL: https://github.com/martinbenes1996/covid19poland Source0: https://mirrors.nju.edu.cn/pypi/web/packages/9b/05/9b832978aa265769fb9df9d51b8f46cb88bd51e4c43fff3f7befbdcac4d8/covid19poland-0.9.0.tar.gz BuildArch: noarch Requires: python3-beautifulsoup4 Requires: python3-GetOldTweets3 Requires: python3-openpyxl Requires: python3-pandas Requires: python3-requests Requires: python3-xlrd Requires: python3-waybackmachine Requires: python3-covid19dh Requires: python3-pytz %description # Web Scraper of COVID-19 data for Poland Python package [covid19poland](https://pypi.org/project/covid19poland/) is part of MFRatio project. It provides access to death data in Poland due to COVID-19 as well as overall deaths data. ## Setup and usage Install from [pip](https://pypi.org/project/covid19poland/) with ```python pip install covid19poland ``` Several data sources are in current version * Covid-19 deaths in Poland (offline) - manually checked * Parser of Twitter of Polish Ministery of Health * Covid-19 deaths from Wikipedia Package is regularly updated. Update with ```bash pip install --upgrade covid19poland ``` ### Covid-19 deaths Deaths can be acquired as dataframe of separate death cases with attributes ```python import covid19poland as PL x = PL.covid_death_cases() ``` or as death counts aggregated over 5y age groups, sex and region. ```python x = PL.covid_deaths() ``` Granularity of the region is parametrizable as 0 (whole Poland), 2 (NUTS-2) or 3 (NUTS-3, default). ```python x = PL.covid_deaths(level = 2) # setting region to be NUTS-2 ``` The NUTS-2 and NUTS-3 classification is done using offline clone of file from https://ec.europa.eu/eurostat/web/nuts/local-administrative-units. **Online reading** It is recommended to use the offline data, since they have been acquired this way and manually checked. The data is offline acquirable with the package `covid19poland`. If online data from Twitter is wanted, it can be downloaded and parsed as well. ```python data,filtered,checklist = PL.twitter(start = "2020-06-01", end = "2020-07-01") ``` Turn on logs by typing following code before the `twitter()` function call. ```python import logging logging.basicConfig(level = logging.INFO) ``` The result of the `twitter()` call are three values * data - containing the deceased people with their place and date of death * filtered - tweets, that were filtered out. Just for validation that nothing was missed. * checklist - list of dates that the parser is not sure about The data can be saved to output files with ```python with open("data/6_in.json", "w") as fd: json.dump(data, fd) with open("data/6_out.json", "w") as fd: json.dump(filtered, fd) print(checklist) ``` Offline data can be validated towards deaths from `covid19dh` package, the mismatching days are acquired by ```python x = PL.mismatching_days() ``` ### Covid-19 tests The test counts come from two sources and are merged together: * Parsed from Polish Ministery of Health ([@MZ_GOV_PL](https://twitter.com/MZ_GOV_PL)) * Wayback Machine (NUTS-3 data) from government pages. (*not connected yet*) Fetch the data with ```python x = PL.covid_tests() ``` Local copy of the data in the package is used. To live-parse the data from the source ```python x = PL.covid_tests(offline = False) ``` ### Deaths The `covid19poland` can also fetch death data from GUS (*Główny Urząd Statystyczny* or Central Statistical Office of Poland). The data is taken from http://demografia.stat.gov.pl/bazademografia/Tables.aspx and it is deaths per month and gender in years 2010 - 2018. ```python x = PL.deaths() ``` Local copy of the data in the package is used. To live-parse the data from the source, type ```python x = PL.deaths(offline = False) ``` ### Wikipedia *Obsolete* The table comes from version from beginning of June on Wikipedia page https://en.wikipedia.org/wiki/COVID-19_pandemic_in_Poland ```python x = PL.wiki() ``` Once better tabular source is found, it will replace the current one. Level is a setting for granularity of data 1. Country level (default) 2. State level ```python # country level x1 = PL.fetch(level = 1) # state level x2 = PL.fetch(level = 2) ``` ## Contribution Developed by [Martin Benes](https://github.com/martinbenes1996). Join on [GitHub](https://github.com/martinbenes1996/covid19poland). %package -n python3-covid19poland Summary: Web Scraper for Poland COVID19 data. Provides: python-covid19poland BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-covid19poland # Web Scraper of COVID-19 data for Poland Python package [covid19poland](https://pypi.org/project/covid19poland/) is part of MFRatio project. It provides access to death data in Poland due to COVID-19 as well as overall deaths data. ## Setup and usage Install from [pip](https://pypi.org/project/covid19poland/) with ```python pip install covid19poland ``` Several data sources are in current version * Covid-19 deaths in Poland (offline) - manually checked * Parser of Twitter of Polish Ministery of Health * Covid-19 deaths from Wikipedia Package is regularly updated. Update with ```bash pip install --upgrade covid19poland ``` ### Covid-19 deaths Deaths can be acquired as dataframe of separate death cases with attributes ```python import covid19poland as PL x = PL.covid_death_cases() ``` or as death counts aggregated over 5y age groups, sex and region. ```python x = PL.covid_deaths() ``` Granularity of the region is parametrizable as 0 (whole Poland), 2 (NUTS-2) or 3 (NUTS-3, default). ```python x = PL.covid_deaths(level = 2) # setting region to be NUTS-2 ``` The NUTS-2 and NUTS-3 classification is done using offline clone of file from https://ec.europa.eu/eurostat/web/nuts/local-administrative-units. **Online reading** It is recommended to use the offline data, since they have been acquired this way and manually checked. The data is offline acquirable with the package `covid19poland`. If online data from Twitter is wanted, it can be downloaded and parsed as well. ```python data,filtered,checklist = PL.twitter(start = "2020-06-01", end = "2020-07-01") ``` Turn on logs by typing following code before the `twitter()` function call. ```python import logging logging.basicConfig(level = logging.INFO) ``` The result of the `twitter()` call are three values * data - containing the deceased people with their place and date of death * filtered - tweets, that were filtered out. Just for validation that nothing was missed. * checklist - list of dates that the parser is not sure about The data can be saved to output files with ```python with open("data/6_in.json", "w") as fd: json.dump(data, fd) with open("data/6_out.json", "w") as fd: json.dump(filtered, fd) print(checklist) ``` Offline data can be validated towards deaths from `covid19dh` package, the mismatching days are acquired by ```python x = PL.mismatching_days() ``` ### Covid-19 tests The test counts come from two sources and are merged together: * Parsed from Polish Ministery of Health ([@MZ_GOV_PL](https://twitter.com/MZ_GOV_PL)) * Wayback Machine (NUTS-3 data) from government pages. (*not connected yet*) Fetch the data with ```python x = PL.covid_tests() ``` Local copy of the data in the package is used. To live-parse the data from the source ```python x = PL.covid_tests(offline = False) ``` ### Deaths The `covid19poland` can also fetch death data from GUS (*Główny Urząd Statystyczny* or Central Statistical Office of Poland). The data is taken from http://demografia.stat.gov.pl/bazademografia/Tables.aspx and it is deaths per month and gender in years 2010 - 2018. ```python x = PL.deaths() ``` Local copy of the data in the package is used. To live-parse the data from the source, type ```python x = PL.deaths(offline = False) ``` ### Wikipedia *Obsolete* The table comes from version from beginning of June on Wikipedia page https://en.wikipedia.org/wiki/COVID-19_pandemic_in_Poland ```python x = PL.wiki() ``` Once better tabular source is found, it will replace the current one. Level is a setting for granularity of data 1. Country level (default) 2. State level ```python # country level x1 = PL.fetch(level = 1) # state level x2 = PL.fetch(level = 2) ``` ## Contribution Developed by [Martin Benes](https://github.com/martinbenes1996). Join on [GitHub](https://github.com/martinbenes1996/covid19poland). %package help Summary: Development documents and examples for covid19poland Provides: python3-covid19poland-doc %description help # Web Scraper of COVID-19 data for Poland Python package [covid19poland](https://pypi.org/project/covid19poland/) is part of MFRatio project. It provides access to death data in Poland due to COVID-19 as well as overall deaths data. ## Setup and usage Install from [pip](https://pypi.org/project/covid19poland/) with ```python pip install covid19poland ``` Several data sources are in current version * Covid-19 deaths in Poland (offline) - manually checked * Parser of Twitter of Polish Ministery of Health * Covid-19 deaths from Wikipedia Package is regularly updated. Update with ```bash pip install --upgrade covid19poland ``` ### Covid-19 deaths Deaths can be acquired as dataframe of separate death cases with attributes ```python import covid19poland as PL x = PL.covid_death_cases() ``` or as death counts aggregated over 5y age groups, sex and region. ```python x = PL.covid_deaths() ``` Granularity of the region is parametrizable as 0 (whole Poland), 2 (NUTS-2) or 3 (NUTS-3, default). ```python x = PL.covid_deaths(level = 2) # setting region to be NUTS-2 ``` The NUTS-2 and NUTS-3 classification is done using offline clone of file from https://ec.europa.eu/eurostat/web/nuts/local-administrative-units. **Online reading** It is recommended to use the offline data, since they have been acquired this way and manually checked. The data is offline acquirable with the package `covid19poland`. If online data from Twitter is wanted, it can be downloaded and parsed as well. ```python data,filtered,checklist = PL.twitter(start = "2020-06-01", end = "2020-07-01") ``` Turn on logs by typing following code before the `twitter()` function call. ```python import logging logging.basicConfig(level = logging.INFO) ``` The result of the `twitter()` call are three values * data - containing the deceased people with their place and date of death * filtered - tweets, that were filtered out. Just for validation that nothing was missed. * checklist - list of dates that the parser is not sure about The data can be saved to output files with ```python with open("data/6_in.json", "w") as fd: json.dump(data, fd) with open("data/6_out.json", "w") as fd: json.dump(filtered, fd) print(checklist) ``` Offline data can be validated towards deaths from `covid19dh` package, the mismatching days are acquired by ```python x = PL.mismatching_days() ``` ### Covid-19 tests The test counts come from two sources and are merged together: * Parsed from Polish Ministery of Health ([@MZ_GOV_PL](https://twitter.com/MZ_GOV_PL)) * Wayback Machine (NUTS-3 data) from government pages. (*not connected yet*) Fetch the data with ```python x = PL.covid_tests() ``` Local copy of the data in the package is used. To live-parse the data from the source ```python x = PL.covid_tests(offline = False) ``` ### Deaths The `covid19poland` can also fetch death data from GUS (*Główny Urząd Statystyczny* or Central Statistical Office of Poland). The data is taken from http://demografia.stat.gov.pl/bazademografia/Tables.aspx and it is deaths per month and gender in years 2010 - 2018. ```python x = PL.deaths() ``` Local copy of the data in the package is used. To live-parse the data from the source, type ```python x = PL.deaths(offline = False) ``` ### Wikipedia *Obsolete* The table comes from version from beginning of June on Wikipedia page https://en.wikipedia.org/wiki/COVID-19_pandemic_in_Poland ```python x = PL.wiki() ``` Once better tabular source is found, it will replace the current one. Level is a setting for granularity of data 1. Country level (default) 2. State level ```python # country level x1 = PL.fetch(level = 1) # state level x2 = PL.fetch(level = 2) ``` ## Contribution Developed by [Martin Benes](https://github.com/martinbenes1996). Join on [GitHub](https://github.com/martinbenes1996/covid19poland). %prep %autosetup -n covid19poland-0.9.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-covid19poland -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Thu May 18 2023 Python_Bot - 0.9.0-1 - Package Spec generated