diff options
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | README | 37 | ||||
-rw-r--r-- | README.rst | 70 | ||||
-rw-r--r-- | dev-requirements.txt | 1 | ||||
-rw-r--r-- | setup.py | 54 |
5 files changed, 75 insertions, 89 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index 42a39ee..ea47448 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ recursive-include iso8601 *.py -include README LICENSE tox.ini setup.py *requirements.txt
\ No newline at end of file +include README.rst LICENSE tox.ini setup.py *requirements.txt
\ No newline at end of file @@ -1,37 +0,0 @@ -A simple package to deal with ISO 8601 date time formats. - -ISO 8601 defines a neutral, unambiguous date string format, which also -has the property of sorting naturally. - -e.g. YYYY-MM-DDTHH:MM:SSZ or 2007-01-25T12:00:00Z - -Currently this covers only the most common date formats encountered, not -all of ISO 8601 is handled. - -Currently the following formats are handled: - -* 2006-01-01T00:00:00Z -* 2006-01-01T00:00:00[+-]00:00 - -I'll add more as I encounter them in my day to day life. Patches with -new formats and tests will be gratefully accepted of course :) - -References: - -* http://www.cl.cam.ac.uk/~mgk25/iso-time.html - simple overview - -* http://hydracen.com/dx/iso8601.htm - more detailed enumeration of - valid formats. - -See the LICENSE file for the license this package is released under. - -If you want more full featured parsing look at: - -- http://labix.org/python-dateutil - python-dateutil - -This was originally hosted at https://code.google.com/p/pyiso8601/ - -Testing: - -1. pip install -r dev-requirements.txt -2. tox diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..bddb012 --- /dev/null +++ b/README.rst @@ -0,0 +1,70 @@ +Simple module to parse ISO 8601 dates + +This module parses the most common forms of ISO 8601 date strings (e.g. +2007-01-14T20:34:22+00:00) into datetime objects. + +>>> import iso8601 +>>> iso8601.parse_date("2007-01-25T12:00:00Z") +datetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.iso8601.Utc ...>) +>>> + +See the LICENSE file for the license this package is released under. + +If you want more full featured parsing look at: + +- http://labix.org/python-dateutil - python-dateutil + +This was originally hosted at https://code.google.com/p/pyiso8601/ + +Home +==== + +* https://bitbucket.org/micktwomey/pyiso8601/ + +References +========== + +* http://www.cl.cam.ac.uk/~mgk25/iso-time.html - simple overview + +* http://hydracen.com/dx/iso8601.htm - more detailed enumeration of valid formats. + +Testing +======= + +1. pip install -r dev-requirements.txt +2. tox + +Changes +======= + +0.1.5 +----- + +* Wow, it's alive! First update since 2007 +* Moved over to https://bitbucket.org/micktwomey/pyiso8601 +* Add support for python 3. https://code.google.com/p/pyiso8601/issues/detail?id=23 (thanks to zefciu) +* Switched to py.test and tox for testing +* Make seconds optional in date format ("1997-07-16T19:20+01:00" now valid). https://bitbucket.org/micktwomey/pyiso8601/pull-request/1/make-the-inclusion-of-seconds-optional-in/diff (thanks to Chris Down) +* Correctly raise ParseError for more invalid inputs (https://bitbucket.org/micktwomey/pyiso8601/issue/1/raise-parseerror-for-invalid-input) (thanks to manish.tomar) + +0.1.4 +----- + +* The default_timezone argument wasn't being passed through correctly, UTC was being used in every case. Fixes issue 10. + +0.1.3 +----- + +* Fixed the microsecond handling, the generated microsecond values were way too small. Fixes issue 9. + +0.1.2 +----- + +* Adding ParseError to __all__ in iso8601 module, allows people to import it. Addresses issue 7. +* Be a little more flexible when dealing with dates without leading zeroes. This violates the spec a little, but handles more dates as seen in the field. Addresses issue 6. +* Allow date/time separators other than T. + +0.1.1 +----- + +* When parsing dates without a timezone the specified default is used. If no default is specified then UTC is used. Addresses issue 4. diff --git a/dev-requirements.txt b/dev-requirements.txt index 4bb63bb..f370bae 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,2 +1,3 @@ pytest >= 2.3.5 tox >= 1.6.0 +devpi >= 1.1 @@ -1,59 +1,11 @@ +import os + try: from setuptools import setup except ImportError: from distutils import setup -long_description="""Simple module to parse ISO 8601 dates - -This module parses the most common forms of ISO 8601 date strings (e.g. -2007-01-14T20:34:22+00:00) into datetime objects. - ->>> import iso8601 ->>> iso8601.parse_date("2007-01-25T12:00:00Z") -datetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.iso8601.Utc ...>) ->>> - -Changes -======= - -0.1.5 ------ - -* Wow, it's alive! First update since 2007 -* Moved over to https://bitbucket.org/micktwomey/pyiso8601 -* Add support for python 3. https://code.google.com/p/pyiso8601/issues/detail?id=23 (thanks to zefciu) -* Switched to py.test and tox for testing -* Make seconds optional in date format ("1997-07-16T19:20+01:00" now valid). https://bitbucket.org/micktwomey/pyiso8601/pull-request/1/make-the-inclusion-of-seconds-optional-in/diff (thanks to Chris Down) -* Correctly raise ParseError for more invalid inputs (https://bitbucket.org/micktwomey/pyiso8601/issue/1/raise-parseerror-for-invalid-input) (thanks to manish.tomar) - -0.1.4 ------ - -* The default_timezone argument wasn't being passed through correctly, - UTC was being used in every case. Fixes issue 10. - -0.1.3 ------ - -* Fixed the microsecond handling, the generated microsecond values were - way too small. Fixes issue 9. - -0.1.2 ------ - -* Adding ParseError to __all__ in iso8601 module, allows people to import it. - Addresses issue 7. -* Be a little more flexible when dealing with dates without leading zeroes. - This violates the spec a little, but handles more dates as seen in the - field. Addresses issue 6. -* Allow date/time separators other than T. - -0.1.1 ------ - -* When parsing dates without a timezone the specified default is used. If no - default is specified then UTC is used. Addresses issue 4. -""" +long_description = open(os.path.join(os.path.dirname(__file__), "README.rst")).read() setup( name="iso8601", |