scrapinghub / scrapinghub/dateparser

How to know when a date is incomplete and the missing parts

Open
#700 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is there a way to know when a date is incomplete. e.g "December 2015"

from dateparser import parse
parse(u'December 2015')  # default behavior
datetime.datetime(2015, 12, 16, 0, 0)
#is a way to do something like this
parse(u'December 2015', settings={'PREFER_DAY_OF_MONTH': 'incomplete'}) 
datetime.datetime(2015, 12, incomplete, 0, 0)
#the same with year or month

I need to parse data wich contains incomplete dates, in a nutshell i need the following to be done

from dateparser import parse
parse(u'December 2015', settings={'PREFER_DAY_OF_MONTH': 'incomplete'})  #it could be a string or other type
datetime.datetime(2015, 12, incomplete, 0, 0)

i´m sorry about my english, im self taught in it...

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 the existing settings behavior for inputs such as "December 2015". Clarify how incomplete year, month, or day values should be represented, then define acceptance cases for detecting missing parts without relying on the default filled date. Done means the behavior and return type are specified and covered for the incomplete-date examples.

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.