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.8+ 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.3.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: epiweeks-2.3.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for epiweeks-2.3.0.tar.gz
Algorithm Hash digest
SHA256 3c64ee0b217d0a03f0896fce3c35b73c848c3717790504893cb4eb61b9364bac
MD5 03187366746893d3c044467aed7cfb6f
BLAKE2b-256 3396fc0ca16f9046cb9961b8f1a68aaa2a9bc3a4d3df6bad7d6ddd3b7fcee9e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: epiweeks-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for epiweeks-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e60f31f0bb7021cb62d6a366fc90b69798b3f78b2aa929ad78709be9e0cb35a8
MD5 fe6578183dc13cf96f98e365c1bd56dd
BLAKE2b-256 352286e5006b668ddb2b4c0de7c2df74e2af24672579b4b5468ec8365f235b4f

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