FBruzzesi / iso-week-date

Toolkit to work with str representing ISO Week date format
https://fbruzzesi.github.io/iso-week-date/
MIT License
6 stars 0 forks source link
datetime iso-8601 isoweek python

ISO Week Date

license-shield interrogate-shield Ruff coverage pypi-versions

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

where YYYY represents the year, W is a 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:

Dependencies

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:

IsoWeek unique methods/features:

IsoWeekDate unique methods/features:

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:

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.