{ "info": { "author": "Aaron Schumacher", "author_email": "ajschumacher@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": ".. image:: https://travis-ci.org/ajschumacher/cnfg.svg\n :target: https://travis-ci.org/ajschumacher/cnfg\n :alt: Build Status\n\n.. image:: https://coveralls.io/repos/ajschumacher/cnfg/badge.svg\n :target: https://coveralls.io/r/ajschumacher/cnfg\n :alt: Test Coverage\n\n.. image:: https://readthedocs.org/projects/cnfg/badge/?version=latest\n :target: https://readthedocs.org/projects/cnfg/?badge=latest\n :alt: Documentation Status\n\n====\ncnfg\n====\n\nSimple configuration should be simple. Here's ``example.py``::\n\n import cnfg\n settings = cnfg.load('.examplerc')\n print(settings['message'])\n\nRelative paths are awful. Not all systems have ``/etc``. The only\nreasonable place to put configuration is in your home directory.\n\nJSON and YAML are not Python. ``eval`` is not so bad. Here's\n``.examplerc``::\n\n # It's Python, so you can use comments (and more)\n {\"message\": \"My custom message.\"}\n\nNow all of these work, with relative directories as implied::\n\n ./example.py\n python ../example.py\n cat example/example.py | python\n\n\nWhat about default settings?\n----------------------------\n\nIt's up to you, but it's easy, especially if you're keeping all your\nconfiguration in a dict::\n\n settings = {\"message\": \"Default message!\"}\n settings.update(cnfg.load('.examplerc'))\n\n\nWhat about environment variables?\n---------------------------------\n\nIt's up to you, but it's easy::\n\n import os\n some_var = os.getenv(\"SOME_VAR\", \"some default value\")\n\n\nWhat about \u201c``from config import settings``,\u201d like confire_?\n------------------------------------------------------------\n\nIt's up to you, but it's easy. Just make a file called ``config.py``\nand define ``settings`` in it.\n\n.. _confire: https://github.com/bbengfort/confire\n\n\nWhere's my home directory?\n--------------------------\n\nOn a Mac or Linux machine, ``echo ~``. On Windows, ``echo\n%userprofile%``.\n\n\nThis is so abstract!\n--------------------\n\nCheck out the example_.\n\n.. _example: https://github.com/ajschumacher/cnfg/tree/master/example\n\n\nThis is so trivial!\n-------------------\n\nYes, it's as simple as possible, and it's useful all over the place\nand the right level of complexity for a lot of projects.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/ajschumacher/cnfg/tarball/1.0.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ajschumacher/cnfg", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "cnfg", "package_url": "https://pypi.org/project/cnfg/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cnfg/", "project_urls": { "Download": "https://github.com/ajschumacher/cnfg/tarball/1.0.0", "Homepage": "https://github.com/ajschumacher/cnfg" }, "release_url": "https://pypi.org/project/cnfg/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "simple Python config in your home directory", "version": "1.0.0" }, "last_serial": 1618708, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "fb95ecf6a0445f8dcf1dd389eda54241", "sha256": "a730fa508625d34029cc258b87df084938d5082e5b5d750d41d7d56d1f87c4ff" }, "downloads": -1, "filename": "cnfg-0.0.1.tar.gz", "has_sig": false, "md5_digest": "fb95ecf6a0445f8dcf1dd389eda54241", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2179, "upload_time": "2015-01-29T00:15:24", "url": "https://files.pythonhosted.org/packages/23/73/18f52164e59d5c69928432283378514703b334f2bb509244b255c74fb8d0/cnfg-0.0.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "b3dc6b1bcd9e64a58db0ef9b4d963e81", "sha256": "4f43ea123d149c6e38a301d55d95ae4821725aaab283ff27d71817675a944381" }, "downloads": -1, "filename": "cnfg-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b3dc6b1bcd9e64a58db0ef9b4d963e81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3098, "upload_time": "2015-07-03T23:15:36", "url": "https://files.pythonhosted.org/packages/0c/c2/4cc9aa8c46660453279fd0f8576e490f0787d28e145de63367a3ce77fe16/cnfg-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b3dc6b1bcd9e64a58db0ef9b4d963e81", "sha256": "4f43ea123d149c6e38a301d55d95ae4821725aaab283ff27d71817675a944381" }, "downloads": -1, "filename": "cnfg-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b3dc6b1bcd9e64a58db0ef9b4d963e81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3098, "upload_time": "2015-07-03T23:15:36", "url": "https://files.pythonhosted.org/packages/0c/c2/4cc9aa8c46660453279fd0f8576e490f0787d28e145de63367a3ce77fe16/cnfg-1.0.0.tar.gz" } ] }