Skip to content

Commit

Permalink
Release 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
asadurski committed Jul 29, 2015
1 parent d360343 commit ddada61
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Implement Features

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.
We encourage you to add new languages to existing stack.

Write Documentation
~~~~~~~~~~~~~~~~~~~
Expand Down
12 changes: 12 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
History
=======

0.3.0 (2015-07-29)
------------------
New features:

* Compatibility with Python 3 and PyPy.

Improvements:

* `languages.yaml` data cleaned up to make it human-readable.
* Improved Spanish date parsing.


0.2.1 (2015-07-13)
------------------
* Support for generic parsing of dates with UTC offset.
Expand Down
11 changes: 5 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Documentation can be found `here <https://dateparser.readthedocs.org/en/latest/>
Features
========

* Generic parsing of dates in English, Spanish, Dutch, Russian and several other langauges and formats.
* Generic parsing of dates in English, Spanish, Dutch, Russian and several other languages and formats.
* Generic parsing of relative dates like: ``'1 min ago'``, ``'2 weeks ago'``, ``'3 months, 1 week and 1 day ago'``.
* Generic parsing of dates with time zones abbreviations like: ``'August 14, 2015 EST'``, ``'July 4, 2013 PST'``.
* Generic parsing of dates with time zones abbreviations or UTC offsets like: ``'August 14, 2015 EST'``, ``'July 4, 2013 PST'``, ``'21 July 2013 10:15 pm +0500'``.
* Extensive test coverage.


Expand Down Expand Up @@ -69,7 +69,7 @@ You can specify the language(s), if known, using ``languages`` argument. In this
>>> dateparser.parse('2015, Ago 15, 1:08 pm', languages=['pt', 'es'])
datetime.datetime(2015, 8, 15, 13, 8)

If you know the possible formats that the date will be, you can
If you know the possible formats of the dates, you can
use the ``date_formats`` argument::

>>> dateparser.parse(u'22 Décembre 2010', date_formats=['%d %B %Y'])
Expand Down Expand Up @@ -98,7 +98,7 @@ Relative Dates
Dependencies
============

`dateparser` translates non-english dates to English and uses dateutil_ module ``'parser'`` to parse the translated date.
`dateparser` translates non-English dates to English and uses dateutil_ module ``parser`` to parse the translated date.

Also, it requires PyYAML_ for its language detection module to work.

Expand All @@ -109,5 +109,4 @@ Also, it requires PyYAML_ for its language detection module to work.
Limitations
===========

* Only Python 2 support for now (Python 3 support **will be** added in future versions)

* Limited language support.
2 changes: 1 addition & 1 deletion dateparser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = '0.2.1'
__version__ = '0.3.0'

from .date import DateDataParser

Expand Down
12 changes: 7 additions & 5 deletions dateparser/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class DateDataParser(object):
string representing date and/or time.
:param languages:
A list of two letters language codes.e.g. ['en', 'es'].
A list of two letters language codes, e.g. ['en', 'es'].
If languages are given, it will not attempt to detect the language.
:type languages: list
Expand Down Expand Up @@ -267,8 +267,8 @@ def __init__(self, languages=None, allow_redetect_language=False):

def get_date_data(self, date_string, date_formats=None):
"""
Parse string representing date and/or time in recognizeable localized formats.
Supports parsing multiple languages.
Parse string representing date and/or time in recognizable localized formats.
Supports parsing multiple languages and timezones.
:param date_string:
A string representing date and/or time in a recognizably valid format.
Expand All @@ -286,7 +286,7 @@ def get_date_data(self, date_string, date_formats=None):
.. note:: *Period* values can be a 'day' (default), 'week', 'month', 'year'.
*Period* represent the granularity of date parsed from the given string.
*Period* represents the granularity of date parsed from the given string.
In the example below, since no day information is present, the day is assumed to be current
day ``16`` from *current date* (which is June 16, 2015, at the moment of writing this).
Expand All @@ -301,7 +301,9 @@ def get_date_data(self, date_string, date_formats=None):
>>> DateDataParser().get_date_data(u'2014')
{'date_obj': datetime.datetime(2014, 6, 16, 0, 0), 'period': u'year'}
TODO: Timezone issues
Dates with time zone indications or UTC offsets are returned in UTC time.
>>> DateDataParser().get_date_data(u'23 March 2000, 1:21 PM CET')
{'date_obj': datetime.datetime(2000, 3, 23, 14, 21), 'period': 'day'}
"""
date_string = date_string.strip()
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: Implementation :: PyPy'
],
test_suite='nose.collector',
tests_require=test_requirements
Expand Down

0 comments on commit ddada61

Please sign in to comment.