EpiWeeks is a Python package designed for accurate epidemiological week calculations, adhering to both the US CDC (MMWR) and ISO week numbering systems. It provides reliable week calculations, validated against official reference data, making it essential for disease surveillance, public health reporting, and epidemiological research. The library boasts zero runtime dependencies, supports Python versions 3.10 and newer, and is actively maintained with frequent updates.
pip install epiweeksVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to create `Week` and `Year` objects, convert dates to epiweeks, and iterate through a year's weeks using both CDC and ISO systems.
Upgrade to Python 3.10 or newer. For older Python versions, use an older `epiweeks` release (e.g., v2.3.0 for 3.10+, v2.2.0 for 3.11+).
If you were passing `validate` positionally, you must now pass it as a keyword argument (e.g., `Week(year, week, validate=True)` instead of `Week(year, week, True)`).
Ensure you are only comparing `Week` objects with other `Week` objects. Explicitly convert other date types to `Week` objects before comparison if needed.
Always use explicit imports like `from epiweeks import Week, Year` for clarity and compatibility.
Change positional `validate` argument to a keyword argument. Example: `Week(2023, 1, validate=True)` instead of `Week(2023, 1, True)`.
Ensure you are using `from epiweeks import Week` (and `Year`). If using an old version where `epiweeks` was a single file, the correct import would likely be `from epiweeks_module_name import Week` or `import epiweeks_module_name; epiweeks_module_name.Week`.
Upgrade your Python environment to version 3.10 or higher. Alternatively, downgrade `epiweeks` to a compatible version for your Python environment (e.g., `pip install epiweeks==2.3.0` for Python 3.10-3.12).
No dependency data recorded yet.