arrow-py / arrow-py/arrow

support dates like "next tuesday"

Open
#1,100 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
9.1k
Forks
784
PR merge metrics
No merged PRs in 30d

Description

## Feature Request

It would be great if arrow supported more human-readable date specifications like "next tuesday" or "previous year"... This is something only parsedatetime does right now, as far as I know.

```
anarcat@curie:undertime(main)$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
>>> arrow.__version__
'1.2.1'
>>> arrow.utcnow().dehumanize("next tuesday")
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3/dist-packages/arrow/arrow.py", line 1421, in dehumanize
raise ValueError(
ValueError: Input string not valid. Note: Some locales do not support the week granulairty in Arrow. If you are attempting to use the week granularity on an unsupported locale, this could be the cause of this error.
>>>
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported failure at arrow.utcnow().dehumanize("next tuesday") and inspect the existing dehumanize parsing path. Determine how the requested human-readable specifications should be interpreted, then verify that examples such as "next tuesday" and "previous year" are accepted without breaking existing inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.