Metadata-Version: 1.1
Name: str2type
Version: 0.1.1
Summary: Convert a string representation of an int, float, None, True, False, or JSON to its native type.      For None, True, and False, case is irrelevant.
Home-page: https://github.com/geowurster/str2type
Author: Kevin Wurster
Author-email: wursterk@gmail.com
License: 
New BSD License

Copyright (c) 2014, Kevin D. Wurster
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* The names of its contributors may not be used to endorse or promote products
  derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Description: str2type
        ========
        
        [![Build Status](https://travis-ci.org/geowurster/str2type.svg?branch=master)](https://travis-ci.org/geowurster/str2type)
        
        Convert a string representation of an int, float, None, True, False, or JSON
        to its native type.  For None, True, and False, case is irrelevant.
        
            >>> from str2type import str2type
            >>> print(str2type("1.23"))
            1.23
        
        The user can also specify which JSON library to use for decoding should
        they know they will be encountering a lot of JSON, in which case a different
        library is probably more appropriate than this function.
        
            >>> from str2type import str2type
            >>> import ujson
            >>> print(str2type('[0,1,2,3,4]', json_lib=ujson))
            [0, 1, 2, 3, 4]
        
        Alternatively:
        
            >>> import str2type
            >>> import ujson
            >>> str2type.JSON = ujson
            >>> print(str2type('FaLsE'))
            False
        
        The brunt of the decoding is handled by `json`, which can decode all supported
        types except for strings and `None`.  If the user specifies a different JSON
        library it is still expected to be able to handle these types.
        
        
        Installing
        ----------
        
        Via pip:
        
            $ pip install str2type
        
        From master branch
            
            $ git clone https://github.com/geowurster/str2type
            $ pip install ./str2type/
        
        
        Developing
        ----------
        
        Install:
        
            $ pip install virtualenv
            $ git clone https://github.com/geowurster/str2type
            $ cd str2type
            $ virtualenv venv
            $ source venv/bin/activate
            $ pip install -r requirements-dev.txt
            $ pip install -e .
        
        Test:
            
            $ nosetests \
                --with-coverage \
                --cover-package=str2type \
                --cover-erase \
                --cover-inclusive
        
        Lint:
        
            $ pep8 --max-line-length=120 str2type
Keywords: python string to type string2type str2type
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Utilities
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
