Skip to content

ISO Week Date

PyPI version license-shield pypi-versions Trusted publishing Ruff interrogate-shield PYPI - Types

iso-week-date is a toolkit to work with strings representing ISO Week date in two formats, namely:

  • Week format YYYY-WNN (date format %G-W%V)
  • Week date format YYYY-WNN-D (date format %G-W%V-%u)

where YYYY represents the year, W is a string literal, NN represents the week number, and D represents the day of the week.

In a nutshell it provides:

  • IsoWeek and IsoWeekDate classes that implement a series of methods to work with ISO Week (Date) formats directly, avoiding the pitfalls of going back and forth between string, date and datetime python objects.
  • pandas and polars functionalities (and namespaces) to work with series of ISO Week dates.
  • pydantic compatible types.

Documentation | Source Code | Issue Tracker


Installation

TL;DR: you can install the package with pip:

python -m pip install iso-week-date

For more information please refer to the installation section.

Where to start

The documentation is organized by what you are trying to do:

If you want to... Go to
learn the library by building something Quickstart
look up a specific method and see it used API tour
apply this to a pandas or polars series Working with dataframes
validate ISO week strings on a model field Working with Pydantic
have weeks start on a day other than Monday Weeks not starting on Monday
understand why the library works this way Why iso-week-date?
read exact signatures and exceptions API Reference

Contributing

Please read the contributing guidelines in the documentation site.

License

The project has a MIT Licence.