The `isoweek` module provides the `Week` class, which represents specific weeks spanning Monday to Sunday, adhering to the ISO 8601 week definition. It correctly handles the 52 or 53 numbered weeks in a year, where Week 1 is the first week with four or more days in January. The library is lightweight and immutable, offering an interface similar to `datetime.date` objects. The current version is 1.3.3, and the project appears to be in maintenance mode with infrequent updates, with its last PyPI release in 2017 and GitHub activity noted as 5 years ago.
pip install isoweekVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating Week objects, retrieving days, getting the current week, finding the week for a specific date, and checking date containment within a week.
Always use `isoweek.Week` for ISO 8601 compliant week handling. Avoid `datetime.strptime` with `%W` when ISO weeks are required.
Evaluate whether the existing functionality meets current project needs. For long-term projects or those requiring modern Python features, consider `iso-week-date` or integrating `datetime.date.isocalendar()` for basic ISO week needs.
Familiarize yourself with the ISO 8601 week date standard. Specifically, note that Week 1 is the first week containing a Thursday, or equivalently, the first week with at least four days in the new year.
Install the library using pip: `pip install isoweek`
Ensure the year argument for `isoweek.Week(year, week)` is an integer between 1 and 9999 inclusive.
To get a specific day of the week, use methods like `w.monday()`, `w.tuesday()`, up to `w.sunday()`. If you need a `datetime.date` object, you can convert it using these methods.
No dependency data recorded yet.