PyCOCAP: The Python interface to the COCAP database
Project description
pyCOCAP
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pycocap-1.3.3.tar.gz
.
File metadata
- Download URL: pycocap-1.3.3.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d16bb0342ef12d86445f40599d0fc85e86229528146ffc79f45c6175019d97c2 |
|
MD5 | c4b65926ef65c15e1dd8fa1582add686 |
|
BLAKE2b-256 | 818de83cd2d26d0ff8290efab95864281ffd7b16cdf9f94e66eabce83d3a1ec4 |
File details
Details for the file pycocap-1.3.3-py3-none-any.whl
.
File metadata
- Download URL: pycocap-1.3.3-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00d5cc5100443ad53af5d1b98fcb171709ee2a0d27a9bb7a2956b16d3fde34cc |
|
MD5 | 2437f9f3003439906cb6e3ef5320c237 |
|
BLAKE2b-256 | 570498b5a42539b230075941236f79a355ee726b8c2596324487579726934d47 |