Metadata-Version: 1.1
Name: smart-getenv
Version: 1.1.0
Summary: Wrapper for os.getenv that achieves return values of a specified type
Home-page: https://github.com/Va1/smart-getenv
Author: Valentyn Barmashyn
Author-email: valpreacher@gmail.com
License: Apache License 2.0
Description: Python smart getenv
        ===================
        
        Since environment variables in os.environ are strings, it often appears inconvenient to store and retrieve other
        data types such as bool or list. The package provides a single function that wraps os.getenv and allows
        you to specify the desired variable type.
        
        Tested and supported types: str, int, float, list. tuple, dict.
        
        `PyPi page`_
        
        Usage
        -----
        
        Install:
        
        .. code:: bash
        
            $ pip install smart-getenv
        
        
        Prepare the variables:
        
        .. code:: bash
        
            $ export BOOLEAN=true
            $ export LIST=a,b,c
            $ export TRICKY_LIST=d:e:f
            $ export DICT="{'foo':'bar'}"
        
        Get them:
        
        .. code:: python
        
            >>> from smart_getenv import getenv
            >>>
            >>> getenv('BOOLEAN', type=str)
            'true'
            >>> getenv('BOOLEAN', type=bool)
            True
            >>> getenv('LIST', type=list)
            ['a', 'b', 'c']
            >>> getenv('LIST', type=tuple)
            ('a', 'b', 'c')
            >>> getenv('TRICKY_LIST', type=list, separator=':')
            ['d', 'e', 'f']
            >>> getenv('DICT', type=dict)
            {'foo': 'bar'}
            >>> getenv('LOST', default='default value anyone?')
            'default value anyone?'
        
        Run tests:
        
        .. code:: bash
        
            $ python tests.py
        
        .. _PyPi page: https://pypi.python.org/pypi/smart-getenv
        
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: System
Classifier: Topic :: Utilities
