arrow

🏹 Better dates & times for Python

https://github.com/arrow-py/arrow

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    6 of 284 committers (2.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.7%) to scientific vocabulary

Keywords

arrow date datetime hacktoberfest python time timestamp timezones

Keywords from Contributors

closember unit-testing static-analysis test-data-generator test-data faker-generator pypi pydantic json-schema static-code-analysis
Last synced: 6 months ago · JSON representation

Repository

🏹 Better dates & times for Python

Basic Info
  • Host: GitHub
  • Owner: arrow-py
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage: https://arrow.readthedocs.io
  • Size: 2.2 MB
Statistics
  • Stars: 8,908
  • Watchers: 135
  • Forks: 691
  • Open Issues: 107
  • Releases: 45
Topics
arrow date datetime hacktoberfest python time timestamp timezones
Created over 13 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Funding License

README.rst

Arrow: Better dates & times for Python
======================================

.. start-inclusion-marker-do-not-remove

.. image:: https://github.com/arrow-py/arrow/workflows/tests/badge.svg?branch=master
   :alt: Build Status
   :target: https://github.com/arrow-py/arrow/actions?query=workflow%3Atests+branch%3Amaster

.. image:: https://codecov.io/gh/arrow-py/arrow/branch/master/graph/badge.svg
   :alt: Coverage
   :target: https://codecov.io/gh/arrow-py/arrow

.. image:: https://img.shields.io/pypi/v/arrow.svg
   :alt: PyPI Version
   :target: https://pypi.python.org/pypi/arrow

.. image:: https://img.shields.io/pypi/pyversions/arrow.svg
   :alt: Supported Python Versions
   :target: https://pypi.python.org/pypi/arrow

.. image:: https://img.shields.io/pypi/l/arrow.svg
   :alt: License
   :target: https://pypi.python.org/pypi/arrow

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :alt: Code Style: Black
   :target: https://github.com/psf/black


**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.

Arrow is named after the `arrow of time `_ and is heavily inspired by `moment.js `_ and `requests `_.

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 more
- Too many types: date, time, datetime, tzinfo, timedelta, relativedelta, etc.
- Timezones and timestamp conversions are verbose and unpleasant
- Timezone naivety is the norm
- Gaps in functionality: ISO 8601 parsing, timespans, humanization

Features
--------

- Fully-implemented, drop-in replacement for datetime
- Support for Python 3.8+
- Timezone-aware and UTC by default
- Super-simple creation options for many common input scenarios
- ``shift`` method with support for relative offsets, including weeks
- Format and parse strings automatically
- Wide support for the `ISO 8601 `_ standard
- Timezone conversion
- Support for ``dateutil``, ``pytz``, and ``ZoneInfo`` tzinfo objects
- Generates time spans, ranges, floors and ceilings for time frames ranging from microsecond to year
- Humanize dates and times with a growing list of contributed locales
- Extensible for your own Arrow-derived types
- Full support for PEP 484-style type hints

Quick Start
-----------

Installation
~~~~~~~~~~~~

To install Arrow, use `pip `_ or `pipenv `_:

.. code-block:: console

    $ pip install -U arrow

Example Usage
~~~~~~~~~~~~~

.. code-block:: python

    >>> import arrow
    >>> arrow.get('2013-05-11T21:23:58.970460+07:00')
    

    >>> utc = arrow.utcnow()
    >>> utc
    

    >>> utc = utc.shift(hours=-1)
    >>> utc
    

    >>> local = utc.to('US/Pacific')
    >>> local
    

    >>> 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')
    '한시간 전'

.. end-inclusion-marker-do-not-remove

Documentation
-------------

For full documentation, please visit `arrow.readthedocs.io `_.

Contributing
------------

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:

#. Find an issue or feature to tackle on the `issue tracker `_. Issues marked with the `"good first issue" label `_ may be a great place to start!
#. Fork `this repository `_ on 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 -e lint,docs`` (if you have `tox `_ 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).
#. Submit a pull request and await feedback 😃.

If you have any questions along the way, feel free to ask them `here `_.

Support Arrow
-------------

`Open Collective `_ 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 `_.

Owner

  • Name: Arrow
  • Login: arrow-py
  • Kind: organization

GitHub Events

Total
  • Issues event: 14
  • Watch event: 213
  • Delete event: 8
  • Issue comment event: 53
  • Push event: 27
  • Pull request review comment event: 12
  • Pull request review event: 42
  • Pull request event: 42
  • Fork event: 30
  • Create event: 9
Last Year
  • Issues event: 14
  • Watch event: 213
  • Delete event: 8
  • Issue comment event: 53
  • Push event: 27
  • Pull request review comment event: 12
  • Pull request review event: 42
  • Pull request event: 42
  • Fork event: 30
  • Create event: 9

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 1,110
  • Total Committers: 284
  • Avg Commits per committer: 3.908
  • Development Distribution Score (DDS): 0.82
Past Year
  • Commits: 25
  • Committers: 15
  • Avg Commits per committer: 1.667
  • Development Distribution Score (DDS): 0.8
Top Committers
Name Email Commits
Jad Chaar j****r@g****m 200
Chris Smith c****v@g****m 142
Chris Smith c****s@c****a 127
systemcatch 3****h 75
Kristijan "Fremen" Velkovski me@k****m 34
Andrew Elkins g****2@a****m 32
Anish Nyayachavadi 5****a 16
cyriaka90 j****r@a****m 15
Dillon Dixon d****n@g****m 11
Sye van der Veen s****e@g****a 11
zcribe d****e@o****m 8
xtreak t****i@g****m 6
Chris Haines c****s@g****m 6
adil b****s@t****m 5
Joseph Kahn j****n@g****m 5
Pavel Dmitriev p****v@n****m 5
Renzo g****n@g****m 5
Samer Atiani s****i@g****m 5
Sye van der Veen s****n@g****m 5
Elaheh Salehi Rizi e****i@a****m 5
kkoziara t****c@g****m 5
gruebel a****l@g****m 5
dependabot[bot] 4****] 5
andrewchouman a****n@u****u 5
Buck Evan b****k@y****m 5
ChingYi-AX 8****X 4
Zakhar Zibarov z****v@g****m 4
Miroslav Šedivý 6****o 4
Alexander Raginsky a****y@g****m 4
Ankur Dedania A****R@g****m 4
and 254 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 73
  • Total pull requests: 107
  • Average time to close issues: 8 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 63
  • Total pull request authors: 61
  • Average comments per issue: 3.14
  • Average comments per pull request: 1.59
  • Merged pull requests: 68
  • Bot issues: 0
  • Bot pull requests: 6
Past Year
  • Issues: 7
  • Pull requests: 31
  • Average time to close issues: 4 days
  • Average time to close pull requests: about 1 month
  • Issue authors: 6
  • Pull request authors: 14
  • Average comments per issue: 1.14
  • Average comments per pull request: 0.87
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 6
Top Authors
Issue Authors
  • anishnya (5)
  • systemcatch (4)
  • kloczek (2)
  • rtphokie (2)
  • rikfie (1)
  • swxs (1)
  • Distortedlogic (1)
  • razzeee (1)
  • marc-fouquet (1)
  • isac322 (1)
  • da-head0 (1)
  • As-Sulamy (1)
  • reagle (1)
  • barneygale (1)
  • Swizzler121 (1)
Pull Request Authors
  • jadchaar (19)
  • krisfremen (12)
  • dependabot[bot] (11)
  • psyuktha (4)
  • saranti (4)
  • pothitos (4)
  • gruebel (3)
  • systemcatch (3)
  • yangs1202 (2)
  • rettinghaus (2)
  • 13MK3 (2)
  • Shaileshsaravanan (2)
  • cyriaka90 (2)
  • fremzuck (2)
  • ManiMozaffar (2)
Top Labels
Issue Labels
bug (36) enhancement (17) documentation (7) good first issue (4) question (3) bug unconfirmed (1) performance (1) question for community (1) localization (1) note (1) proposal (1)
Pull Request Labels
dependencies (11) hacktoberfest-accepted (1) github_actions (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 48,137,303 last-month
  • Total docker downloads: 2,583,016,632
  • Total dependent packages: 588
    (may contain duplicates)
  • Total dependent repositories: 15,886
    (may contain duplicates)
  • Total versions: 77
  • Total maintainers: 4
pypi.org: arrow

Better dates & times for Python

  • Versions: 64
  • Dependent Packages: 584
  • Dependent Repositories: 15,768
  • Downloads: 48,137,303 Last month
  • Docker Downloads: 2,583,016,632
Rankings
Docker downloads count: 0.0%
Downloads: 0.0%
Dependent packages count: 0.0%
Dependent repos count: 0.1%
Average: 0.5%
Stargazers count: 0.6%
Forks count: 2.4%
Last synced: 6 months ago
anaconda.org: arrow

Arrow is a Python library that offers a sensible, 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 provides 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.

  • Versions: 13
  • Dependent Packages: 4
  • Dependent Repositories: 118
Rankings
Stargazers count: 9.0%
Forks count: 13.5%
Dependent repos count: 17.6%
Average: 20.3%
Dependent packages count: 41.0%
Last synced: 6 months ago

Dependencies

requirements/requirements-docs.txt pypi
  • doc8 *
  • sphinx *
  • sphinx-autobuild *
  • sphinx-autodoc-typehints *
requirements/requirements-tests.txt pypi
  • dateparser ==1.
  • pre-commit *
  • pytest *
  • pytest-cov *
  • pytest-mock *
  • python-dateutil >=2.7.0
  • pytz ==2021.1
  • simplejson ==3.
  • typing_extensions *
requirements/requirements.txt pypi
  • python-dateutil >=2.7.0
  • typing_extensions *
.github/workflows/continuous_integration.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v3 composite
.github/workflows/release.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • python-dateutil >=2.7.0
  • types-python-dateutil >=2.8.10