{ "info": { "author": "Miki Tebeka", "author_email": "miki.tebeka@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# viaenv - Configuration via Environment for Python\n\n[![CircleCI](https://circleci.com/gh/tebeka/viaenv.svg?style=svg)](https://circleci.com/gh/tebeka/viaenv)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\n\n`viaenv` uses [variable annotation](https://www.python.org/dev/peps/pep-0526/)\nto populate values from environment variables.\n\n## Example\n\n```python\nfrom datetime import timedelta\nfrom viaenv import populate_from_env\n\n\nclass config:\n port: int = 8080\n log_file: str = '/var/log/server.log'\n timeout: timedelta = timedelta(milliseconds=100)\n\n\npopulate_from_env(\n config, prefix='SRV',\n # If you don't pass env, populate_from_env will use os.environ\n env={'SRV_PORT': '9000', 'SRV_TIMEOUT': '300ms'})\n\nprint(config.port) # 9000\nprint(cfg.timeout == timedelta(milliseconds=300) # True\n```\n\n## Supported Types\n\n- `bool`: `y`, `yes`, `t`, `true`, `on`, `1` -> `True`, `n`, `no`, `f`, `false`, `off`, `0` -> `False`\n- `date`: `2019-05-18`\n- `datetime`: `2019-05-18T13:43:12`\n- `dict`: `{\"x\": 1, \"y\": 2}` (JSON format)\n- `float`: `1.3`, `1e7`\n- `int`: `12`, `0x12`, `0o12`, `0b12`\n- `list`: `[1, 2, 3]` (JSON format)\n- `str`: Anything goes\n- `time`: `13:43:12`\n- `timedelta`: `10us`, `20ms`, `30s`, `17m`, `2h`, `7d`, `1h20m`\n\nYou can add your types by calling `register_type_parser(typ, parser)` where\n`typ` is a type (e.g. `float`) and `parser` is a one argument function that\nwill get the value as a string.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tebeka/viaenv", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "viaenv", "package_url": "https://pypi.org/project/viaenv/", "platform": "", "project_url": "https://pypi.org/project/viaenv/", "project_urls": { "Homepage": "https://github.com/tebeka/viaenv" }, "release_url": "https://pypi.org/project/viaenv/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Configuration via environment", "version": "0.2.1" }, "last_serial": 5742277, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "490df5b67e7eaadfe9831b7b33bcdf3a", "sha256": "3b4e0a74e45d31f61a29c5240f5e431b1eb8f2bd7a125c8ab89b297b23262a95" }, "downloads": -1, "filename": "viaenv-0.1.0.tar.gz", "has_sig": false, "md5_digest": "490df5b67e7eaadfe9831b7b33bcdf3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4261, "upload_time": "2019-05-18T00:02:05", "url": "https://files.pythonhosted.org/packages/e8/8f/100b8fdfb6de4008091d3ff7026635b12a5e8943434515b457b4cc54d518/viaenv-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b87d061dcbdede55faf8ffbe0add00ea", "sha256": "ed10567b038236f73a538400bc7f8e91a93c0fa8e6ea28d487d8f0b485679dc2" }, "downloads": -1, "filename": "viaenv-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b87d061dcbdede55faf8ffbe0add00ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4234, "upload_time": "2019-05-18T08:12:43", "url": "https://files.pythonhosted.org/packages/04/ba/43e4ffda1c6f9cb9e06ca3c812245ea9be6c089e70cc8cfa94627f68f1f2/viaenv-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "3c478e07f22bbeae4ab2d9130396c00a", "sha256": "314e0fc0ea0d410f41e0e02a2e3e411b1a0c20dd605591c5e7dbd477a868346b" }, "downloads": -1, "filename": "viaenv-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3c478e07f22bbeae4ab2d9130396c00a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4710, "upload_time": "2019-07-08T10:15:20", "url": "https://files.pythonhosted.org/packages/54/50/0bbbf9c0130a672356020a3e283da83117ff2c6dc07ce374c3e639439add/viaenv-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "9bfdab7bcfc42e85ec7d67f8a5a10115", "sha256": "f1de70355a7e16f54aebb3bb9cb95e82deb206a92130d1ba526d1bac82ae1e6d" }, "downloads": -1, "filename": "viaenv-0.2.1.tar.gz", "has_sig": false, "md5_digest": "9bfdab7bcfc42e85ec7d67f8a5a10115", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4759, "upload_time": "2019-08-28T12:40:00", "url": "https://files.pythonhosted.org/packages/09/e7/ee21ea275d503b553381e570c1e340f76e961c7498545e26a31297b4761f/viaenv-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9bfdab7bcfc42e85ec7d67f8a5a10115", "sha256": "f1de70355a7e16f54aebb3bb9cb95e82deb206a92130d1ba526d1bac82ae1e6d" }, "downloads": -1, "filename": "viaenv-0.2.1.tar.gz", "has_sig": false, "md5_digest": "9bfdab7bcfc42e85ec7d67f8a5a10115", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4759, "upload_time": "2019-08-28T12:40:00", "url": "https://files.pythonhosted.org/packages/09/e7/ee21ea275d503b553381e570c1e340f76e961c7498545e26a31297b4761f/viaenv-0.2.1.tar.gz" } ] }