Skip to main content

Epidemiological weeks calculation based on the US CDC (MMWR) and ISO week numbering systems

Project description

epiweeks

A Python package to calculate epidemiological weeks using the US CDC (MMWR) and ISO week numbering systems.

Features

  • Support for both the US CDC (MMWR) and ISO week numbering systems.
  • Accurate and tested calculations.
  • Intuitive, clean, and easy-to-use interface.
  • Calculation of the start and end dates of weeks.
  • Iteration of year's weeks or week's dates.
  • Rich comparison between weeks.
  • Logical operations for weeks (addition, subtraction and containment).
  • Validation of input data.
  • Works on Python 3.7+ with zero dependencies.
  • Thoroughly tested with 100% test coverage.

Installation

To install using pip, run:

pip install epiweeks

To install using conda, run:

conda install -c bioconda epiweeks

Basic Usage

from epiweeks import Week, Year

week = Week(2019, 1)
print(week.enddate())
# 2019-01-05

for week in Year(2019).iterweeks():
    print(week.enddate())
# 2019-01-05
# 2019-01-12
# ...
# 2019-12-21
# 2019-12-28

Documentation

Please see https://epiweeks.readthedocs.io for full documentation of this package, including background, more usage examples and API reference.

License

This project is licensed under the terms of the MIT license.

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

epiweeks-2.2.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

epiweeks-2.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file epiweeks-2.2.0.tar.gz.

File metadata

  • Download URL: epiweeks-2.2.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for epiweeks-2.2.0.tar.gz
Algorithm Hash digest
SHA256 e6f6de0952b36b7dd50d2a2eed7937f654cc50823329664d333ee753bbc5d026
MD5 c15d09a97938e5ec771ada1a6f2ec317
BLAKE2b-256 07ecfcd15b9ca60fd96b5edf87497a52ac0427269aaf0f4e3bc647223f3df58a

See more details on using hashes here.

File details

Details for the file epiweeks-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: epiweeks-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for epiweeks-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 140dbef8febc3a7cbfca3b49d03f034f07e1eaa732b861e720aae5333bcdf961
MD5 f3477ab98e91bca75e5516fb7e34683f
BLAKE2b-256 8d3a0dfdb7e50e1fdb8ee3f6b4f05b2e239bfc9b4bcc7636a6478f58234d69eb

See more details on using hashes here.

Supported by

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