{
"info": {
"author": "Donfig Developers",
"author_email": "",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering"
],
"description": "Donfig\n======\n\n.. image:: https://travis-ci.org/pytroll/donfig.svg?branch=master\n :target: https://travis-ci.org/pytroll/donfig\n\n.. image:: https://ci.appveyor.com/api/projects/status/mx2xytb89voslo6h/branch/master?svg=true\n :target: https://ci.appveyor.com/project/pytroll/donfig/branch/master\n\n.. image:: https://coveralls.io/repos/github/pytroll/donfig/badge.svg?branch=master\n :target: https://coveralls.io/github/pytroll/donfig?branch=master\n\nDonfig is a python library meant to make configuration easier for other\npython packages. Donfig can be configured programmatically, by\nenvironment variables, or from YAML files in standard locations. The\nbelow examples show the basics of using donfig. For more details see the\nofficial `documentation `_.\n\nInstallation\n------------\n\nDonfig can be installed from PyPI using pip:\n\n.. code-block:: bash\n\n pip install donfig\n\nOr with conda using the conda-forge channel:\n\n.. code-block:: bash\n\n conda install -c conda-forge donfig\n\nUsing Donfig\n------------\n\nCreate the package-wide configuration object for your package named `mypkg`:\n\n.. code-block:: python\n\n # mypkg/__init__.py\n from donfig import Config\n config = Config('mypkg')\n\nUse the configuration object:\n\n.. code-block:: python\n\n from mypkg import config\n important_val = config.get('important_key')\n if important_val:\n # do something\n else:\n # something else\n\nSet configuration in Python\n---------------------------\n\nConfiguration can be modified in python before code using it is called:\n\n.. code-block:: python\n\n # mypkg/work.py\n from mypkg import config\n config.set(important_key=5)\n\n # use the configuration\n\nDonfig configurations can also be changed as a context manager:\n\n.. code-block:: python\n\n config.set(other_key=True)\n\n with config.set(other_key=False):\n print(config.get('other_key')) # False\n\n print(config.get('other_key')) # True\n\nConfigure from environment variables\n------------------------------------\n\nEnvironment variables are automatically loaded when the Config object is\ncreated. Any environment variable starting with the name of the config\nobject in all capital letters and an underscore will be loaded in to\nthe config object:\n\n.. code-block:: bash\n\n export MYPKG_MY_KEY=\"a value\"\n\nAnd can be accessed in python:\n\n.. code-block:: python\n\n from mypkg import config\n print(config.get('my_key'))\n\nConfigure from YAML file\n------------------------\n\nDonfig will also automatically load any YAML configuration files found in\nspecific paths. The default paths:\n\n- ~/.config//\n- /etc//\n- /etc//\n\nNote the `/etc//` directory can also be specified with the\nenvironment variable `DASK_ROOT_CONFIG`. Also note that\n`~/.config/` (or other location specified with `DASK_CONFIG`)\ncan be created as a custom user configuration file for easier user\ncustomization (see documentation for details).\n\nHistory\n-------\n\nDonfig is based on the original configuration logic of the `dask` library.\nThe code has been modified to use a config object instead of a global\nconfiguration dictionary. This makes the configuration logic of dask available\nto everyone. The name \"donfig\" is a shortening of \"dask.config\", the original\ndask module that implemented this functionality.\n\nLicense\n-------\n\nOriginal code from the dask library was distributed under the license\nspecified in `DASK_LICENSE.txt`. In November 2018 this code was migrated to\nthe Donfig project under the MIT license described in `LICENSE.txt`. The full\ncopyright for this project is therefore::\n\n Copyright (c) 2018 Donfig Developers\n Copyright (c) 2014-2018, Anaconda, Inc. and contributors",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/pytroll/donfig",
"keywords": "",
"license": "",
"maintainer": "",
"maintainer_email": "",
"name": "donfig",
"package_url": "https://pypi.org/project/donfig/",
"platform": "",
"project_url": "https://pypi.org/project/donfig/",
"project_urls": {
"Homepage": "https://github.com/pytroll/donfig"
},
"release_url": "https://pypi.org/project/donfig/0.4.0/",
"requires_dist": null,
"requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
"summary": "Python package for configuring a python package",
"version": "0.4.0"
},
"last_serial": 5209739,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "23a74885a60005523f8b4ea588bbf0db",
"sha256": "e5a0e7123914cfaf0dc7ae42002ece50bec6a16e6c818e0c28825f176a226aa1"
},
"downloads": -1,
"filename": "donfig-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "23a74885a60005523f8b4ea588bbf0db",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
"size": 29021,
"upload_time": "2018-11-03T22:37:30",
"url": "https://files.pythonhosted.org/packages/ff/36/ae90d4bcc53b1eb418fd8da39fb49e5cc49fd82f850c2b1f9812f19d1783/donfig-0.1.0.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "f11e3c858baea8ae9d3ee287c62bbdec",
"sha256": "03f055f0ce3119a3be5d3d5121d37870720ab1a9c842878bce9a3454529bffdf"
},
"downloads": -1,
"filename": "donfig-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "f11e3c858baea8ae9d3ee287c62bbdec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
"size": 29011,
"upload_time": "2018-11-04T02:42:02",
"url": "https://files.pythonhosted.org/packages/4c/53/fb300955fdbeb0c0f6d60c7b245bced8ba81a0ec51a769f57efdd96e8dc1/donfig-0.1.1.tar.gz"
}
],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "4fa8310396220b93cd0be848fd841fbf",
"sha256": "669f3b6f88536c8b8f7aae459d59f249c7a7a4457c8288dded12d4fa61d935fa"
},
"downloads": -1,
"filename": "donfig-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "4fa8310396220b93cd0be848fd841fbf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
"size": 28997,
"upload_time": "2018-11-04T02:56:06",
"url": "https://files.pythonhosted.org/packages/60/25/3f61f4c7ce1d9080146677f46673f7abbfad088666acc301dcc3250efad1/donfig-0.1.2.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "35aa2d8bc9df4538754f1b3b1df00871",
"sha256": "0c586c607ff53792f9cd1dc5275ccc154cfd734b415c385c2a0436f17ce4e924"
},
"downloads": -1,
"filename": "donfig-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "35aa2d8bc9df4538754f1b3b1df00871",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
"size": 29057,
"upload_time": "2018-12-24T00:19:24",
"url": "https://files.pythonhosted.org/packages/55/1e/7aa3cd78dc183d348892dfe315a03c77013d968a7e0d57938b3fd9799687/donfig-0.2.0.tar.gz"
}
],
"0.3.0": [
{
"comment_text": "",
"digests": {
"md5": "9f719f4e0c3ea71461a5b11c8636f22e",
"sha256": "96931a22d1c8e7a4eaa2e27e175d6eac231e1968dea5b554caaa6eadd3abf9bd"
},
"downloads": -1,
"filename": "donfig-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "9f719f4e0c3ea71461a5b11c8636f22e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
"size": 29257,
"upload_time": "2018-12-24T16:44:23",
"url": "https://files.pythonhosted.org/packages/29/67/11855809ffeef950fbcccb4a0e8b5c65981f3a70f2813f4d32d2b00d64af/donfig-0.3.0.tar.gz"
}
],
"0.4.0": [
{
"comment_text": "",
"digests": {
"md5": "f4d2193b1f1efd7f8f8b92b4dd6289ca",
"sha256": "671d663ccab53199562b38c1996e9bd87e29660543813c4d40d44df85604d0f3"
},
"downloads": -1,
"filename": "donfig-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "f4d2193b1f1efd7f8f8b92b4dd6289ca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
"size": 29680,
"upload_time": "2019-04-30T19:27:30",
"url": "https://files.pythonhosted.org/packages/b9/48/47350c1e09c16da4db7a22b446459f72b5f69999def9520c126e1084bb42/donfig-0.4.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "f4d2193b1f1efd7f8f8b92b4dd6289ca",
"sha256": "671d663ccab53199562b38c1996e9bd87e29660543813c4d40d44df85604d0f3"
},
"downloads": -1,
"filename": "donfig-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "f4d2193b1f1efd7f8f8b92b4dd6289ca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
"size": 29680,
"upload_time": "2019-04-30T19:27:30",
"url": "https://files.pythonhosted.org/packages/b9/48/47350c1e09c16da4db7a22b446459f72b5f69999def9520c126e1084bb42/donfig-0.4.0.tar.gz"
}
]
}