{ "info": { "author": "Adam Johnson", "author_email": "me@adamj.eu", "bugtrack_url": null, "classifiers": [ "Development Status :: 7 - Inactive", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Natural Language :: English", "Operating System :: OS Independent", "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", "Programming Language :: Python :: 3.8" ], "description": "===========\nkwargs-only\n===========\n\n.. image:: https://img.shields.io/travis/adamchainz/kwargs-only/master.svg\n :target: https://travis-ci.org/adamchainz/kwargs-only\n\n.. image:: https://img.shields.io/pypi/v/kwargs-only.svg\n :target: https://pypi.python.org/pypi/kwargs-only\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/python/black\n\n----\n\n**Unmaintained:** I'm no longer maintaining this package because it's for\nPython 2 compatibility and all other projects I've used it on are now Python 3\nonly. If you want to continue maintenance please contact me.\n\n----\n\nA decorator to make a function accept keyword arguments only, on both Python 2\nand 3.\n\nIf you are using only Python 3, you don't need this, you can just do:\n\n.. code-block:: python\n\n def myfunction(*, foo=1, bar=2):\n pass\n\nWhy?\n====\n\nIf you are making a library (that still supports Python 2), you might want to\nmake all functions in its API take keyword arguments only, for a couple of\nreasons:\n\n* To avoid user confusion, e.g. if you take ``x`` and ``y`` arguments as\n coordinates, it's easy to forget which way round to pass them.\n* To make your API easier to extend - you'll know no callers rely on the\n positional argument ordering, so can refactor this to make sense.\n\nInstallation\n============\n\nUse **pip**:\n\n.. code-block:: sh\n\n pip install kwargs-only\n\nPython 2.7 and 3.4 to 3.8 supported.\n\nUsage\n=====\n\nImport the decorator and apply it to a function:\n\n.. code-block:: python\n\n from kwargs_only import kwargs_only\n\n @kwargs_only\n def myfunction(foo=1, bar=2):\n pass\n\nThen calling the function with positional arguments will cause it to fail with\n``TypeError``:\n\n.. code-block:: python\n\n >>> myfunction(1, 2)\n ...\n TypeError: myfunction should only be called with keyword args\n\nThe decorator detects methods and classmethods, by allowing for the first\nargument to be a positional one if its name is ``self`` or ``cls``.\n``kwargs_only`` should be applied to the function before ``classmethod`` is.\nFor example:\n\n.. code-block:: python\n\n class MyClass:\n\n @classmethod\n @kwargs_only\n def my_class_method(cls, foo=1):\n pass\n\n @kwargs_only\n def my_instance_method(self, bar=1):\n pass\n\nThat's about all there is to it! Enjoy!\n\nHistory\n=======\n\n1.1.1 (2019-12-21)\n------------------\n\n* Update PyPI development status as inactive. This package is no longer\n maintained since I have copied it into my mone Python 2 compatible project.\n I recommend you do the same going forwards - and get off Python 2!\n\n1.1.0 (2019-11-15)\n------------------\n\n* Support Python 3.8.\n\n1.0.2 (2019-10-28)\n------------------\n\n* Update PyPI development status as active. This package is maintained again\n since I have started using it on a Python 2 compatible project :)\n\n1.0.1 (2019-02-07)\n------------------\n\n* Update PyPI development status as inactive. This package is no longer\n maintained, see README.rst.\n\n1.0.0 (2017-06-18)\n------------------\n\n* First release on PyPI, featuring ``kwargs_only`` decorator.\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/adamchainz/kwargs-only", "keywords": "kwargs", "license": "ISC License", "maintainer": "", "maintainer_email": "", "name": "kwargs-only", "package_url": "https://pypi.org/project/kwargs-only/", "platform": "", "project_url": "https://pypi.org/project/kwargs-only/", "project_urls": { "Changelog": "https://github.com/adamchainz/kwargs-only/blob/master/HISTORY.rst", "Homepage": "https://github.com/adamchainz/kwargs-only" }, "release_url": "https://pypi.org/project/kwargs-only/1.1.1/", "requires_dist": null, "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "summary": "A decorator to make a function accept keyword arguments only, on both Python 2 and 3.", "version": "1.1.1", "yanked": false, "yanked_reason": null }, "last_serial": 6345183, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "fefb7c75f3947571203e1160f16bcfa6", "sha256": "2ac51677ae07e8e78137eb9af53b6acc7d66d77490d039f87842762bf5a2e913" }, "downloads": -1, "filename": "kwargs_only-1.0.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "fefb7c75f3947571203e1160f16bcfa6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4718, "upload_time": "2017-06-18T14:06:46", "upload_time_iso_8601": "2017-06-18T14:06:46.601927Z", "url": "https://files.pythonhosted.org/packages/21/9f/4415b310802eae064607ce2e762dc452220424dbdcf680346f796203bd58/kwargs_only-1.0.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "86b9fefdc2f26491f444f0a35c102285", "sha256": "39729a657dbb61abdadfcef2cc97f12b765c4a6766a7f27b991c3245329f8f1f" }, "downloads": -1, "filename": "kwargs-only-1.0.0.tar.gz", "has_sig": true, "md5_digest": "86b9fefdc2f26491f444f0a35c102285", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3842, "upload_time": "2017-06-18T14:06:44", "upload_time_iso_8601": "2017-06-18T14:06:44.516097Z", "url": "https://files.pythonhosted.org/packages/1c/b1/5367cfea75294be910bca5be7309e005d39ff65cc17c4b0d482e556b2e82/kwargs-only-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "50cb8f3e7270825eb0cb6fd990b3865e", "sha256": "1ae6c5817246fb28371945d590013a0754cf78149e7a4fe8671bbd8bebd540ad" }, "downloads": -1, "filename": "kwargs_only-1.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "50cb8f3e7270825eb0cb6fd990b3865e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 3687, "upload_time": "2019-02-07T20:02:03", "upload_time_iso_8601": "2019-02-07T20:02:03.140631Z", "url": "https://files.pythonhosted.org/packages/b1/a6/3aa49cdc637d12a4d39eb31f267a6dc28aaaee6b9292340b0484896155f8/kwargs_only-1.0.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "8f4cc2354e9fae97673c47ba7527b7bf", "sha256": "82df332bbb288db3aaff4c72b2398ccb3d5dcb5ce291341071e064aa28e167ec" }, "downloads": -1, "filename": "kwargs-only-1.0.1.tar.gz", "has_sig": true, "md5_digest": "8f4cc2354e9fae97673c47ba7527b7bf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4035, "upload_time": "2019-02-07T20:02:09", "upload_time_iso_8601": "2019-02-07T20:02:09.216196Z", "url": "https://files.pythonhosted.org/packages/1c/0a/d5afe4278d3e26a2c47e40e4fb7b841dbf95976f99bf27366174eeaf25bf/kwargs-only-1.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "bb25efff7dfa837ee5ebff43108fd6f2", "sha256": "486227fdac348bfead1ae943505679a089f1b41536707ce186c3b42ac0743ac9" }, "downloads": -1, "filename": "kwargs_only-1.0.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "bb25efff7dfa837ee5ebff43108fd6f2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 3651, "upload_time": "2019-10-28T10:32:54", "upload_time_iso_8601": "2019-10-28T10:32:54.008819Z", "url": "https://files.pythonhosted.org/packages/3c/30/319d128cec8234a053e01179bdd4ef74734dd474222f31572c22caf77896/kwargs_only-1.0.2-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "e0cb7a68232bbc411a08380e8390d4ad", "sha256": "567366c7cc25e93b4c4bd7061879f08e36f0e1f24de7f1b62a05a71cdd4896e9" }, "downloads": -1, "filename": "kwargs-only-1.0.2.tar.gz", "has_sig": true, "md5_digest": "e0cb7a68232bbc411a08380e8390d4ad", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 3989, "upload_time": "2019-10-28T10:32:56", "upload_time_iso_8601": "2019-10-28T10:32:56.018691Z", "url": "https://files.pythonhosted.org/packages/31/2f/118e35147e58bb8f66467c9cee37e6e17df0920d0ec11f916ec3ee1e3691/kwargs-only-1.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "e612be3fcb27606ca942a407067ccb40", "sha256": "59cecf1f1a3e7dc340476a4fca80c8bec06336860d381b6728ede6f15637ee20" }, "downloads": -1, "filename": "kwargs_only-1.1.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e612be3fcb27606ca942a407067ccb40", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 3719, "upload_time": "2019-11-15T10:12:00", "upload_time_iso_8601": "2019-11-15T10:12:00.640854Z", "url": "https://files.pythonhosted.org/packages/ac/84/e7a76cb5ca876a3190990e0e53c1629ab51227abf7965027149358c25959/kwargs_only-1.1.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "15f8b54e119a76edaf03a418076c5ff8", "sha256": "d8179b663c88b53c686a501e88cb3f4e7a15aa3a5ca9cde4171d646449fe54b6" }, "downloads": -1, "filename": "kwargs-only-1.1.0.tar.gz", "has_sig": true, "md5_digest": "15f8b54e119a76edaf03a418076c5ff8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4238, "upload_time": "2019-11-15T10:12:03", "upload_time_iso_8601": "2019-11-15T10:12:03.058782Z", "url": "https://files.pythonhosted.org/packages/7f/57/4490c29df06dba059bf16f22ea81671f3c2b1ce0dd37811533f79b11b691/kwargs-only-1.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "7367eeaf2c549f51d0091f5792e37f23", "sha256": "a19facb8c21ad9cc079b63710791dd745643588a9985396c48268368dbce535e" }, "downloads": -1, "filename": "kwargs_only-1.1.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "7367eeaf2c549f51d0091f5792e37f23", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 3874, "upload_time": "2019-12-21T17:34:19", "upload_time_iso_8601": "2019-12-21T17:34:19.695043Z", "url": "https://files.pythonhosted.org/packages/bd/aa/f6df0d1275ebe9dacd3d542d56aa2111825f92644962eb0918810dbc7238/kwargs_only-1.1.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "9d128379ff0a3be5b1188e810fecd99f", "sha256": "eed949edb0f09c461aa12027bfa019cbc9105091768a13f625f3039f042a36cd" }, "downloads": -1, "filename": "kwargs-only-1.1.1.tar.gz", "has_sig": true, "md5_digest": "9d128379ff0a3be5b1188e810fecd99f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4439, "upload_time": "2019-12-21T17:34:21", "upload_time_iso_8601": "2019-12-21T17:34:21.900787Z", "url": "https://files.pythonhosted.org/packages/b9/6b/5412355d88016001d34ba8696a2ba14c7e79dab5ad83b02dd799259c86ba/kwargs-only-1.1.1.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7367eeaf2c549f51d0091f5792e37f23", "sha256": "a19facb8c21ad9cc079b63710791dd745643588a9985396c48268368dbce535e" }, "downloads": -1, "filename": "kwargs_only-1.1.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "7367eeaf2c549f51d0091f5792e37f23", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 3874, "upload_time": "2019-12-21T17:34:19", "upload_time_iso_8601": "2019-12-21T17:34:19.695043Z", "url": "https://files.pythonhosted.org/packages/bd/aa/f6df0d1275ebe9dacd3d542d56aa2111825f92644962eb0918810dbc7238/kwargs_only-1.1.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "9d128379ff0a3be5b1188e810fecd99f", "sha256": "eed949edb0f09c461aa12027bfa019cbc9105091768a13f625f3039f042a36cd" }, "downloads": -1, "filename": "kwargs-only-1.1.1.tar.gz", "has_sig": true, "md5_digest": "9d128379ff0a3be5b1188e810fecd99f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4439, "upload_time": "2019-12-21T17:34:21", "upload_time_iso_8601": "2019-12-21T17:34:21.900787Z", "url": "https://files.pythonhosted.org/packages/b9/6b/5412355d88016001d34ba8696a2ba14c7e79dab5ad83b02dd799259c86ba/kwargs-only-1.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }