{ "info": { "author": "Nikita Sivakov", "author_email": "sivakov512@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Dotenv config\n===\nSimple `.env` config loader with type casting.\n\n[![Build Status](https://travis-ci.org/sivakov512/dotenv-config.svg?branch=master)](https://travis-ci.org/sivakov512/dotenv-config)\n[![Coverage Status](https://coveralls.io/repos/github/sivakov512/dotenv-config/badge.svg?branch=master)](https://coveralls.io/github/sivakov512/dotenv-config?branch=master)\n![Python versions](https://img.shields.io/badge/python-3.6,%203.7-blue.svg)\n[![PyPi](https://img.shields.io/pypi/v/dotenv-config.svg)](https://pypi.python.org/pypi/dotenv-config)\n\nInstallation\n---\n\n``` shell\npip3 install dotenv-config # or pip if python3 is your default interpreter\n```\n\nUsage\n---\nAll you need is instantiate the `Config` class. As an optional argument you can specify the path to your config file, by default this is `.env`\n\n``` python\nfrom dotenv_config import Config\n\nconfig = Config('.env-test')\n```\n\nTo read the configuration, call the `Config` instance. By default the returned value is a string.\n\n``` python\nsome_str_option = config('SOME_OPTION_FROM_YOUR_ENV_FILE_OR_ENVIRONMENT') # str\n```\n\nTo cast a type, any callable object can be passed as second argument or `conversion`.\nAs an argument, it must accept the value read from the config and return the result of type casting.\nFor example, if you have `SOME_INT=123` in your `.env` and need to load it as `int`, call `config` like this:\n\n``` python\nint_option = config('SOME_INT', int)\n# or\nint_option = config('SOME_INT', conversion=int)\n```\n\nYou can perform a cast to boolean if the option is specified in the config as `0` or `1`.\nFor example, if you have a `TRUE_OPTION=1` and `FALSE_OPTION=0`:\n\n``` python\ntrue_option = config('TRUE_OPTION', bool) # True\nfalse_option = config('FALSE_OPTION', bool) # false\n```\n\nAlso, you can specify a default value for situations when the requested option may not be:\n\n``` python\nsome_value = config('SOME_VALUE', default='my english is bad')\n```\n\nIf the requested option does not exist and the default value is not specified, an `ConfigValueNotFound` exception will be raised.", "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/sivakov512/dotenv-config", "keywords": "dotenv config env types cast", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "dotenv-config", "package_url": "https://pypi.org/project/dotenv-config/", "platform": "", "project_url": "https://pypi.org/project/dotenv-config/", "project_urls": { "Homepage": "https://github.com/sivakov512/dotenv-config" }, "release_url": "https://pypi.org/project/dotenv-config/0.1.4/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Simple dotenv loader with the possibility of casting types", "version": "0.1.4" }, "last_serial": 4795556, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d2f9785addcefb70750db81d1f630722", "sha256": "4ae1207a21c99427b58eff7c2e530862eba412f734bc1833034dc0a6d16bccc6" }, "downloads": -1, "filename": "dotenv-config-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d2f9785addcefb70750db81d1f630722", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2379, "upload_time": "2018-01-03T17:08:00", "url": "https://files.pythonhosted.org/packages/b6/8f/0fabb699ae4cbde90638d158515c40a56fffaced974a98442282e6b4349d/dotenv-config-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "91ebb5b96b9256f4b3b1c75f4fce4082", "sha256": "b38bb65b1e25a351d65fd7115f82e523bfe72f2d7f7ac9aa9ae1384c47363bfd" }, "downloads": -1, "filename": "dotenv-config-0.0.2.tar.gz", "has_sig": false, "md5_digest": "91ebb5b96b9256f4b3b1c75f4fce4082", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2489, "upload_time": "2018-01-05T12:09:18", "url": "https://files.pythonhosted.org/packages/cc/f8/509dece65822883a09590009a95f85850a40e1aaa0537cedcf95d334a725/dotenv-config-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "4868370e9825104498f228d160981187", "sha256": "b313cdd088fb71fe53e79dbbe3aa42396713505b29c4360a623729e8d3caa0e2" }, "downloads": -1, "filename": "dotenv-config-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4868370e9825104498f228d160981187", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2504, "upload_time": "2018-01-29T05:34:52", "url": "https://files.pythonhosted.org/packages/ba/ba/cc4160e132e554b701edfb29f14ffbe3a15bdb9903406a5bb4e7cc0ab027/dotenv-config-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6da979ebfa52227b5820a6218bc4c743", "sha256": "60803bc3ef9b143242acc7bf3f14652ee7d8477781d82b569d77cfe173765a50" }, "downloads": -1, "filename": "dotenv-config-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6da979ebfa52227b5820a6218bc4c743", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2478, "upload_time": "2018-04-29T13:55:26", "url": "https://files.pythonhosted.org/packages/02/04/58e63b7ec3a7ef783eee7f81aa61bc9cba68f9cf00151d78c76eaadc5e0f/dotenv-config-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c8e2d6a2ef7a8544cdb7599e56f83e92", "sha256": "a7ed2e152f32eee10f366ce907147c19348650b21795302702b9a8a519160023" }, "downloads": -1, "filename": "dotenv-config-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c8e2d6a2ef7a8544cdb7599e56f83e92", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2482, "upload_time": "2018-04-29T14:10:48", "url": "https://files.pythonhosted.org/packages/00/8f/21dba0c42daed3ff4bec3a3642582306cc095d051d63c2e5f623684e9df1/dotenv-config-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "e3056e302790c7a8f9891fedc4e49630", "sha256": "ee7ee50c6a72e9787d8af8f3ee8ef590680cf6b87cfde8f7ce4d5f600a6fa7e0" }, "downloads": -1, "filename": "dotenv-config-0.1.3.tar.gz", "has_sig": false, "md5_digest": "e3056e302790c7a8f9891fedc4e49630", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2295, "upload_time": "2019-02-08T13:26:03", "url": "https://files.pythonhosted.org/packages/14/48/3a3d387a93f683c3988129e25cd000d2d9daeb65fcbf404ec496f68e8b23/dotenv-config-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "81eb82c1d9caa569b09deea626e76b5b", "sha256": "f2c5589033bbcec792ff4f95534b6c3ea70d5862e66e02bdc771511a8bd9d352" }, "downloads": -1, "filename": "dotenv-config-0.1.4.tar.gz", "has_sig": false, "md5_digest": "81eb82c1d9caa569b09deea626e76b5b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2336, "upload_time": "2019-02-08T13:41:54", "url": "https://files.pythonhosted.org/packages/cd/58/b214644041e8a3dc97ad9c74d2139862292eef960d74953010dbb147bafa/dotenv-config-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "81eb82c1d9caa569b09deea626e76b5b", "sha256": "f2c5589033bbcec792ff4f95534b6c3ea70d5862e66e02bdc771511a8bd9d352" }, "downloads": -1, "filename": "dotenv-config-0.1.4.tar.gz", "has_sig": false, "md5_digest": "81eb82c1d9caa569b09deea626e76b5b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2336, "upload_time": "2019-02-08T13:41:54", "url": "https://files.pythonhosted.org/packages/cd/58/b214644041e8a3dc97ad9c74d2139862292eef960d74953010dbb147bafa/dotenv-config-0.1.4.tar.gz" } ] }