Arrow

Latest version: v1.3.0

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

Scan your dependencies

Page 2 of 10

1.1.0

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

- [NEW] Implemented the ``dehumanize`` method for ``Arrow`` objects. This takes human readable input and uses it to perform relative time shifts, for example:

.. code-block:: python

>>> arw
<Arrow [2021-04-26T21:06:14.256803+00:00]>
>>> arw.dehumanize("8 hours ago")
<Arrow [2021-04-26T13:06:14.256803+00:00]>
>>> arw.dehumanize("in 4 days")
<Arrow [2021-04-30T21:06:14.256803+00:00]>
>>> arw.dehumanize("in an hour 34 minutes 10 seconds")
<Arrow [2021-04-26T22:40:24.256803+00:00]>
>>> arw.dehumanize("hace 2 años", locale="es")
<Arrow [2019-04-26T21:06:14.256803+00:00]>

- [NEW] Made the start of the week adjustable when using ``span("week")``, for example:

.. code-block:: python

>>> arw
<Arrow [2021-04-26T21:06:14.256803+00:00]>
>>> arw.isoweekday()
1 Monday
>>> arw.span("week")
(<Arrow [2021-04-26T00:00:00+00:00]>, <Arrow [2021-05-02T23:59:59.999999+00:00]>)
>>> arw.span("week", week_start=4)
(<Arrow [2021-04-22T00:00:00+00:00]>, <Arrow [2021-04-28T23:59:59.999999+00:00]>)

- [NEW] Added Croatian, Latin, Latvian, Lithuanian and Malay locales.
- [FIX] Internally standardize locales and improve locale validation. Locales should now use the ISO notation of a dash (``"en-gb"``) rather than an underscore (``"en_gb"``) however this change is backward compatible.
- [FIX] Correct type checking for internal locale mapping by using ``_init_subclass``. This now allows subclassing of locales, for example:

.. code-block:: python

>>> from arrow.locales import EnglishLocale
>>> class Klingon(EnglishLocale):
... names = ["tlh"]
...
>>> from arrow import locales
>>> locales.get_locale("tlh")
<__main__.Klingon object at 0x7f7cd1effd30>

- [FIX] Correct type checking for ``arrow.get(2021, 3, 9)`` construction.
- [FIX] Audited all docstrings for style, typos and outdated info.

1.0.3

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

- [FIX] Updated internals to avoid issues when running ``mypy --strict``.
- [FIX] Corrections to Swedish locale.
- [INTERNAL] Lowered required coverage limit until ``humanize`` month tests are fixed.

1.0.2

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

- [FIXED] Fixed an ``OverflowError`` that could occur when running Arrow on a 32-bit OS.

1.0.1

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

- [FIXED] A ``py.typed`` file is now bundled with the Arrow package to conform to PEP 561.

1.0.0

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

After 8 years we're pleased to announce Arrow v1.0. Thanks to the entire Python community for helping make Arrow the amazing package it is today!

- [CHANGE] Arrow has **dropped support** for Python 2.7 and 3.5.
- [CHANGE] There are multiple **breaking changes** with this release, please see the `migration guide <https://github.com/arrow-py/arrow/issues/832>`_ for a complete overview.
- [CHANGE] Arrow is now following `semantic versioning <https://semver.org/>`_.
- [CHANGE] Made ``humanize`` granularity="auto" limits more accurate to reduce strange results.
- [NEW] Added support for Python 3.9.
- [NEW] Added a new keyword argument "exact" to ``span``, ``span_range`` and ``interval`` methods. This makes timespans begin at the start time given and not extend beyond the end time given, for example:

.. code-block:: python

>>> start = Arrow(2021, 2, 5, 12, 30)
>>> end = Arrow(2021, 2, 5, 17, 15)
>>> for r in arrow.Arrow.span_range('hour', start, end, exact=True):
... print(r)
...
(<Arrow [2021-02-05T12:30:00+00:00]>, <Arrow [2021-02-05T13:29:59.999999+00:00]>)
(<Arrow [2021-02-05T13:30:00+00:00]>, <Arrow [2021-02-05T14:29:59.999999+00:00]>)
(<Arrow [2021-02-05T14:30:00+00:00]>, <Arrow [2021-02-05T15:29:59.999999+00:00]>)
(<Arrow [2021-02-05T15:30:00+00:00]>, <Arrow [2021-02-05T16:29:59.999999+00:00]>)
(<Arrow [2021-02-05T16:30:00+00:00]>, <Arrow [2021-02-05T17:14:59.999999+00:00]>)

- [NEW] Arrow now natively supports PEP 484-style type annotations.
- [FIX] Fixed handling of maximum permitted timestamp on Windows systems.
- [FIX] Corrections to French, German, Japanese and Norwegian locales.
- [INTERNAL] Raise more appropriate errors when string parsing fails to match.

0.17.0

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

- [WARN] Arrow will **drop support** for Python 2.7 and 3.5 in the upcoming 1.0.0 release. This is the last major release to support Python 2.7 and Python 3.5.
- [NEW] Arrow now properly handles imaginary datetimes during DST shifts. For example:

.. code-block:: python

>>> just_before = arrow.get(2013, 3, 31, 1, 55, tzinfo="Europe/Paris")
>>> just_before.shift(minutes=+10)
<Arrow [2013-03-31T03:05:00+02:00]>

.. code-block:: python

>>> before = arrow.get("2018-03-10 23:00:00", "YYYY-MM-DD HH:mm:ss", tzinfo="US/Pacific")
>>> after = arrow.get("2018-03-11 04:00:00", "YYYY-MM-DD HH:mm:ss", tzinfo="US/Pacific")
>>> result=[(t, t.to("utc")) for t in arrow.Arrow.range("hour", before, after)]
>>> for r in result:
... print(r)
...
(<Arrow [2018-03-10T23:00:00-08:00]>, <Arrow [2018-03-11T07:00:00+00:00]>)
(<Arrow [2018-03-11T00:00:00-08:00]>, <Arrow [2018-03-11T08:00:00+00:00]>)
(<Arrow [2018-03-11T01:00:00-08:00]>, <Arrow [2018-03-11T09:00:00+00:00]>)
(<Arrow [2018-03-11T03:00:00-07:00]>, <Arrow [2018-03-11T10:00:00+00:00]>)
(<Arrow [2018-03-11T04:00:00-07:00]>, <Arrow [2018-03-11T11:00:00+00:00]>)

- [NEW] Added ``humanize`` week granularity translation for Tagalog.
- [CHANGE] Calls to the ``timestamp`` property now emit a ``DeprecationWarning``. In a future release, ``timestamp`` will be changed to a method to align with Python's datetime module. If you would like to continue using the property, please change your code to use the ``int_timestamp`` or ``float_timestamp`` properties instead.
- [CHANGE] Expanded and improved Catalan locale.
- [FIX] Fixed a bug that caused ``Arrow.range()`` to incorrectly cut off ranges in certain scenarios when using month, quarter, or year endings.
- [FIX] Fixed a bug that caused day of week token parsing to be case sensitive.
- [INTERNAL] A number of functions were reordered in arrow.py for better organization and grouping of related methods. This change will have no impact on usage.
- [INTERNAL] A minimum tox version is now enforced for compatibility reasons. Contributors must use tox >3.18.0 going forward.

Page 2 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.