Skip to main 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 %Y-W%V)
  • Week date format YYYY-WNN-D (date format %Y-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:


Documentation | Source Code | Issue Tracker


Installation

iso-week-date is published as a Python package on pypi, and it can be installed with pip, or directly from source using git, or with a local clone:

  • pip (suggested):

    python -m pip install iso-week-date
    
  • pip + source/git:

    python -m pip install git+https://github.com/FBruzzesi/iso-week-date.git
    
  • local clone:

    git clone https://github.com/FBruzzesi/iso-week-date.git
    cd iso-week-date
    python -m pip install .
    

Dependencies

  • To work with IsoWeek and IsoWeekDate classes, no additional dependency is required.
  • pandas and polars functionalities require the installation of the respective libraries.
  • pydantic integration requires pydantic>=2.40.

Getting Started

Available features

This is a high level overview of the features provided by the iso-week-date package.

The IsoWeek and IsoWeekDate classes provide the following functionalities:

  • Parsing from string, date and datetime objects.
  • Conversion to string, date and datetime objects.
  • Comparison operations between IsoWeek (resp IsoWeekDate) objects.
  • Addition with int types.
  • Subtraction with int and IsoWeek (resp IsoWeekDate) types.
  • Range between two IsoWeek (resp. IsoWeekDate) objects.

IsoWeek unique methods/features:

  • days properties that lists the dates in the given week
  • nth method to get the nth day of the week as date
  • in operator and contains method to check if a (iterable of) week(s), string(s) and/or date(s) is contained in the given week
  • weeksout method to generate a list of weeks that are n_weeks after the given week
  • Addition and subtraction with int defaults to adding/subtracting weeks

IsoWeekDate unique methods/features:

  • day property that returns the weekday as integer
  • isoweek property that returns the ISO Week of the given date (as string)
  • daysout method to generate a list of dates that are n_days after the given date
  • Addition and subtraction with int defaults to adding/subtracting days

pandas_utils and polars_utils modules provide functionalities to work with and move back and forth with series of ISO Week date formats.

In specific both modules implements the following functionalities:

  • datetime_to_isoweek and datetime_to_isoweekdate to convert a series of datetime objects to a series of ISO Week (date) strings
  • isoweek_to_datetime and isoweekdate_to_datetime to convert a series of ISO Week (date) strings to a series of datetime objects
  • is_isoweek_series and is_isoweekdate_series to check if a string series values match the ISO Week (date) format

Quickstart

To get started with IsoWeek and IsoWeekDate classes please refer to the quickstart documentation section.

To check examples on how to work with pandas and polars functionalities please refer to the dataframe modules documentation section.

Custom offset

One of the main reason for this library to exist is the need and the flexibility to work with custom offsets, i.e. to be able to add/subtract a custom offset (as timedelta) to the default ISO Week start and given date, and get a "shifted" week.

This feature is available both in the IsoWeek and IsoWeekDate classes and the dataframe functionalities.

To check an example see the working with custom offset section.

Contributing

Please read the contributing guidelines in the documentation site.

License

The project has a MIT Licence.

Metadata

Release files for iso-week-date 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iso-week-date 2.3.0
File Size Uploaded
iso_week_date-2.3.0.tar.gz 31.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iso-week-date 2.3.0
File Interpreter ABI Platform
iso_week_date-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.2 kB

Release files / iso_week_date-2.3.0.tar.gz

Download URL iso_week_date-2.3.0.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d7a9a4101e56d8fcff62f933ad0db3a937f1af2d64bb3e47cb4185ce02c1ec5d
BLAKE2b-256 checksum
How to use checksums
28cf4dec5bb9eb04a0b0df0e686e0516ea066322d0477f18c0776b472522b8a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / iso_week_date-2.3.0-py3-none-any.whl

Download URL iso_week_date-2.3.0-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f4bdd08b59b03d28301e6fb43827e34907c19a4b56021c494b52248f82dbc6c
BLAKE2b-256 checksum
How to use checksums
9fdddb8a30aff2a9d5742d29e450a68f1e8254586c5866097f799920c4830024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files

2.2.2

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page