Whenever

Latest version: v0.5.2

Safety actively analyzes 625681 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

0.5.1

------------------

- Fix ``LocalSystemDateTime.now()`` not setting the correct offset (104)

0.5.0

------------------

**Breaking changes**

- Fix handling of ``-0000`` offset in RFC2822 format, which was not according
to the standard. ``NaiveDateTime`` can now no longer be created from this format.
- ``DateDelta`` canonical format now uses ``P`` prefix.

**Improved**

- Add explicit ISO8601 formatting/parsing methods to datetimes, date, time, and deltas.
- Add missing ``Date.from_canonical_format`` method.
- Separate docs for deltas and datetimes.
- ``NaiveDateTime.assume_offset`` now also accepts integers as hour offsets.

0.4.0

------------------

A big release with the main feature being the addition of date/time deltas.
I've also tried to bundle as many small breaking changes as possible into
this release, to avoid having to do them in the future.

**Breaking changes**

- ``LocalDateTime`` renamed to ``LocalSystemDateTime``.

**Rationale**: The ``LocalDateTime`` name is used in other libraries for
naive datetimes, and the new name is more explicit.

- ``LocalSystemDateTime`` no longer adjusts automatically to changes in the system
timezone. Now, ``LocalSystemDateTime`` reflects the system timezone at the moment
of instantiation. It can be updated explicitly.

**Rationale**: The old behavior was dependent on too many assumptions, and
behaved unintuitively in some cases. It also made the class dependent on
shared mutable state, which made it hard to reason about.

- The ``disambiguate=`` argument now also determines how non-existent times
are handled.

**Rationale**: This makes it possible to handle both ambiguous and
non-existent times gracefully and in a consistent way.
This behavior is also more in line with the RFC5545 standard,
and Temporal.

- ``from_naive()`` removed in favor of methods on ``NaiveDateTime``.
For example, ``UTCDateTime.from_naive(n)`` becomes ``n.assume_utc()``.

**Rationale**: It's shorter, and more explicit about assumptions.

- Renamed ``ZonedDateTime.disambiguated()`` to ``.is_ambiguous()``.

**Rationale**: The new name distinguishes it from the ``disambiguate=``
argument, which also affects non-existent times.

- Replaced ``.py`` property with ``.py_datetime()`` method.

**Rationale**: Although it currently works fine as a property, this
may be changed in the future if the library no longer contains
a ``datetime`` internally.

- Removed properties that simply delegated to the underlying ``datetime`` object:
``tzinfo``, ``weekday``, and ``fold``. ``date`` and ``time`` now
return ``whenever.Date`` and ``whenever.Time`` objects.

**Rationale**: Removing these properties makes it possible to create improved
versions. If needed, these properties can be accessed from the
underlying datetime object with ``.py_datetime()``.

- Renamed ``.canonical_str()`` to ``.canonical_format()``.

**Rationale**: A more descriptive name.

- Renamed ``DoesntExistInZone`` to ``SkippedTime``, ``Ambiguous`` to
``AmbiguousTime``.

**Rationale**: The new names are shorter and more consistent.

- Renamed ``min`` and ``max`` to ``MIN`` and ``MAX``.

**Rationale**: Consistency with other uppercase class constants

**Improved**

- Added a ``disambiguation="compatible"`` option that matches the behavior of
other languages and the RFC5545 standard.
- Shortened the ``repr()`` of all types, use space separator instead of ``T``.
- Added ``sep="T" or " "`` option to ``canonical_format()``
- ``OffsetDateTime`` constructor and methods creating offset datetimes now accept
integers as hour offsets.
- Added ``Date`` and ``Time`` classes for working with dates and times separately.

0.3.4

------------------

- 🏷️ Improved exception messages for ambiguous or non-existent times (26)

0.3.3

------------------

- 💾 Add CPython-maintained ``tzdata`` package as Windows dependency (32)

0.3.2

------------------

- 🔓 Relax overly strict Python version constraint in package metadata (33)

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.