Skip to main content

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.

Metadata

Release files for pycocap 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycocap 1.3.3
File Size Uploaded
pycocap-1.3.3.tar.gz 2.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycocap 1.3.3
File Interpreter ABI Platform
pycocap-1.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 2.1 MB

Release files / pycocap-1.3.3.tar.gz

Download URL pycocap-1.3.3.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
d16bb0342ef12d86445f40599d0fc85e86229528146ffc79f45c6175019d97c2
BLAKE2b-256 checksum
How to use checksums
818de83cd2d26d0ff8290efab95864281ffd7b16cdf9f94e66eabce83d3a1ec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release files / pycocap-1.3.3-py3-none-any.whl

Download URL pycocap-1.3.3-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00d5cc5100443ad53af5d1b98fcb171709ee2a0d27a9bb7a2956b16d3fde34cc
BLAKE2b-256 checksum
How to use checksums
570498b5a42539b230075941236f79a355ee726b8c2596324487579726934d47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.3.3 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.4.2

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page