My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Older

  • Sep 13, 2009
    Examples Wiki page commented on by tsagias   -   The two import lines missing: {{{ import parsedatetime.parsedatetime as pdt import parsedatetime.parsedatetime_consts as pdc }}}
    The two import lines missing: {{{ import parsedatetime.parsedatetime as pdt import parsedatetime.parsedatetime_consts as pdc }}}
  • Sep 07, 2009
    r88 (Created branches/python25 from current trunk to save the cur...) committed by bear42   -   Created branches/python25 from current trunk to save the current code Converted trunk to Python 3 and also refactored how the module is structured so that it no longer requires import parsedatetime.parsedatetime Bumped version to 1.0.0 to reflect the major refactoring
    Created branches/python25 from current trunk to save the current code Converted trunk to Python 3 and also refactored how the module is structured so that it no longer requires import parsedatetime.parsedatetime Bumped version to 1.0.0 to reflect the major refactoring
  • Sep 06, 2009
    r87 (Preparing for v3 changes Copying current trunk to branches/p...) committed by bear42   -   Preparing for v3 changes Copying current trunk to branches/python25 in case I have to backport any bugs
    Preparing for v3 changes Copying current trunk to branches/python25 in case I have to backport any bugs
  • Mar 02, 2009
    issue 25 (Comparing parsed datetime to python datetime) commented on by celisyn   -   bit late -- but this may be a little cleaner syntactically dt_tuple, flag = p.parse('today') result = datetime(*dt_tuple[:6])
    bit late -- but this may be a little cleaner syntactically dt_tuple, flag = p.parse('today') result = datetime(*dt_tuple[:6])
  • Mar 02, 2009
    issue 31 (Month parsing yields a date from the next year if we are pas...) commented on by celisyn   -   using version 0.8.7
    using version 0.8.7
  • Mar 02, 2009
    issue 31 (Month parsing yields a date from the next year if we are pas...) commented on by celisyn   -   forgot to mention that I'm using v0.8.6
    forgot to mention that I'm using v0.8.6
  • Mar 02, 2009
    issue 31 (Month parsing yields a date from the next year if we are pas...) reported by celisyn   -   Not sure if this is desired behavior -- seems strange to me. For instance, given the current date - March 2, 2009 >>> p.parse('Feb') ((2010, 2, 1, 1,...), 1) >>> p.parse('Feb 2009') ((2009, 2, 20, 1,...), 1) >>> p.parse('April') ((2009, 4, 1, 1,...), 1) There is a mismatch in the third value of the datetime tuples as well.
    Not sure if this is desired behavior -- seems strange to me. For instance, given the current date - March 2, 2009 >>> p.parse('Feb') ((2010, 2, 1, 1,...), 1) >>> p.parse('Feb 2009') ((2009, 2, 20, 1,...), 1) >>> p.parse('April') ((2009, 4, 1, 1,...), 1) There is a mismatch in the third value of the datetime tuples as well.
  • Feb 27, 2009
    issue 29 (The English event parser doesn't recognise "day month" forma...) commented on by alan.jones   -   US English date format is month-day but in international English markets (UK, CA, AU, NZ, IN, etc) the standard format is day-month.
    US English date format is month-day but in international English markets (UK, CA, AU, NZ, IN, etc) the standard format is day-month.
  • Feb 23, 2009
    issue 30 (Output of datetime.date.strftime("%A, %B %d, %Y") parsed inc...) reported by jens.knutson   -   What steps will reproduce the problem? 1. Create a datetime.date object (d) that's more than 1 week into the future 2. Pass the output of d.strftime("%A, %B %d, %Y") to Calendar.parse() 3. parse() returns the next weekday that matches the %A portion of the string, instead of looking at the whole date Example: >>> import parsedatetime.parsedatetime as pdt >>> import datetime >>> pdtCal = pdt.Calendar() >>> d = datetime.date(2009, 4, 5) >>> d.strftime("%A, %B %d, %Y") 'Sunday, April 05, 2009' >>> pdtCal.parse(d.strftime("%A, %B %d, %Y")) ((2009, 3, 1, 23, 2, 2, 6, 60, -1), 1) What is the expected output? What do you see instead? Expected output for 'Sunday, April 05, 2009': ((2009, 4, 5, 23, 2, 2, 6, 60, -1), 1) What I get instead: ((2009, 3, 1, 23, 2, 2, 6, 60, -1), 1) What version of the product are you using? On what operating system? 0.8.7 on Fedora 10
    What steps will reproduce the problem? 1. Create a datetime.date object (d) that's more than 1 week into the future 2. Pass the output of d.strftime("%A, %B %d, %Y") to Calendar.parse() 3. parse() returns the next weekday that matches the %A portion of the string, instead of looking at the whole date Example: >>> import parsedatetime.parsedatetime as pdt >>> import datetime >>> pdtCal = pdt.Calendar() >>> d = datetime.date(2009, 4, 5) >>> d.strftime("%A, %B %d, %Y") 'Sunday, April 05, 2009' >>> pdtCal.parse(d.strftime("%A, %B %d, %Y")) ((2009, 3, 1, 23, 2, 2, 6, 60, -1), 1) What is the expected output? What do you see instead? Expected output for 'Sunday, April 05, 2009': ((2009, 4, 5, 23, 2, 2, 6, 60, -1), 1) What I get instead: ((2009, 3, 1, 23, 2, 2, 6, 60, -1), 1) What version of the product are you using? On what operating system? 0.8.7 on Fedora 10
  • Feb 21, 2009
    issue 29 (The English event parser doesn't recognise "day month" forma...) reported by gnperumal   -   What steps will reproduce the problem? 1. 12 jan 2. 12 Jan 3. 12 January What is the expected output? Need exact date What do you see instead? Junk date What version of the product are you using? On what operating system? Linux Please provide any additional information below.
    What steps will reproduce the problem? 1. 12 jan 2. 12 Jan 3. 12 January What is the expected output? Need exact date What do you see instead? Junk date What version of the product are you using? On what operating system? Linux Please provide any additional information below.
  • Feb 16, 2009
    issue 28 (Noon-crossing time ranges) reported by jameshugman   -   Date range "Aug 16th 10-2pm" is parsed as 10pm-2pm. Date range "Aug 16th 10am-2pm" is parsed as expected. Date range "Aug 16th 1000-1400" is parsed as 16 Aug 1000, at 1400. Date range "Aug 16th 10-12am" is parsed with correct start. Version: parsedatetime 0.8.6 Thanks, great library.
    Date range "Aug 16th 10-2pm" is parsed as 10pm-2pm. Date range "Aug 16th 10am-2pm" is parsed as expected. Date range "Aug 16th 1000-1400" is parsed as 16 Aug 1000, at 1400. Date range "Aug 16th 10-12am" is parsed with correct start. Version: parsedatetime 0.8.6 Thanks, great library.
  • Jan 09, 2009
    r86 (bumping revision to 0.8.8 and also updating to latest ez_set...) committed by bear42   -   bumping revision to 0.8.8 and also updating to latest ez_setup file
    bumping revision to 0.8.8 and also updating to latest ez_setup file
  • Jan 09, 2009
    parsedatetime-0.8.7-py2.4.egg (Python 2.4 egg) file uploaded by bear42   -  
    Labels: Type-Package OpSys-All Featured
    Labels: Type-Package OpSys-All Featured
  • Jan 09, 2009
    parsedatetime-0.8.7-py2.5.egg (Python 2.5 egg) file uploaded by bear42   -  
    Labels: Type-Package OpSys-All Featured
    Labels: Type-Package OpSys-All Featured
  • Jan 09, 2009
    parsedatetime-0.8.7.tar.gz (source tarball) file uploaded by bear42   -  
    Labels: Type-Source OpSys-All Featured
    Labels: Type-Source OpSys-All Featured
  • Jan 09, 2009
    r85 ( 0.8.7 release Apply patch submitted by Michael Lim to fix t...) committed by bear42   -   0.8.7 release Apply patch submitted by Michael Lim to fix the problem parsedatetime was having handling dates when the month day preceeded the month Issue 26 http://code.google.com/p/parsedatetime/issues/detail?id=26 Fixed TestErrors when in a local where the bad date actually returns a date ;) Checked in the TestGermanLocale unit test file missed from previous commit
    0.8.7 release Apply patch submitted by Michael Lim to fix the problem parsedatetime was having handling dates when the month day preceeded the month Issue 26 http://code.google.com/p/parsedatetime/issues/detail?id=26 Fixed TestErrors when in a local where the bad date actually returns a date ;) Checked in the TestGermanLocale unit test file missed from previous commit
  • Jan 07, 2009
    issue 26 (Does not allow day of month to be before month) commented on by lim.ck.michael   -   This patch should also fix issue 24.
    This patch should also fix issue 24.
  • Jan 06, 2009
    issue 26 (Does not allow day of month to be before month) Status changed by bear42   -   applied the patch and will roll out 0.8.7
    Status: Fixed
    applied the patch and will roll out 0.8.7
    Status: Fixed
  • Jan 06, 2009
    issue 26 (Does not allow day of month to be before month) commented on by lim.ck.michael   -   Hi, I looked around in SVN and could not find any updates since April 2008. Therefore I have fixed this issue, and added a test case for this issue. diff -Naur parsedatetime/parsedatetime.py parsedatetime.new/parsedatetime.py --- parsedatetime/parsedatetime.py 2008-04-21 14:19:50.000000000 +0800 +++ parsedatetime.new/parsedatetime.py 2009-01-07 07:06:14.000000000 +0800 @@ -1245,9 +1245,18 @@ parseStr = s if parseStr == '': + valid_date = False + for match in self.ptc.CRE_DATE3.finditer(s): + # to prevent "HH:MM(:SS) time strings" expressions from triggering + # this regex, we checks if the month field exists in the searched + # expression, if it doesn't exist, the date field is not valid + if match.group('mthname'): + m = self.ptc.CRE_DATE3.search(s, match.start()) + valid_date = True + break + # String date format - m = self.ptc.CRE_DATE3.search(s) - if m is not None: + if valid_date: self.dateStrFlag = True self.dateFlag = 1 if (m.group('date') != s): diff -Naur parsedatetime/parsedatetime_consts.py parsedatetime.new/parsedatetime_consts.py --- parsedatetime/parsedatetime_consts.py 2008-04-21 14:01:22.000000000 +0800 +++ parsedatetime.new/parsedatetime_consts.py 2009-01-07 07:06:46.000000000 +0800 @@ -721,8 +721,9 @@ # ((?P<day>\d\d?)(\s?|%(daysuffix)s|$)+)? # (,\s?(?P<year>\d\d(\d\d)?))?)) # (\s?|$|[^0-9a-zA-Z])''' % ptc.re_values - ptc.RE_DATE3 = r'''(?P<date>((?P<mthname>(%(months)s|%(shortmonths)s))\s? - ((?P<day>\d\d?)(?P<suffix>%(daysuffix)s)?)? + ptc.RE_DATE3 = r'''(?P<date>( + (((?P<mthname>(%(months)s|%(shortmonths)s))| + ((?P<day>\d\d?)(?P<suffix>%(daysuffix)s)?))(\s)?){1,2} ((,)?(\s)?(?P<year>\d\d(\d\d)?))? ) )''' % ptc.re_values diff -Naur parsedatetime/tests/TestComplexDateTimes.py parsedatetime.new/tests/TestComplexDateTimes.py --- parsedatetime/tests/TestComplexDateTimes.py 2007-02-22 16:24:22.000000000 +0800 +++ parsedatetime.new/tests/TestComplexDateTimes.py 2009-01-07 11:42:36.000000000 +0800 @@ -37,6 +37,10 @@ self.assertTrue(_compareResults(self.cal.parse('5pm August 25th, 2006', start), (target, 3))) self.assertTrue(_compareResults(self.cal.parse('Aug 25, 2006 5pm', start), (target, 3))) self.assertTrue(_compareResults(self.cal.parse('Aug 25th, 2006 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('5pm 25 August, 2006', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('5pm 25th August, 2006', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('25 Aug, 2006 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('25th Aug 2006, 5pm', start), (target, 3))) if self.mth > 8 or (self.mth == 8 and self.dy > 5): target = datetime.datetime(self.yr + 1, 8, 5, 17, 0, 0).timetuple() @@ -51,7 +55,11 @@ self.assertTrue(_compareResults(self.cal.parse('5pm Aug 05', start), (target, 3))) self.assertTrue(_compareResults(self.cal.parse('Aug 05 5pm', start), (target, 3))) self.assertTrue(_compareResults(self.cal.parse('Aug 05th 5pm', start), (target, 3))) - + self.assertTrue(_compareResults(self.cal.parse('5 August 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('5th August 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('5pm 05 Aug', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('05 Aug 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('05th Aug 5pm', start), (target, 3))) if __name__ == "__main__": unittest.main()
    Hi, I looked around in SVN and could not find any updates since April 2008. Therefore I have fixed this issue, and added a test case for this issue. diff -Naur parsedatetime/parsedatetime.py parsedatetime.new/parsedatetime.py --- parsedatetime/parsedatetime.py 2008-04-21 14:19:50.000000000 +0800 +++ parsedatetime.new/parsedatetime.py 2009-01-07 07:06:14.000000000 +0800 @@ -1245,9 +1245,18 @@ parseStr = s if parseStr == '': + valid_date = False + for match in self.ptc.CRE_DATE3.finditer(s): + # to prevent "HH:MM(:SS) time strings" expressions from triggering + # this regex, we checks if the month field exists in the searched + # expression, if it doesn't exist, the date field is not valid + if match.group('mthname'): + m = self.ptc.CRE_DATE3.search(s, match.start()) + valid_date = True + break + # String date format - m = self.ptc.CRE_DATE3.search(s) - if m is not None: + if valid_date: self.dateStrFlag = True self.dateFlag = 1 if (m.group('date') != s): diff -Naur parsedatetime/parsedatetime_consts.py parsedatetime.new/parsedatetime_consts.py --- parsedatetime/parsedatetime_consts.py 2008-04-21 14:01:22.000000000 +0800 +++ parsedatetime.new/parsedatetime_consts.py 2009-01-07 07:06:46.000000000 +0800 @@ -721,8 +721,9 @@ # ((?P<day>\d\d?)(\s?|%(daysuffix)s|$)+)? # (,\s?(?P<year>\d\d(\d\d)?))?)) # (\s?|$|[^0-9a-zA-Z])''' % ptc.re_values - ptc.RE_DATE3 = r'''(?P<date>((?P<mthname>(%(months)s|%(shortmonths)s))\s? - ((?P<day>\d\d?)(?P<suffix>%(daysuffix)s)?)? + ptc.RE_DATE3 = r'''(?P<date>( + (((?P<mthname>(%(months)s|%(shortmonths)s))| + ((?P<day>\d\d?)(?P<suffix>%(daysuffix)s)?))(\s)?){1,2} ((,)?(\s)?(?P<year>\d\d(\d\d)?))? ) )''' % ptc.re_values diff -Naur parsedatetime/tests/TestComplexDateTimes.py parsedatetime.new/tests/TestComplexDateTimes.py --- parsedatetime/tests/TestComplexDateTimes.py 2007-02-22 16:24:22.000000000 +0800 +++ parsedatetime.new/tests/TestComplexDateTimes.py 2009-01-07 11:42:36.000000000 +0800 @@ -37,6 +37,10 @@ self.assertTrue(_compareResults(self.cal.parse('5pm August 25th, 2006', start), (target, 3))) self.assertTrue(_compareResults(self.cal.parse('Aug 25, 2006 5pm', start), (target, 3))) self.assertTrue(_compareResults(self.cal.parse('Aug 25th, 2006 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('5pm 25 August, 2006', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('5pm 25th August, 2006', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('25 Aug, 2006 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('25th Aug 2006, 5pm', start), (target, 3))) if self.mth > 8 or (self.mth == 8 and self.dy > 5): target = datetime.datetime(self.yr + 1, 8, 5, 17, 0, 0).timetuple() @@ -51,7 +55,11 @@ self.assertTrue(_compareResults(self.cal.parse('5pm Aug 05', start), (target, 3))) self.assertTrue(_compareResults(self.cal.parse('Aug 05 5pm', start), (target, 3))) self.assertTrue(_compareResults(self.cal.parse('Aug 05th 5pm', start), (target, 3))) - + self.assertTrue(_compareResults(self.cal.parse('5 August 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('5th August 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('5pm 05 Aug', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('05 Aug 5pm', start), (target, 3))) + self.assertTrue(_compareResults(self.cal.parse('05th Aug 5pm', start), (target, 3))) if __name__ == "__main__": unittest.main()
  • Oct 06, 2008
    issue 26 (Does not allow day of month to be before month) Status changed by bear42   -   turns out to be the same bug as what #24 is fixing now
    Status: Accepted
    turns out to be the same bug as what #24 is fixing now
    Status: Accepted
  • Oct 06, 2008
    issue 25 (Comparing parsed datetime to python datetime) changed by bear42   -   not really - what I should do is add some helper methods that return the date part as a datetime instead of a straight tuple marking as enhancement
    Status: Accepted
    Labels: Type-Enhancement Type-Defect
    not really - what I should do is add some helper methods that return the date part as a datetime instead of a straight tuple marking as enhancement
    Status: Accepted
    Labels: Type-Enhancement Type-Defect
  • Oct 06, 2008
    issue 24 (dates that are unambiguously before 1950 are still co-oerced...) Status changed by bear42   -   the bug is even odder than how you describe :( for some reason the DD MMMM YYYY pattern is not being detected and pdt is treating the first two digits of the year as the day - yuck! working on it now
    Status: Accepted
    the bug is even odder than how you describe :( for some reason the DD MMMM YYYY pattern is not being detected and pdt is treating the first two digits of the year as the day - yuck! working on it now
    Status: Accepted
  • Sep 28, 2008
    issue 26 (Does not allow day of month to be before month) reported by lambacck   -   What steps will reproduce the problem? 1. c = pdc.Constants('fr_CA') p = pdt.Calendar(c) p.parse('22 sept. 2008') ((2008, 9, 20, 20, 43, 46, 6, 272, 1), 1) What is the expected output? What do you see instead? ((2008, 9, 22, 20, 43, 46, 6, 272, 1), 1) What version of the product are you using? On what operating system? SVN Head on windows.
    What steps will reproduce the problem? 1. c = pdc.Constants('fr_CA') p = pdt.Calendar(c) p.parse('22 sept. 2008') ((2008, 9, 20, 20, 43, 46, 6, 272, 1), 1) What is the expected output? What do you see instead? ((2008, 9, 22, 20, 43, 46, 6, 272, 1), 1) What version of the product are you using? On what operating system? SVN Head on windows.
  • Sep 25, 2008
    issue 25 (Comparing parsed datetime to python datetime) reported by strangersquest   -   Hi I am using parsedatetime to parse the user's input for datetime inthe form. In the back end I am doing an ugly logic to compare c = pdc.Constants() p = pdt.Calendar(c) ((a,b,c,d,e,f,g,h,i),j) = p.parse(todo_form.cleaned_data['due']) result = datetime(a,b,c,d,e,f) if result > datetime.now(): As you can see I am extracting year, date, month etc to create a new datetime object. Is there a better way in doing this.
    Hi I am using parsedatetime to parse the user's input for datetime inthe form. In the back end I am doing an ugly logic to compare c = pdc.Constants() p = pdt.Calendar(c) ((a,b,c,d,e,f,g,h,i),j) = p.parse(todo_form.cleaned_data['due']) result = datetime(a,b,c,d,e,f) if result > datetime.now(): As you can see I am extracting year, date, month etc to create a new datetime object. Is there a better way in doing this.
 
Hosted by Google Code