Skip to content

Commit

Permalink
Hotfix and version bump (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi authored Aug 26, 2023
1 parent b05dd21 commit 4054640
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

In a nutshell it provides:

- [`IsoWeek`](https://fbruzzesi.github.io/api/isoweek.md) and [`IsoWeekDate`](https://fbruzzesi.github.io/api/isoweekdate.md) classes implementing a series of methods to work with ISO Week date formats and avoiding the pitfalls of going back and forth between string, date and datetime python objects.
- [pandas](https://fbruzzesi.github.io/api/pandas.md) and [polars](https://fbruzzesi.github.io/api/polars.md) functionalities to work with series of ISO Week dates.
- [`IsoWeek`](https://fbruzzesi.github.io/iso-week-date/api/isoweek) and [`IsoWeekDate`](https://fbruzzesi.github.io/iso-week-date/api/isoweekdate) classes implementing a series of methods to work with ISO Week date formats and avoiding the pitfalls of going back and forth between string, date and datetime python objects.
- [pandas](https://fbruzzesi.github.io/iso-week-date/api/pandas) and [polars](https://fbruzzesi.github.io/iso-week-date/api/polars) functionalities to work with series of ISO Week dates.

---

Expand Down Expand Up @@ -108,7 +108,7 @@ To check an example see the [working with custom offset](https://fbruzzesi.githu

## Contributing

Please read the [contributing guidelines](contribute.md) in the documentation site.
Please read the [contributing guidelines](https://fbruzzesi.github.io/iso-week-date/contribute) in the documentation site.

## License

Expand Down
26 changes: 26 additions & 0 deletions docs/getting-started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,29 @@ class MyWeek(IsoWeek):
```

This is all that is required to work with a custom shifted week.

Now the same date may be "mapped" to different ISO Weeks depending on the offset:

```py
_date = date(2023, 1, 1)
IsoWeek.from_date(_date) # IsoWeek(2022-W52)
MyWeek.from_date(_date) # MyWeek(2023-W01)
```

Or we can see that the same week starts on different dates:

```py
IsoWeek("2023-W01").nth(1) # date(2023, 1, 2)
MyWeek("2023-W01").nth(1) # date(2022, 12, 31)
```

Similarly we can define a custom offset for the `IsoWeekDate` class:

```py title="custom offset"
class MyWeekDate(IsoWeekDate):
"""
MyWeekDate class is a IsoWeekDate with custom offset of -2 days.
Therefore MyWeekDate starts the Saturday before the "standard" ISO week.
"""
offset_ = timedelta(days=-2)
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "iso-week-date"
description = "Toolkit to work with str representing ISO Week date format"
version = "0.0.2"
version = "0.1.0"
readme = "README.md"
license = {file = "LICENSE"}
authors = [{name = "Francesco Bruzzesi"}]
Expand Down

0 comments on commit 4054640

Please sign in to comment.