{ "info": { "author": "Valentyn Barmashyn", "author_email": "valpreacher@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: System", "Topic :: Utilities" ], "description": "Python smart getenv\n===================\n\nSince environment variables in os.environ are strings, it often appears inconvenient to store and retrieve other\ndata types such as bool or list. The package provides a single function that wraps os.getenv and allows\nyou to specify the desired variable type.\n\nTested and supported types: str, int, float, list. tuple, dict.\n\n`PyPi page`_\n\nUsage\n-----\n\nInstall:\n\n.. code:: bash\n\n $ pip install smart-getenv\n\n\nPrepare the variables:\n\n.. code:: bash\n\n $ export BOOLEAN=true\n $ export LIST=a,b,c\n $ export TRICKY_LIST=d:e:f\n $ export DICT=\"{'foo':'bar'}\"\n\nGet them:\n\n.. code:: python\n\n >>> from smart_getenv import getenv\n >>>\n >>> getenv('BOOLEAN', type=str)\n 'true'\n >>> getenv('BOOLEAN', type=bool)\n True\n >>> getenv('LIST', type=list)\n ['a', 'b', 'c']\n >>> getenv('LIST', type=tuple)\n ('a', 'b', 'c')\n >>> getenv('TRICKY_LIST', type=list, separator=':')\n ['d', 'e', 'f']\n >>> getenv('DICT', type=dict)\n {'foo': 'bar'}\n >>> getenv('LOST', default='default value anyone?')\n 'default value anyone?'\n\nRun tests:\n\n.. code:: bash\n\n $ python tests.py\n\n.. _PyPi page: https://pypi.python.org/pypi/smart-getenv", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Va1/smart-getenv", "keywords": null, "license": "Apache License 2.0", "maintainer": null, "maintainer_email": null, "name": "smart-getenv", "package_url": "https://pypi.org/project/smart-getenv/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/smart-getenv/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Va1/smart-getenv" }, "release_url": "https://pypi.org/project/smart-getenv/1.1.0/", "requires_dist": null, "requires_python": null, "summary": "Wrapper for os.getenv that achieves return values of a specified type", "version": "1.1.0" }, "last_serial": 2150660, "releases": { "1.0.4": [ { "comment_text": "", "digests": { "md5": "f3196f39115aaa645cab3f1fca2402f6", "sha256": "d05390b6ee96d72ab60d7f35eee2c13f65f152dbd70b2f791cd8845dd7ccbcf4" }, "downloads": -1, "filename": "smart-getenv-1.0.4.tar.gz", "has_sig": false, "md5_digest": "f3196f39115aaa645cab3f1fca2402f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1688, "upload_time": "2015-06-21T20:52:33", "url": "https://files.pythonhosted.org/packages/ec/76/3acfada3296f804191c91227a7c9e13e8d0647f2e820a73d0712a98cb76f/smart-getenv-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "52d396e1364d4056abb4c17163935f96", "sha256": "1790a28547a8e855b94ee974bbb56b9227c55515dce5a2b66ee12948ba301085" }, "downloads": -1, "filename": "smart-getenv-1.0.5.tar.gz", "has_sig": false, "md5_digest": "52d396e1364d4056abb4c17163935f96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5871, "upload_time": "2015-06-21T21:05:15", "url": "https://files.pythonhosted.org/packages/9a/36/5ea9699c7d1eaf2fabcbf8ec1e6bc6eac3666b9b7334b37d629e59d92f1d/smart-getenv-1.0.5.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "dcf09acf5f87575eeeeb56d993eec1ca", "sha256": "8e23c0451c2aef3982137f646aebde2fb67f6b106bc57343bf58d615d663eae9" }, "downloads": -1, "filename": "smart-getenv-1.1.0.tar.gz", "has_sig": false, "md5_digest": "dcf09acf5f87575eeeeb56d993eec1ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5921, "upload_time": "2016-06-04T13:54:54", "url": "https://files.pythonhosted.org/packages/0e/98/08b7e39638e6ee1da27f5b70f8b6453156b812a289356fd3dbbb807227bc/smart-getenv-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dcf09acf5f87575eeeeb56d993eec1ca", "sha256": "8e23c0451c2aef3982137f646aebde2fb67f6b106bc57343bf58d615d663eae9" }, "downloads": -1, "filename": "smart-getenv-1.1.0.tar.gz", "has_sig": false, "md5_digest": "dcf09acf5f87575eeeeb56d993eec1ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5921, "upload_time": "2016-06-04T13:54:54", "url": "https://files.pythonhosted.org/packages/0e/98/08b7e39638e6ee1da27f5b70f8b6453156b812a289356fd3dbbb807227bc/smart-getenv-1.1.0.tar.gz" } ] }