Skip to main content

Provides access to Covid-19 data from Our World in Data, and functions to generate relevant charts and summaries.

Project description

covizpy

codecov ci-cd Documentation Status

covizpy is a Python package that provides easy access to Covid-19 data from Our World in Data, as well as functions to generate relevant Covid-19 charts and summaries easily. We aim to make covizpy simple and easy to use. Our goal is to enable anyone with basic Python programming knowledge to access and visualize Covid-19 data, and make their own informed decisions and conclusions.

There are existing Python packages that allow users to download and generate Covid-19 charts. For example, covid19pandas is a package that presents COVID-19 data from Johns Hopkins University and The New York Times in pandas dataframes, to make analysis and visualization easier in a Python environment.

While other packages have more advanced plotting capabilities, we provide simpler functions that allow users to answer questions regarding the Covid-19 pandemic as quickly as possible.

Features

This package contains four functions: plot_metric, plot_spec, get_data and plot_summary.

  • plot_metric: Create a line chart presenting COVID total new cases versus another metric within a time period

  • plot_spec: Create a line chart presenting specific country/countries COVID information within a time period

  • get_data: User can retrieve the COVID data from the source as a pandas dataframe. Specific data can be retrieved by passing the date range and the list of countries

  • plot_summary: Create a horizontal bar chart summarising a specified variable and value within a time period

Dependencies

Before installing the package, following packages must be installed:

  • python = "^3.9"
  • pandas = "^1.3.5"
  • altair = "^4.2.0"
  • altair-saver = "^0.5.0"

Installation

pip install covizpy

Usage and Examples

To use the package, import the package with following commands:

from covizpy.get_data import get_data
from covizpy.plot_summary import plot_summary
from covizpy.plot_metric import plot_metric
from covizpy.plot_spec import plot_spec

To use the functions, see below examples:

Retrieve COVID-19 data with specified date range and default all locations

df = get_data(date_from="2022-01-01", date_to="2022-01-21")

Plot summary graph (bar chart)

plot_summary(df, var="location", val="new_cases", fun="sum", date_from="2022-01-01", date_to="2022-01-15", top_n=10)

Summary graph

Plot COVID-19 cases for specific countries (line chart)

plot_spec(df, location=["Canada", "Turkey"], val="new_cases", date_from="2022-01-01", date_to="2022-01-07")

New COVID-19 specific graph

Plot new COVID-19 cases versus another metric (line chart)

plot_metric(metric='positive_rate', date_from="2022-01-15", date_to="2022-01-21")

New COVID-19 case metric graph

Contributors

  • Rohit Rawat
  • Rong Li
  • Thomas Siu
  • Ting Zhe Yan

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

covizpy was created by Rohit Rawat, Rong Li, Thomas Siu, Ting Zhe Yan. It is licensed under the terms of the MIT license.

Credits

covizpy was created with cookiecutter and the py-pkgs-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

covizpy-1.0.13.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

covizpy-1.0.13-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file covizpy-1.0.13.tar.gz.

File metadata

  • Download URL: covizpy-1.0.13.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for covizpy-1.0.13.tar.gz
Algorithm Hash digest
SHA256 56117d35f51425577fd432a324e989c703cdeab9fa58e2f7ea5495ceb3e16da4
MD5 6ecb4bdf7e0b15b8c768bd2943e3b907
BLAKE2b-256 24e6016b6d43c467fc4545ffab3aa927dbf0327675926d7c478c36d4dde45fcb

See more details on using hashes here.

File details

Details for the file covizpy-1.0.13-py3-none-any.whl.

File metadata

  • Download URL: covizpy-1.0.13-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for covizpy-1.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 7a37fb61d0d5c2659eabaa8a92cf12cae9e55dc6923e1bff5c478ad439e8d95b
MD5 2c6f7c3d0cf1fe8e9fdd797e31f9a509
BLAKE2b-256 50fdb3cc06c13537584e54c2572f9a806ce606b0e4112be29533a8d12df6b88e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page