METADATA 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. Metadata-Version: 2.1
  2. Name: arrow
  3. Version: 0.15.6
  4. Summary: Better dates & times for Python
  5. Home-page: https://arrow.readthedocs.io
  6. Author: Chris Smith
  7. Author-email: crsmithdev@gmail.com
  8. License: Apache 2.0
  9. Project-URL: Repository, https://github.com/crsmithdev/arrow
  10. Project-URL: Bug Reports, https://github.com/crsmithdev/arrow/issues
  11. Project-URL: Documentation, https://arrow.readthedocs.io
  12. Keywords: arrow date time datetime timestamp timezone
  13. Platform: UNKNOWN
  14. Classifier: Development Status :: 4 - Beta
  15. Classifier: Intended Audience :: Developers
  16. Classifier: License :: OSI Approved :: Apache Software License
  17. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  18. Classifier: Programming Language :: Python :: 2
  19. Classifier: Programming Language :: Python :: 2.7
  20. Classifier: Programming Language :: Python :: 3
  21. Classifier: Programming Language :: Python :: 3.5
  22. Classifier: Programming Language :: Python :: 3.6
  23. Classifier: Programming Language :: Python :: 3.7
  24. Classifier: Programming Language :: Python :: 3.8
  25. Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
  26. Description-Content-Type: text/x-rst
  27. Requires-Dist: python-dateutil
  28. Requires-Dist: backports.functools-lru-cache (>=1.2.1) ; python_version == "2.7"
  29. Arrow: Better dates & times for Python
  30. ======================================
  31. .. start-inclusion-marker-do-not-remove
  32. .. image:: https://github.com/crsmithdev/arrow/workflows/tests/badge.svg?branch=master
  33. :alt: Build Status
  34. :target: https://github.com/crsmithdev/arrow/actions?query=workflow%3Atests+branch%3Amaster
  35. .. image:: https://codecov.io/github/crsmithdev/arrow/coverage.svg?branch=master
  36. :alt: Codecov
  37. :target: https://codecov.io/github/crsmithdev/arrow
  38. .. image:: https://img.shields.io/pypi/v/arrow.svg
  39. :alt: PyPI Version
  40. :target: https://pypi.python.org/pypi/arrow
  41. .. image:: https://img.shields.io/pypi/pyversions/arrow.svg
  42. :alt: Supported Python Versions
  43. :target: https://pypi.python.org/pypi/arrow
  44. .. image:: https://img.shields.io/pypi/l/arrow.svg
  45. :alt: License
  46. :target: https://pypi.python.org/pypi/arrow
  47. .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
  48. :alt: Code Style: Black
  49. :target: https://github.com/psf/black
  50. **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.
  51. 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>`_.
  52. Why use Arrow over built-in modules?
  53. ------------------------------------
  54. 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:
  55. - Too many modules: datetime, time, calendar, dateutil, pytz and more
  56. - Too many types: date, time, datetime, tzinfo, timedelta, relativedelta, etc.
  57. - Timezones and timestamp conversions are verbose and unpleasant
  58. - Timezone naivety is the norm
  59. - Gaps in functionality: ISO 8601 parsing, timespans, humanization
  60. Features
  61. --------
  62. - Fully-implemented, drop-in replacement for datetime
  63. - Supports Python 2.7, 3.5, 3.6, 3.7 and 3.8
  64. - Timezone-aware and UTC by default
  65. - Provides super-simple creation options for many common input scenarios
  66. - :code:`shift` method with support for relative offsets, including weeks
  67. - Formats and parses strings automatically
  68. - Wide support for ISO 8601
  69. - Timezone conversion
  70. - Timestamp available as a property
  71. - Generates time spans, ranges, floors and ceilings for time frames ranging from microsecond to year
  72. - Humanizes and supports a growing list of contributed locales
  73. - Extensible for your own Arrow-derived types
  74. Quick Start
  75. -----------
  76. Installation
  77. ~~~~~~~~~~~~
  78. To install Arrow, use `pip <https://pip.pypa.io/en/stable/quickstart/>`_ or `pipenv <https://docs.pipenv.org/en/latest/>`_:
  79. .. code-block:: console
  80. $ pip install -U arrow
  81. Example Usage
  82. ~~~~~~~~~~~~~
  83. .. code-block:: python
  84. >>> import arrow
  85. >>> arrow.get('2013-05-11T21:23:58.970460+07:00')
  86. <Arrow [2013-05-11T21:23:58.970460+07:00]>
  87. >>> utc = arrow.utcnow()
  88. >>> utc
  89. <Arrow [2013-05-11T21:23:58.970460+00:00]>
  90. >>> utc = utc.shift(hours=-1)
  91. >>> utc
  92. <Arrow [2013-05-11T20:23:58.970460+00:00]>
  93. >>> local = utc.to('US/Pacific')
  94. >>> local
  95. <Arrow [2013-05-11T13:23:58.970460-07:00]>
  96. >>> local.timestamp
  97. 1368303838
  98. >>> local.format()
  99. '2013-05-11 13:23:58 -07:00'
  100. >>> local.format('YYYY-MM-DD HH:mm:ss ZZ')
  101. '2013-05-11 13:23:58 -07:00'
  102. >>> local.humanize()
  103. 'an hour ago'
  104. >>> local.humanize(locale='ko_kr')
  105. '1시간 전'
  106. .. end-inclusion-marker-do-not-remove
  107. Documentation
  108. -------------
  109. For full documentation, please visit `arrow.readthedocs.io <https://arrow.readthedocs.io/en/latest/>`_.
  110. Contributing
  111. ------------
  112. 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:
  113. 1. Find an issue or feature to tackle on the `issue tracker <https://github.com/crsmithdev/arrow/issues>`_. Issues marked with the `"good first issue" label <https://github.com/crsmithdev/arrow/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22>`_ may be a great place to start!
  114. 2. Fork `this repository <https://github.com/crsmithdev/arrow>`_ on GitHub and begin making changes in a branch.
  115. 3. Add a few tests to ensure that the bug was fixed or the feature works as expected.
  116. 4. Submit a pull request and await feedback 😃.
  117. If you have any questions along the way, feel free to ask them `here <https://github.com/crsmithdev/arrow/issues/new?labels=question>`_.