API Reference#
This page contains auto-generated API reference documentation for the EpiWeeks package.
- class Week(year, week, system='cdc', validate=True)[source]#
Bases:
object
A Week object represents a week in epidemiological week calendar.
- Parameters:
- Raises:
ValueError – When
year
is out of supported range.ValueError – When
week
is out of weeks range for year.ValueError – When
system
is not within supported systems.
- classmethod fromstring(week_string, system='cdc', validate=True)[source]#
Construct Week object from a formatted string.
- Parameters:
week_string (str) – Week string formatted as
YYYYww
,YYYYWww
, orYYYY-Www
. If the string ends with weekday as in ISO formats, weekday will be ignored.system (str) – Week numbering system, which may be
cdc
where the week starts on Sunday oriso
where the week starts on Monday.validate (bool) – Whether to validate year, week and system or not.
- Return type:
- isoformat()[source]#
Return a string representing the week in ISO compact format
YYYYWww
.- Return type:
- class Year(year, system='cdc')[source]#
Bases:
object
A Year object represents a year in epidemiological week calendar.
- Parameters:
- Raises:
ValueError – When
year
is out of supported range.ValueError – When
system
is not within supported systems.