Metadata-Version: 1.1
Name: JSON-Datetime
Version: 0.0.4
Summary: Allows for proper decoding of datetime values contained in JSON streams
Home-page: http://github.com/nicolaiarocci/json-datetime
Author: Nicola Iarocci
Author-email: nicola@nicolaiarocci.com
License: Copyright (c) 2012 Nicola Iarocci.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


Description: JSON-datetime
        =============
        .. image:: https://secure.travis-ci.org/nicolaiarocci/json-datetime.png?branch=master
                :target: https://secure.travis-ci.org/nicolaiarocci/json-datetime
        
        JSON-datetime allows for proper decoding of datetime values contained in JSON
        streams.
        
        The problem
        -----------
        The JSON standard RFC 4627 does not
        support datetime types. These are usually represented as strings and Python 
        decoders end up decoding them as such. Consider the following example:
        
        .. code-block:: python
        
            import simplejson as json
        
            >>> test = '{"name": "John Doe", "born": "Thu, 1 Mar 2012 10:00:49 UTC"}'
            >>> json.loads(test)
        
        As you can see, in the resulting dictionary ``born`` is still a string.
        
        The solution
        ------------
        JSON-datetime is a very simple wrapper around Python simplejson ``loads`` 
        method. It decodes datetime values contained in JSON strings: 
        
        .. code-block:: python
        
            import jsondatetime as json
        
            >>> test = '{"name": "John Doe", "born": "Thu, 1 Mar 2012 10:00:49 UTC"}'
            >>> json.loads(test)
            {'name': 'John Doe', 'born': datetime.datetime(2012, 3, 1, 10, 0 ,49)}
        
        Strings are parsed using ``datetime.parser.parse`` which is fairly flexible for
        common datetime formats
        
        Custom parsing
        --------------
        Being just a wrapper around the ``loads`` method, you can still use all the
        standard ``loads`` arguments, ``object_hook`` included. This means that you can
        still perform custom parsing of your inbound JSON stream.
        
        Installation
        ------------
        ``pip install json-datetime``
        
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: ISC License (ISCL)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Requires: simplejson
