METADATA 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. Metadata-Version: 2.4
  2. Name: arrow
  3. Version: 1.4.0
  4. Summary: Better dates & times for Python
  5. Keywords: arrow,date,time,datetime,timestamp,timezone,humanize
  6. Author-email: Chris Smith <crsmithdev@gmail.com>
  7. Requires-Python: >=3.8
  8. Description-Content-Type: text/x-rst
  9. Classifier: Development Status :: 5 - Production/Stable
  10. Classifier: Intended Audience :: Developers
  11. Classifier: Intended Audience :: Information Technology
  12. Classifier: License :: OSI Approved :: Apache Software License
  13. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  14. Classifier: Programming Language :: Python :: 3
  15. Classifier: Programming Language :: Python :: 3 :: Only
  16. Classifier: Programming Language :: Python :: 3.8
  17. Classifier: Programming Language :: Python :: 3.9
  18. Classifier: Programming Language :: Python :: 3.10
  19. Classifier: Programming Language :: Python :: 3.11
  20. Classifier: Programming Language :: Python :: 3.12
  21. Classifier: Programming Language :: Python :: 3.13
  22. Classifier: Programming Language :: Python :: 3.14
  23. Classifier: Operating System :: OS Independent
  24. License-File: LICENSE
  25. Requires-Dist: python-dateutil>=2.7.0
  26. Requires-Dist: backports.zoneinfo==0.2.1;python_version<'3.9'
  27. Requires-Dist: tzdata;python_version>='3.9'
  28. Requires-Dist: doc8 ; extra == "doc"
  29. Requires-Dist: sphinx>=7.0.0 ; extra == "doc"
  30. Requires-Dist: sphinx-autobuild ; extra == "doc"
  31. Requires-Dist: sphinx-autodoc-typehints ; extra == "doc"
  32. Requires-Dist: sphinx_rtd_theme>=1.3.0 ; extra == "doc"
  33. Requires-Dist: dateparser==1.* ; extra == "test"
  34. Requires-Dist: pre-commit ; extra == "test"
  35. Requires-Dist: pytest ; extra == "test"
  36. Requires-Dist: pytest-cov ; extra == "test"
  37. Requires-Dist: pytest-mock ; extra == "test"
  38. Requires-Dist: pytz==2025.2 ; extra == "test"
  39. Requires-Dist: simplejson==3.* ; extra == "test"
  40. Project-URL: Documentation, https://arrow.readthedocs.io
  41. Project-URL: Issues, https://github.com/arrow-py/arrow/issues
  42. Project-URL: Source, https://github.com/arrow-py/arrow
  43. Provides-Extra: doc
  44. Provides-Extra: test
  45. Arrow: Better dates & times for Python
  46. ======================================
  47. .. start-inclusion-marker-do-not-remove
  48. .. image:: https://github.com/arrow-py/arrow/workflows/tests/badge.svg?branch=master
  49. :alt: Build Status
  50. :target: https://github.com/arrow-py/arrow/actions?query=workflow%3Atests+branch%3Amaster
  51. .. image:: https://codecov.io/gh/arrow-py/arrow/branch/master/graph/badge.svg
  52. :alt: Coverage
  53. :target: https://codecov.io/gh/arrow-py/arrow
  54. .. image:: https://img.shields.io/pypi/v/arrow.svg
  55. :alt: PyPI Version
  56. :target: https://pypi.python.org/pypi/arrow
  57. .. image:: https://img.shields.io/pypi/pyversions/arrow.svg
  58. :alt: Supported Python Versions
  59. :target: https://pypi.python.org/pypi/arrow
  60. .. image:: https://img.shields.io/pypi/l/arrow.svg
  61. :alt: License
  62. :target: https://pypi.python.org/pypi/arrow
  63. .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
  64. :alt: Code Style: Black
  65. :target: https://github.com/psf/black
  66. **Arrow** is a Python library that offers a sensible and human-friendly approach to creating, manipulating, formatting and converting dates, times and timestamps. It implements and updates the datetime type, plugging gaps in functionality and providing an intelligent module API that supports many common creation scenarios. Simply put, it helps you work with dates and times with fewer imports and a lot less code.
  67. Arrow is named after the `arrow of time <https://en.wikipedia.org/wiki/Arrow_of_time>`_ and is heavily inspired by `moment.js <https://github.com/moment/moment>`_ and `requests <https://github.com/psf/requests>`_.
  68. Why use Arrow over built-in modules?
  69. ------------------------------------
  70. Python's standard library and some other low-level modules have near-complete date, time and timezone functionality, but don't work very well from a usability perspective:
  71. - Too many modules: datetime, time, calendar, dateutil, pytz and more
  72. - Too many types: date, time, datetime, tzinfo, timedelta, relativedelta, etc.
  73. - Timezones and timestamp conversions are verbose and unpleasant
  74. - Timezone naivety is the norm
  75. - Gaps in functionality: ISO 8601 parsing, timespans, humanization
  76. Features
  77. --------
  78. - Fully-implemented, drop-in replacement for datetime
  79. - Support for Python 3.8+
  80. - Timezone-aware and UTC by default
  81. - Super-simple creation options for many common input scenarios
  82. - ``shift`` method with support for relative offsets, including weeks
  83. - Format and parse strings automatically
  84. - Wide support for the `ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_ standard
  85. - Timezone conversion
  86. - Support for ``dateutil``, ``pytz``, and ``ZoneInfo`` tzinfo objects
  87. - Generates time spans, ranges, floors and ceilings for time frames ranging from microsecond to year
  88. - Humanize dates and times with a growing list of contributed locales
  89. - Extensible for your own Arrow-derived types
  90. - Full support for PEP 484-style type hints
  91. Quick Start
  92. -----------
  93. Installation
  94. ~~~~~~~~~~~~
  95. To install Arrow, use `pip <https://pip.pypa.io/en/stable/quickstart/>`_ or `pipenv <https://docs.pipenv.org>`_:
  96. .. code-block:: console
  97. $ pip install -U arrow
  98. Example Usage
  99. ~~~~~~~~~~~~~
  100. .. code-block:: python
  101. >>> import arrow
  102. >>> arrow.get('2013-05-11T21:23:58.970460+07:00')
  103. <Arrow [2013-05-11T21:23:58.970460+07:00]>
  104. >>> utc = arrow.utcnow()
  105. >>> utc
  106. <Arrow [2013-05-11T21:23:58.970460+00:00]>
  107. >>> utc = utc.shift(hours=-1)
  108. >>> utc
  109. <Arrow [2013-05-11T20:23:58.970460+00:00]>
  110. >>> local = utc.to('US/Pacific')
  111. >>> local
  112. <Arrow [2013-05-11T13:23:58.970460-07:00]>
  113. >>> local.timestamp()
  114. 1368303838.970460
  115. >>> local.format()
  116. '2013-05-11 13:23:58 -07:00'
  117. >>> local.format('YYYY-MM-DD HH:mm:ss ZZ')
  118. '2013-05-11 13:23:58 -07:00'
  119. >>> local.humanize()
  120. 'an hour ago'
  121. >>> local.humanize(locale='ko-kr')
  122. '한시간 전'
  123. .. end-inclusion-marker-do-not-remove
  124. Documentation
  125. -------------
  126. For full documentation, please visit `arrow.readthedocs.io <https://arrow.readthedocs.io>`_.
  127. Contributing
  128. ------------
  129. Contributions are welcome for both code and localizations (adding and updating locales). Begin by gaining familiarity with the Arrow library and its features. Then, jump into contributing:
  130. #. Find an issue or feature to tackle on the `issue tracker <https://github.com/arrow-py/arrow/issues>`_. Issues marked with the `"good first issue" label <https://github.com/arrow-py/arrow/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22>`_ may be a great place to start!
  131. #. Fork `this repository <https://github.com/arrow-py/arrow>`_ on GitHub and begin making changes in a branch.
  132. #. Add a few tests to ensure that the bug was fixed or the feature works as expected.
  133. #. Run the entire test suite and linting checks by running one of the following commands: ``tox && tox -e lint,docs`` (if you have `tox <https://tox.readthedocs.io>`_ installed) **OR** ``make build39 && make test && make lint`` (if you do not have Python 3.9 installed, replace ``build39`` with the latest Python version on your system).
  134. #. Submit a pull request and await feedback 😃.
  135. If you have any questions along the way, feel free to ask them `here <https://github.com/arrow-py/arrow/discussions>`_.
  136. Support Arrow
  137. -------------
  138. `Open Collective <https://opencollective.com/>`_ is an online funding platform that provides tools to raise money and share your finances with full transparency. It is the platform of choice for individuals and companies to make one-time or recurring donations directly to the project. If you are interested in making a financial contribution, please visit the `Arrow collective <https://opencollective.com/arrow>`_.