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-0.10.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

pycocap-0.10.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycocap-0.10.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-0.10.0.tar.gz
Algorithm Hash digest
SHA256 f8e3a3bbd90f0c679865af433cbf3da577d8d12e0f4fbf76543a27eb53e21998
MD5 70547ceac26c577173e576dd00bde9af
BLAKE2b-256 9a36bd8177c4ebd0fe9ed0f9cefd9bc42a3e63874a7c2c9156cb2d61814356b3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pycocap-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1f9eff60df781c6872289804e3c5e200d8df180b7e69b9a7fefee434793f9f4
MD5 f00a28b0739c53b1335d2ac77c08fce1
BLAKE2b-256 11e4ad2ec0f0e7ea6ba69d5118d9d036ca7d658748f8eca3f07ed816ec5032cf

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