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.

Checks Status Coverage Status Code Quality Docs Status PyPI Downloads PyPI Version Conda Version Package License

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.6+ 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.1.3.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

epiweeks-2.1.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: epiweeks-2.1.3.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for epiweeks-2.1.3.tar.gz
Algorithm Hash digest
SHA256 f1caead441c874d7724e8a8cdb96a3791f2f6e1afd46ed5cfca51cddae94c78d
MD5 39f0eace6b28e56b414e25bb10640049
BLAKE2b-256 40a41a78f3ddb115b2f6a1e32aa18a580e64b1307c2857cdadd544f106c3cf9a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: epiweeks-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for epiweeks-2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6953ce3a7bb01b7c383f59943380895fe592937bf682163f4148359706ea79ab
MD5 5a8a9ce8acf73edee62c28fb17666a1a
BLAKE2b-256 41e8c7e41a627561c76210395206fc27560125d763b986eaf1eca22083eb0df2

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