Skip to content

Releases: arrow-py/arrow

Version 1.0.0

26 Feb 13:58
5248407
Compare
Choose a tag to compare

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 #832 for a complete overview.
  • [CHANGE] Arrow is now following semantic versioning.
  • [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:
>>> 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.

Version 0.17.0

06 Oct 20:47
b746fed
Compare
Choose a tag to compare
  • [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:
    >>> 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]>
    >>> 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.

Version 0.16.0

23 Aug 21:49
fb83f68
Compare
Choose a tag to compare
  • [WARN] Arrow will drop support for Python 2.7 and 3.5 in the 1.0.0 release in late September. The 0.16.x and 0.17.x releases are the last to support Python 2.7 and 3.5.
  • [NEW] Implemented PEP 495 to handle ambiguous datetimes. This is achieved by the addition of the fold attribute for Arrow objects. For example:
    >>> before = Arrow(2017, 10, 29, 2, 0, tzinfo='Europe/Stockholm')
    <Arrow [2017-10-29T02:00:00+02:00]>
    >>> before.fold
    0
    >>> before.ambiguous
    True
    >>> after = Arrow(2017, 10, 29, 2, 0, tzinfo='Europe/Stockholm', fold=1)
    <Arrow [2017-10-29T02:00:00+01:00]>
    >>> after = before.replace(fold=1)
    <Arrow [2017-10-29T02:00:00+01:00]>
  • [NEW] Added normalize_whitespace flag to arrow.get. This is useful for parsing log files and/or any files that may contain inconsistent spacing. For example:
    >>> arrow.get("Jun 1 2005     1:33PM", "MMM D YYYY H:mmA", normalize_whitespace=True)
    <Arrow [2005-06-01T13:33:00+00:00]>
    >>> arrow.get("2013-036 \t  04:05:06Z", normalize_whitespace=True)
    <Arrow [2013-02-05T04:05:06+00:00]>

Version 0.15.8

24 Jul 03:05
b7a7403
Compare
Choose a tag to compare
  • [WARN] arrow will drop support for Python 2.7 and 3.5 in the 1.0.0 release in late September. The 0.15.x and 0.16.x releases are the last to support Python 2.7 and 3.5.
  • [NEW] Added humanize week granularity translation for Czech.
  • [FIX] arrow.get will now pick sane defaults when weekdays are passed with particular token combinations, see #446
  • [INTERNAL] Moved arrow to an organization. The repo can now be found here.
  • [INTERNAL] Started issuing deprecation warnings for Python 2.7 and 3.5.
  • [INTERNAL] Added Python 3.9 to CI pipeline.

Version 0.15.7

19 Jun 17:53
81f224d
Compare
Choose a tag to compare
  • [NEW] Added a number of built-in format strings. See the docs for a complete list of supported formats. For example:
    >>> arw = arrow.utcnow()
    >>> arw.format(arrow.FORMAT_COOKIE)
    'Wednesday, 27-May-2020 10:30:35 UTC'
  • [NEW] Arrow is now fully compatible with Python 3.9 and PyPy3.
  • [NEW] Added Makefile, tox.ini, and requirements.txt files to the distribution bundle.
  • [NEW] Added French Canadian and Swahili locales.
  • [NEW] Added humanize week granularity translation for Hebrew, Greek, Macedonian, Swedish, Slovak.
  • [FIX] ms and μs timestamps are now normalized in arrow.get()
    , arrow.fromtimestamp(), and arrow.utcfromtimestamp(). For example:
    >>> ts = 1591161115194556
    >>> arw = arrow.get(ts)
    <Arrow [2020-06-03T05:11:55.194556+00:00]>
    >>> arw.timestamp
    1591161115
  • [FIX] Refactored and updated Macedonian, Hebrew, Korean, and Portuguese locales.

Version 0.15.6

03 May 16:11
6136257
Compare
Choose a tag to compare
  • [NEW] Added support for parsing and formatting ISO 8601 week dates via a new token W, for example:
>>> arrow.get("2013-W29-6", "W")
<Arrow [2013-07-20T00:00:00+00:00]>
>>> utc=arrow.utcnow()
>>> utc
<Arrow [2020-01-23T18:37:55.417624+00:00]>
>>> utc.format("W")
'2020-W04-4'
  • [NEW] Formatting with x token (microseconds) is now possible, for example:
>>> dt = arrow.utcnow()
>>> dt.format("x")
'1585669870688329'
>>> dt.format("X")
'1585669870'
  • [NEW] Added humanize week granularity translation for German, Italian, Polish & Taiwanese locales.
  • [FIX] Consolidated and simplified German locales.
  • [INTERNAL] Moved testing suite from nosetest/Chai to pytest/pytest-mock.
  • [INTERNAL] Converted xunit-style setup and teardown functions in tests to pytest fixtures.
  • [INTERNAL] Setup Github Actions for CI alongside Travis.
  • [INTERNAL] Help support Arrow's future development by donating to the project on Open Collective.

Version 0.15.5

03 Jan 16:50
Compare
Choose a tag to compare
  • [WARN] Python 2 reached EOL on 2020-01-01. arrow will drop support for Python 2 in a future release to be decided (see #739).
  • [NEW] Added bounds parameter to span_range, interval and span methods. This allows you to include or exclude the start and end values.
  • [NEW] arrow.get() can now create arrow objects from a timestamp with a timezone, for example:
>>> arrow.get(1367900664, tzinfo=tz.gettz('US/Pacific'))
<Arrow [2013-05-06T21:24:24-07:00]>
  • [NEW] humanize can now combine multiple levels of granularity, for example:
>>> later140 = arrow.utcnow().shift(seconds=+8400)
>>> later140.humanize(granularity="minute")
'in 139 minutes'
>>> later140.humanize(granularity=["hour", "minute"])
'in 2 hours and 19 minutes'
  • [NEW] Added Hong Kong locale (zh_hk).
  • [NEW] Added humanize week granularity translation for Dutch.
  • [NEW] Numbers are now displayed when using the seconds granularity in humanize.
  • [CHANGE] range now supports both the singular and plural forms of the frames argument (e.g. day and days).
  • [FIX] Improved parsing of strings that contain punctuation.
  • [FIX] Improved behaviour of humanize when singular seconds are involved.

Version 0.15.4

03 Nov 02:56
a382215
Compare
Choose a tag to compare
  • [FIX] Fixed an issue that caused package installs to fail on Conda Forge.

Version 0.15.3

02 Nov 15:54
46b9a04
Compare
Choose a tag to compare
  • [NEW] factory.get() can now create arrow objects from a ISO calendar tuple, for example:
    >>> arrow.get((2013, 18, 7))
    <Arrow [2013-05-05T00:00:00+00:00]>
  • [NEW] Added a new token x to allow parsing of integer timestamps with milliseconds and microseconds.
  • [NEW] Formatting now supports escaping of characters using the same syntax as parsing, for example:
    >>> arw = arrow.now()
    >>> fmt = "YYYY-MM-DD h [h] m"
    >>> arw.format(fmt)
    '2019-11-02 3 h 32'
  • [NEW] Added humanize week granularity translations for Chinese, Spanish and Vietnamese.
  • [CHANGE] Added ParserError to module exports.
  • [FIX] Added support for midnight at end of day. See #703 for details.
  • [INTERNAL] Created Travis build for macOS.
  • [INTERNAL] Test parsing and formatting against full timezone database.

Version 0.15.2

14 Sep 10:38
6785237
Compare
Choose a tag to compare
  • [NEW] Added humanize week granularity translations for Portuguese and Brazilian Portuguese.
  • [NEW] Embedded changelog within docs and added release dates to versions.
  • [FIX] Fixed a bug that caused test failures on Windows only, see #668 for details.