scrapinghub / scrapinghub/dateparser

Enhancement: Let dateparser.parse take multiple strings to narrow down guesses

Open
#1,167 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
520
Avg merge
22h 56m
Merged PRs (30d)
6

Description

Let's say we have 3 date strings, 2 of them with ambiguous format and the last with unambiguous format:
2015/1/1
2015/2/3
2015/31/12
If we can pass these 3 date strings into dateparser.parse altogether at once, then the first 2 date strings can be parsed confidently because of the strong hint from the 3rd date string. This will be very useful for guessing the format of date-like fields from csv files. Something like https://github.com/hi-primus/hi-dateinfer

Is this actually already achievable with the current dateparser?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dateparser.parse entry point and compare its current behavior on the three example strings. Review the linked hi-dateinfer project for the proposed multi-string inference approach. Done means determining whether the existing API already supports this and, if not, defining support for parsing multiple strings together so unambiguous values can guide ambiguous ones.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.