{ "info": { "author": "Lucas Bourneuf", "author_email": "lucas.bourneuf@laposte.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4" ], "description": "# Magwitch\nThe magical switch switcher !\n\n```python\nimport magwitch\n\n@magwitch.on\ndef save_figure(in_png:bool=False, legend:bool=True):\n ... # an implementation we do not care about for the example\n return in_png\n\n\n# Now, you can set the value of the boolean arguments by giving their name:\nassert save_figure.in_png() is True\n\n# Or not:\nassert save_figure.not_in_png() is False\n\n# Also, you can do it multiple times:\nsave_figure.not_in_png.no_legend()\n\n# The last set is autoritative\nassert f.not_in_png.in_png() is True\n\n# And there is many other options if you want to !\n@magwitch.on_with(use_defaults=True, enable='do_', disable=('nope_', 'never_'):\ndef f(a:bool=False): return a\n\n# effect of use_defaults\nassert f.do_a() is False\n```\n\nSee the [tests](test/) for complete API, and the docstring of `Magwitch.build`\nfor a description of all available parameters.\n\n\nInstall with\n\n pip install magwitch", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aluriak/magwitch", "keywords": "decorator,bool,arguments,helper", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "magwitch", "package_url": "https://pypi.org/project/magwitch/", "platform": "", "project_url": "https://pypi.org/project/magwitch/", "project_urls": { "Homepage": "https://github.com/aluriak/magwitch" }, "release_url": "https://pypi.org/project/magwitch/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Decorator for your functions, for easy tune of boolean arguments", "version": "0.1.0" }, "last_serial": 3820928, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c61757d8b9512fdcbefb39e5a578a5f7", "sha256": "3c8760f07857ab1e674b770905f38f9c572ac40a2180535e68345b6728bea134" }, "downloads": -1, "filename": "magwitch-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c61757d8b9512fdcbefb39e5a578a5f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3814, "upload_time": "2018-04-30T14:15:49", "url": "https://files.pythonhosted.org/packages/18/12/d5c09ece8438e9a7525d83d86d222ba6142cb9e93a878e3980413345f145/magwitch-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c61757d8b9512fdcbefb39e5a578a5f7", "sha256": "3c8760f07857ab1e674b770905f38f9c572ac40a2180535e68345b6728bea134" }, "downloads": -1, "filename": "magwitch-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c61757d8b9512fdcbefb39e5a578a5f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3814, "upload_time": "2018-04-30T14:15:49", "url": "https://files.pythonhosted.org/packages/18/12/d5c09ece8438e9a7525d83d86d222ba6142cb9e93a878e3980413345f145/magwitch-0.1.0.tar.gz" } ] }