1Metadata-Version: 2.1
2Name: arrow
3Version: 1.2.1
4Summary: Better dates & times for Python
5Home-page: https://arrow.readthedocs.io
6Author: Chris Smith
7Author-email: crsmithdev@gmail.com
8License: Apache 2.0
9Project-URL: Repository, https://github.com/arrow-py/arrow
10Project-URL: Bug Reports, https://github.com/arrow-py/arrow/issues
11Project-URL: Documentation, https://arrow.readthedocs.io
12Keywords: arrow date time datetime timestamp timezone humanize
13Platform: UNKNOWN
14Classifier: Development Status :: 5 - Production/Stable
15Classifier: Intended Audience :: Developers
16Classifier: License :: OSI Approved :: Apache Software License
17Classifier: Topic :: Software Development :: Libraries :: Python Modules
18Classifier: Programming Language :: Python :: 3
19Classifier: Programming Language :: Python :: 3 :: Only
20Classifier: Programming Language :: Python :: 3.6
21Classifier: Programming Language :: Python :: 3.7
22Classifier: Programming Language :: Python :: 3.8
23Classifier: Programming Language :: Python :: 3.9
24Classifier: Programming Language :: Python :: 3.10
25Requires-Python: >=3.6
26Description-Content-Type: text/x-rst
27License-File: LICENSE
28
29Arrow: Better dates & times for Python
30======================================
31
32.. start-inclusion-marker-do-not-remove
33
34.. image:: https://github.com/arrow-py/arrow/workflows/tests/badge.svg?branch=master
35   :alt: Build Status
36   :target: https://github.com/arrow-py/arrow/actions?query=workflow%3Atests+branch%3Amaster
37
38.. image:: https://codecov.io/gh/arrow-py/arrow/branch/master/graph/badge.svg
39   :alt: Coverage
40   :target: https://codecov.io/gh/arrow-py/arrow
41
42.. image:: https://img.shields.io/pypi/v/arrow.svg
43   :alt: PyPI Version
44   :target: https://pypi.python.org/pypi/arrow
45
46.. image:: https://img.shields.io/pypi/pyversions/arrow.svg
47   :alt: Supported Python Versions
48   :target: https://pypi.python.org/pypi/arrow
49
50.. image:: https://img.shields.io/pypi/l/arrow.svg
51   :alt: License
52   :target: https://pypi.python.org/pypi/arrow
53
54.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
55   :alt: Code Style: Black
56   :target: https://github.com/psf/black
57
58
59**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.
60
61Arrow 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>`_.
62
63Why use Arrow over built-in modules?
64------------------------------------
65
66Python'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:
67
68- Too many modules: datetime, time, calendar, dateutil, pytz and more
69- Too many types: date, time, datetime, tzinfo, timedelta, relativedelta, etc.
70- Timezones and timestamp conversions are verbose and unpleasant
71- Timezone naivety is the norm
72- Gaps in functionality: ISO 8601 parsing, timespans, humanization
73
74Features
75--------
76
77- Fully-implemented, drop-in replacement for datetime
78- Support for Python 3.6+
79- Timezone-aware and UTC by default
80- Super-simple creation options for many common input scenarios
81- ``shift`` method with support for relative offsets, including weeks
82- Format and parse strings automatically
83- Wide support for the `ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_ standard
84- Timezone conversion
85- Support for ``dateutil``, ``pytz``, and ``ZoneInfo`` tzinfo objects
86- Generates time spans, ranges, floors and ceilings for time frames ranging from microsecond to year
87- Humanize dates and times with a growing list of contributed locales
88- Extensible for your own Arrow-derived types
89- Full support for PEP 484-style type hints
90
91Quick Start
92-----------
93
94Installation
95~~~~~~~~~~~~
96
97To install Arrow, use `pip <https://pip.pypa.io/en/stable/quickstart/>`_ or `pipenv <https://docs.pipenv.org>`_:
98
99.. code-block:: console
100
101    $ pip install -U arrow
102
103Example Usage
104~~~~~~~~~~~~~
105
106.. code-block:: python
107
108    >>> import arrow
109    >>> arrow.get('2013-05-11T21:23:58.970460+07:00')
110    <Arrow [2013-05-11T21:23:58.970460+07:00]>
111
112    >>> utc = arrow.utcnow()
113    >>> utc
114    <Arrow [2013-05-11T21:23:58.970460+00:00]>
115
116    >>> utc = utc.shift(hours=-1)
117    >>> utc
118    <Arrow [2013-05-11T20:23:58.970460+00:00]>
119
120    >>> local = utc.to('US/Pacific')
121    >>> local
122    <Arrow [2013-05-11T13:23:58.970460-07:00]>
123
124    >>> local.timestamp()
125    1368303838.970460
126
127    >>> local.format()
128    '2013-05-11 13:23:58 -07:00'
129
130    >>> local.format('YYYY-MM-DD HH:mm:ss ZZ')
131    '2013-05-11 13:23:58 -07:00'
132
133    >>> local.humanize()
134    'an hour ago'
135
136    >>> local.humanize(locale='ko-kr')
137    '한시간 전'
138
139.. end-inclusion-marker-do-not-remove
140
141Documentation
142-------------
143
144For full documentation, please visit `arrow.readthedocs.io <https://arrow.readthedocs.io>`_.
145
146Contributing
147------------
148
149Contributions 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:
150
151#. 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!
152#. Fork `this repository <https://github.com/arrow-py/arrow>`_ on GitHub and begin making changes in a branch.
153#. Add a few tests to ensure that the bug was fixed or the feature works as expected.
154#. 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).
155#. Submit a pull request and await feedback ��.
156
157If you have any questions along the way, feel free to ask them `here <https://github.com/arrow-py/arrow/discussions>`_.
158
159Support Arrow
160-------------
161
162`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>`_.
163
164
165