Package: arrow
Arrowis 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.Arrow is named after thearrow of timeand is heavily inspired bymoment.jsandrequests.Why use Arrow over built-in modules?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:Too many modules: datetime, time, calendar, dateutil, pytz and moreToo many types: date, time, datetime, tzinfo, timedelta, relativedelta, etc.Timezones and timestamp conversions are verbose and unpleasantTimezone naivety is the normGaps in functionality: ISO 8601 parsing, timespans, humanizationFeaturesFully-implemented, drop-in replacement for datetimeSupport for Python 3.6+Timezone-aware and UTC by defaultSuper-simple creation options for many common input scenariosshiftmethod with support for relative offsets, including weeksFormat and parse strings automaticallyWide support for theISO 8601standardTimezone conversionSupport fordateutil,pytz, andZoneInfotzinfo objectsGenerates time spans, ranges, floors and ceilings for time frames ranging from microsecond to yearHumanize dates and times with a growing list of contributed localesExtensible for your own Arrow-derived typesFull support for PEP 484-style type hintsQuick StartInstallationTo install Arrow, usepiporpipenv:$pipinstall-UarrowExample Usage>>>importarrow>>>arrow.get('2013-05-11T21:23:58.970460+07:00')<Arrow[2013-05-11T21:23:58.970460+07:00]>>>>utc=arrow.utcnow()>>>utc<Arrow[2013-05-11T21:23:58.970460+00:00]>>>>utc=utc.shift(hours=-1)>>>utc<Arrow[2013-05-11T20:23:58.970460+00:00]>>>>local=utc.to('US/Pacific')>>>local<Arrow[2013-05-11T13:23:58.970460-07:00]>>>>local.timestamp()1368303838.970460>>>local.format()'2013-05-11 13:23:58 -07:00'>>>local.format('YYYY-MM-DD HH:mm:ss ZZ')'2013-05-11 13:23:58 -07:00'>>>local.humanize()'an hour ago'>>>local.humanize(locale='ko-kr')'한시간 전'DocumentationFor full documentation, please visitarrow.readthedocs.io.ContributingContributions 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:Find an issue or feature to tackle on theissue tracker. Issues marked with the“good first issue” labelmay be a great place to start!Forkthis repositoryon GitHub and begin making changes in a branch.Add a few tests to ensure that the bug was fixed or the feature works as expected.Run the entire test suite and linting checks by running one of the following commands:tox && tox-elint,docs(if you havetoxinstalled)ORmake build39 && make test && make lint(if you do not have Python 3.9 installed, replacebuild39with the latest Python version on your system).Submit a pull request and await feedback 😃.If you have any questions along the way, feel free to ask themhere.Support ArrowOpen Collectiveis 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 theArrow collective.