{ "info": { "author": "Terji Petersen", "author_email": "contribute@tensortable.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=========\noptioneer\n=========\n\n\n.. image:: https://img.shields.io/pypi/v/optioneer.svg\n :target: https://pypi.python.org/pypi/optioneer\n\n.. image:: https://img.shields.io/pypi/status/optioneer.svg\n :target: https://pypi.python.org/pypi/optioneer\n\n.. image:: https://travis-ci.com/topper-123/optioneer.svg?branch=master\n :target: https://travis-ci.com/topper-123/optioneer\n\n.. image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg\n :target: https://github.com/topper-123/optioneer/blob/master/LICENSE\n\n.. image:: https://img.shields.io/pypi/pyversions/optioneer.svg\n :target: https://pypi.python.org/pypi/optioneer\n\nOptioneer makes in-program options, that:\n\n* are nestable and groupable,\n* are tab-able in the REPL for easy options discoverability\n* give each option a optional doc string, for easily explaining the option\n* may deprecate according to a transparent deprecation cycle\n* may be validated upon change\n* can do custom callbacks\n\nOptioneer is based on the ``core/config.py`` module in\n`pandas `_.\n\nInstallation\n------------\n\nInstalling is easy using pip:\n\n.. code-block:: bash\n\n pip install optioneer\n\nUsage guide\n-----------\nIn a ``config.py`` file set up your options:\n\n.. code-block:: python\n\n from optioneer import Optioneer\n options_maker = Optioneer()\n options_maker.register_option('api_key', 'abcdefg')\n options_maker.register_option('display.width', 200, doc='Width of our display')\n options_maker.register_option('display.height', 200, doc='Height of our display')\n options_maker.register_option('color', 'red', validator=options_maker.is_str)\n\n options = options_maker.options\n\nThen, in the relevant location of your library, just do\n``from config import options`` and you're got your options set up.\n\nUsers of your library can now access the options from the relevant location\nin your package, e.g. if you've made it available in the top-level\n``__init__.py`` of a package called ``mylib``:\n\n.. code-block:: python\n\n >>> import mylib\n >>> import mylib.options\n Options(\n api_key: No description available.\n [default: abcdefg] [currently: abcdefg]\n color: No description available.\n [default: red] [currently: red]\n display.height: Height of our display\n [default: 200] [currently: 200]\n display.width: Width of our display\n [default: 200] [currently: 200]\n )\n\nNotice how the repr output shows the relevant options and their descriptions.\n\nThe relevant options are discoverable using tabs in the REPL:\n\n.. code-block:: python\n\n >>> mylib.options.\n option.api_key options.color options.display\n >>> mylib.options.display.\n options.display.height options.display.width\n\nYou can also easily see the options and their values and docs for subgroups in\nthe repr string:\n\n.. code-block:: python\n\n >>> mylib.options.display\n Options(\n display.height: Height of our display\n [default: 200] [currently: 200]\n display.width: Width of our display\n [default: 200] [currently: 200]\n )\n\nCallbacks\n---------\nBy providing a callback when registering options, changing options may trigger\na desired actions. For example, if you in your ``config.py`` do:\n\n.. code-block:: python\n\n options_maker.register_option('shout', True, callback=lambda x: print(\"YEAH!\"))\n\nThen the user, when changing that option will see:\n\n.. code-block:: python\n\n >>> mylib.options.shout = False\n YEAH!\n\nOf course, the callback can be more realistic than above, e.g. logging or\nsetting some internal option or something else.\n\nDeprecating options\n-------------------\n\nIf you want to deprecate an option, ``optioneer`` allows you to do that:\n\n.. code-block:: python\n\n options_maker.deprecate_option('api_key', msg='An api key is no longer needed')\n\nNow your users get a deprecation warning, if they access this option:\n\n.. code-block:: python\n\n >>> mylib.options.api_key\n An api key is no longer needed\n C:\\Users\\TP\\Documents\\Python\\optioneer\\optioneer\\lib.py:677: FutureWarning: An api key is no longer needed\n warnings.warn(deprecated_option.msg, FutureWarning)\n Out[20]: 'abcdefg'\n\nIf an options should be renamed and/or a marker should be for when the option will\nbe removed, that is also possible:\n\n.. code-block:: python\n\n options_maker.register_option('display.length', 300, doc='Length of our display')\n options_maker.deprecate_option('display.height', redirect_key='display.length',\n removal_version='v1.3')\n\nThen accessing the option will show\n\n.. code-block:: python\n\n >>> mylib.options.display.height\n C:\\Users\\TP\\Documents\\Python\\optioneer\\optioneer\\lib.py:689: FutureWarning: 'display.height' is deprecated and will be removed in v1.3, please use 'display.length' instead.\n warnings.warn(msg, FutureWarning)\n Out[24]: 300\n\nDeprecated options will not show up in repr output or when tab-completing.\n\nDependencies\n------------\nOptioneer has no external dependencies.\n\nOptioneer uses pytest for testing.\n\nLicense\n-------\nOptioneer is BSD 3-licensed.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/topper-123/optioneer", "keywords": "optioneer", "license": "BSD license", "maintainer": "", "maintainer_email": "", "name": "optioneer", "package_url": "https://pypi.org/project/optioneer/", "platform": "", "project_url": "https://pypi.org/project/optioneer/", "project_urls": { "Homepage": "https://github.com/topper-123/optioneer" }, "release_url": "https://pypi.org/project/optioneer/1.0.3/", "requires_dist": null, "requires_python": "", "summary": "Nestable, tab-able options for use in Python programs", "version": "1.0.3" }, "last_serial": 4300347, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "d75481ea866b4e30ad8774d8ee10e1c0", "sha256": "18351bec4b991a32bbe6b03489d3195acf0ba7f3ba33c71db4407b8b89b0dca7" }, "downloads": -1, "filename": "optioneer-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d75481ea866b4e30ad8774d8ee10e1c0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10358, "upload_time": "2018-09-22T08:25:08", "url": "https://files.pythonhosted.org/packages/47/9c/eb2b5bcc9213710d7a6ef60151b6e2ce10298df5fa71d45fc0cdcaa72e80/optioneer-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6e4f1617123aba090098d97af6d788e2", "sha256": "9d19c0ad77cd12d8510d0336e15774f4db25768b6affce95a0441cffa7084680" }, "downloads": -1, "filename": "optioneer-1.0.tar.gz", "has_sig": false, "md5_digest": "6e4f1617123aba090098d97af6d788e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14533, "upload_time": "2018-09-22T08:25:09", "url": "https://files.pythonhosted.org/packages/32/b9/782a624e11500128be1b1b3d762ece2acbf0a23cf240088baa3afba1d83b/optioneer-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "8b7f795d66556e9ef3abcf692a64b76e", "sha256": "6987870a5eb6ba86e170cdc1e784ebb71d4e33efe37fd571c08ea64666cd1cdf" }, "downloads": -1, "filename": "optioneer-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8b7f795d66556e9ef3abcf692a64b76e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10585, "upload_time": "2018-09-22T09:22:01", "url": "https://files.pythonhosted.org/packages/57/87/ad01656dd22601cce0f232ddc8eec36e274d0b7cebf6dad8ce4c54a2f7b7/optioneer-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "571ca80acb8b75dc78048983dcaf6556", "sha256": "da802aedaae10dde86edd7222fad7e52c7eed775706b3cf46c65631d0192f9e7" }, "downloads": -1, "filename": "optioneer-1.0.1.tar.gz", "has_sig": false, "md5_digest": "571ca80acb8b75dc78048983dcaf6556", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14765, "upload_time": "2018-09-22T09:22:03", "url": "https://files.pythonhosted.org/packages/7d/11/611675ec1f18ac0c6500a5ac16f8d7e815731d5b78f5667abd782b39f7d0/optioneer-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "e2d0ed2629d9d86614a71973a7241153", "sha256": "eb12d25b0cf5a83995ac12ded966f1412045cde67dbe99be081f0363861b8a8b" }, "downloads": -1, "filename": "optioneer-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e2d0ed2629d9d86614a71973a7241153", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10594, "upload_time": "2018-09-22T18:45:35", "url": "https://files.pythonhosted.org/packages/90/fe/fcdef2da266520c1743c5da5c68547889027b29e67f00eba4c1eff8f1c78/optioneer-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3f3e0361cb22b1151c4700ab24c0d259", "sha256": "29dd4330fd4f95c10796ce05e5830af399d9a65d2ccca2f2d07b288d41104676" }, "downloads": -1, "filename": "optioneer-1.0.2.tar.gz", "has_sig": false, "md5_digest": "3f3e0361cb22b1151c4700ab24c0d259", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14794, "upload_time": "2018-09-22T18:45:37", "url": "https://files.pythonhosted.org/packages/a5/f2/105efc974833a68d762365ef5c4c3f22f8f2790f6493f09bf2c5322d80b7/optioneer-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "a657d0dbf3cd6e334debe3828659b108", "sha256": "b8cef229aba4da721bf3506a2c54dbb248af5e1174c1176bb74fe2cf8407f461" }, "downloads": -1, "filename": "optioneer-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a657d0dbf3cd6e334debe3828659b108", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10618, "upload_time": "2018-09-22T19:05:18", "url": "https://files.pythonhosted.org/packages/a1/43/d3536369ddb1ff40932c56949418b42b708b13a8afde49b4409fa8e50407/optioneer-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "660bc405151df395e2bdf4fbe2b7023e", "sha256": "907b22822a2825b18b53dfffdfa50cbc834ddd3efe7a26d9185cb17f951fbcf1" }, "downloads": -1, "filename": "optioneer-1.0.3.tar.gz", "has_sig": false, "md5_digest": "660bc405151df395e2bdf4fbe2b7023e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14819, "upload_time": "2018-09-22T19:05:19", "url": "https://files.pythonhosted.org/packages/88/d1/bb5c86aed73d5819e024ad5c9e04232d1d72f7904929a092f9e78e75aaf9/optioneer-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a657d0dbf3cd6e334debe3828659b108", "sha256": "b8cef229aba4da721bf3506a2c54dbb248af5e1174c1176bb74fe2cf8407f461" }, "downloads": -1, "filename": "optioneer-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a657d0dbf3cd6e334debe3828659b108", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10618, "upload_time": "2018-09-22T19:05:18", "url": "https://files.pythonhosted.org/packages/a1/43/d3536369ddb1ff40932c56949418b42b708b13a8afde49b4409fa8e50407/optioneer-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "660bc405151df395e2bdf4fbe2b7023e", "sha256": "907b22822a2825b18b53dfffdfa50cbc834ddd3efe7a26d9185cb17f951fbcf1" }, "downloads": -1, "filename": "optioneer-1.0.3.tar.gz", "has_sig": false, "md5_digest": "660bc405151df395e2bdf4fbe2b7023e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14819, "upload_time": "2018-09-22T19:05:19", "url": "https://files.pythonhosted.org/packages/88/d1/bb5c86aed73d5819e024ad5c9e04232d1d72f7904929a092f9e78e75aaf9/optioneer-1.0.3.tar.gz" } ] }