Skip to main content

PyCOCAP: The Python interface to the COCAP database

Project description

pyCOCAP

COCAP Logo

pyCOCAP is the Python interface to the common COCAP database. You can find the documentation here

Installation

Using the Package Installer for Python PIP, you can install this interface with following command

pip install pycocap

Usage

Once the package is installed it is as easy as this to get the COCAP data for example the reported case numbers for Sweden and the stringency index for the UK.

import pycocap as pyc
cases = pyc.cases('Sweden')
npi = pyc.npi('United Kingdom', 'stringency')

If you want to get multiple NPIs into one DataFrame, you can do following

npis = pyc.npis('Germany', ['school closing', 'dept relief', 'facial coverings'])

Defining the start and end dates of the timeseries can be done with Python's standard date objects

from datetime import date
deaths = pyc.death('Canada', start_date=date(2020, 5, 16), end_date=date(2021, 1, 15))

You can also use this to expand the timeseries and at the same time choose with which value to fill gaps

deaths = pyc.death('Canada', start_date=date(2019, 11, 1), fill_value=0)

Documentation

You can find the documentation here

Requirements

Contact

You can get in touch with me via e-mail or have a look at the source code and open issues there.

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

pycocap-1.1.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

pycocap-1.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file pycocap-1.1.0.tar.gz.

File metadata

  • Download URL: pycocap-1.1.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for pycocap-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1a892cf6ccdf69ed30f819720d0f5b1bdebfba7d0ec17740afb25772a0d987cb
MD5 0c07e14a1b662327bc51c504e14c2799
BLAKE2b-256 0956ed7787e9205547945023b376894ee1dfd338844dfd9ce87a0208bd60226a

See more details on using hashes here.

File details

Details for the file pycocap-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pycocap-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for pycocap-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abbb6e5b8baaa2e3d6078f6a48ac2587db4d6cb7056ebecb9e69eb30448369a3
MD5 baa8ab9f786a22e146311e85b96e2afd
BLAKE2b-256 5fdb9c1cd1d70baf6e2d89eff6b79109710a3099054f7ee45622a9833ea8df6d

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