{ "info": { "author": "pwwang", "author_email": "pwwang@pwwang.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "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": "# completions\n\n[![pypi][1]][2] [![tag][3]][4] [![travis][5]][6] [![codacy quality][7]][8] ![pyver][11]\n\nShell completions for your program made easy.\n\n## Installation\n```shell\npip install completions\n# install lastest version using poetry\ngit clone https://github.com/pwwang/completions\ncd completions\npoetry install\n```\n\n## Usage\n\n### Defining your completions\nYou may define your completions, basically commands and options, by following schema (showed in `yaml`, but can be any format supported by [`python-simpleconf`][12]:\n`example.yaml`\n```yaml\nprogram:\n # your program, or path to your program\n name: completions-example\n desc: Shell completions for your program made easy.\n # whether global options should be inherited by commands\n inherit: true\n # options or global options if you have commands\n options:\n -s: The shell, one of bash, fish, zsh and auto.\n --shell: The shell, one of bash, fish, zsh and auto.\n -a: Automatically write completions to destination file.\n --auto: Automatically write completions to destination file.\ncommands:\n # No other options for command, give the description\n self: Generate completions for myself.\n generate:\n desc: Generate completions from configuration files.\n options:\n -c: The configuration file to load.\n --config: The configuration file to load.\n```\n\nHow it looks like in `fish`:\n![command][13]\n![option][14]\n\n### Generating completion scripts\n- Bash\n ```shell\n > completions generate --shell bash \\\n --config example.yaml > ~/bash_completion.d/completions.bash-completion\n ```\n You may need to `source` it in your `.bashrc` and restart your shell for the changes to take effect.\n- Fish\n ```shell\n > completions generate --shell fish \\\n --config example.yaml > ~/.config/fish/completions/completions.fish\n ```\n You may need to restart your shell for the changes to take effect.\n- Zsh\n ```shell\n > completions generate --shell zsh \\\n --config example.yaml > ~/.zsh-completions/_completions\n ```\n Make sure `fpath+=~/.zsh-completions` is put before `compinit` in you `.zshrc`\n\n### Saving completions scripts automatically\n- Bash\n ```shell\n > completions generate --shell bash --config example.yaml --auto\n ```\n\n- Fish\n ```shell\n > completions generate --shell fish --config example.yaml --auto\n ```\n\n- Zsh\n ```shell\n > completions generate --shell zsh --config example.yaml --auto\n ```\n\n### Python API\n```python\nfrom completions import Completions\ncompletions = Completions(\n # if not given, will be read from sys.argv[0]\n name = 'completions',\n # Add global options to commands\n inherit = True,\n desc = 'Shell completions for your program made easy.')\ncompletions.addOption(\n ['-s', '--shell'],\n 'The shell, one of bash, fish, zsh and auto.')\ncompletions.addOption(\n ['-a', '--auto'],\n 'Automatically write completions to destination file.')\ncompletions.addCommand(\n 'self', 'Generate completions for myself.')\ncompletions.addCommand(\n 'generate', 'Generate completions from configuration files.')\ncompletions.command('generate').addOption(\n ['-c', '--config'], 'The configuration file to load.')\ncompletions.generate(shell = 'fish', auto = False)\n```\n\n[1]: https://img.shields.io/pypi/v/completions.svg?style=flat-square\n[2]: https://pypi.org/project/completions/\n[3]: https://img.shields.io/github/tag/pwwang/completions.svg?style=flat-square\n[4]: https://github.com/pwwang/completions\n[5]: https://img.shields.io/travis/pwwang/completions.svg?style=flat-square\n[6]: https://travis-ci.org/pwwang/completions\n[7]: https://img.shields.io/codacy/grade/98c8035ccd4c4f97b454086271a1b1c1.svg?style=flat-square\n[8]: https://app.codacy.com/project/pwwang/completions/dashboard\n[11]: https://img.shields.io/pypi/pyversions/completions.svg?style=flat-square\n[12]: https://github.com/pwwang/simpleconf\n[13]: https://raw.githubusercontent.com/pwwang/completions/master/examples/command.png\n[14]: https://raw.githubusercontent.com/pwwang/completions/master/examples/option.png\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pwwang/completions", "keywords": "", "license": "MIT", "maintainer": "pwwang", "maintainer_email": "pwwang@pwwang.com", "name": "completions", "package_url": "https://pypi.org/project/completions/", "platform": "", "project_url": "https://pypi.org/project/completions/", "project_urls": { "Homepage": "https://github.com/pwwang/completions", "Repository": "https://github.com/pwwang/completions" }, "release_url": "https://pypi.org/project/completions/0.0.7/", "requires_dist": [ "colorama", "python-simpleconf", "pyparam" ], "requires_python": ">=3.4,<4.0", "summary": "Shell completions made easy.", "version": "0.0.7" }, "last_serial": 5472969, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7270054535ecf3942c69946b5b50d321", "sha256": "fbd55d01fe929ab683f2191a6f5c22cc73eaef5b7e6d6bfd4e31e175609b17c1" }, "downloads": -1, "filename": "completions-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7270054535ecf3942c69946b5b50d321", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 7509, "upload_time": "2019-06-08T05:02:27", "url": "https://files.pythonhosted.org/packages/71/50/447ea783ed97553cce51b50d46aaba26de9ee2e2d2d809ce498cba84269e/completions-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb1240ed768c1e57d0b8bd2535b3da44", "sha256": "7313700708015c5e54e1597e0c0bc8c47505d3b80704a8567627dae27f59c3a1" }, "downloads": -1, "filename": "completions-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bb1240ed768c1e57d0b8bd2535b3da44", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 6944, "upload_time": "2019-06-08T05:02:29", "url": "https://files.pythonhosted.org/packages/b5/b6/518ecbe3f429143c85d9d926c0d2b8b1ef40a129bdf3c5667c40e570feba/completions-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "ef96734af401baf7074a5dc2e16985e8", "sha256": "ae012028ca1ac509ea68a466676c28d7717f80bb60eab096acd7d7e0f8757e26" }, "downloads": -1, "filename": "completions-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ef96734af401baf7074a5dc2e16985e8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 8479, "upload_time": "2019-06-12T05:47:44", "url": "https://files.pythonhosted.org/packages/d2/e0/ab38eeaca09dd1f1bb93ae5278ea4d11059f2558826e3c894fb6c2a83188/completions-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "afdc644efe4d43765508d8e194a9a9dd", "sha256": "29a196cce29ac53ca39b1ead8774b7409774d801e888531cc49132bd91c0212a" }, "downloads": -1, "filename": "completions-0.0.2.tar.gz", "has_sig": false, "md5_digest": "afdc644efe4d43765508d8e194a9a9dd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 8976, "upload_time": "2019-06-12T05:47:46", "url": "https://files.pythonhosted.org/packages/a5/30/9e12aab7a773cf3d54760d428cadc4e25ce5323bd90490ab48b3dd840b9e/completions-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "742229697aa501c5d4fb36c6904615f0", "sha256": "7368a872954b93d9bd6414aa4eb28fd1a86ba998fb0503fd81b8a60d36bdc6c6" }, "downloads": -1, "filename": "completions-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "742229697aa501c5d4fb36c6904615f0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 8509, "upload_time": "2019-06-12T19:29:33", "url": "https://files.pythonhosted.org/packages/bc/de/ac51d58c834d02ef3e142ff11cf5f33c5bfc53f3a3872af4f290f58fdd71/completions-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7de22dc9bb8ae53f4a838c90b0432be5", "sha256": "1925cf852634f1dea19511eb8e6a5b29a49da590097e9ade426cc262422683dc" }, "downloads": -1, "filename": "completions-0.0.3.tar.gz", "has_sig": false, "md5_digest": "7de22dc9bb8ae53f4a838c90b0432be5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 9033, "upload_time": "2019-06-12T19:29:35", "url": "https://files.pythonhosted.org/packages/26/a0/496825c845016f56be4fd3790df2615d07bf8a424412f6bd6844a2584d4e/completions-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "c61399c32bb8deee9a030960f99fdcf5", "sha256": "5963e2224138e15bac30fcb4e5f31886445ac09455af11aaaacc227c94649cbf" }, "downloads": -1, "filename": "completions-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "c61399c32bb8deee9a030960f99fdcf5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 8002, "upload_time": "2019-06-14T00:02:06", "url": "https://files.pythonhosted.org/packages/df/16/af52977cf55a3e6acae18762d9022387fd6b07086d7f16a6b78daf659bb5/completions-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0626d774c6bafef24ab4f3251b5b674d", "sha256": "51fde8c1c138c74afab20f63cf11019aadf89c545d26b70996d7ee02b0e6af3e" }, "downloads": -1, "filename": "completions-0.0.4.tar.gz", "has_sig": false, "md5_digest": "0626d774c6bafef24ab4f3251b5b674d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 8487, "upload_time": "2019-06-14T00:02:07", "url": "https://files.pythonhosted.org/packages/cb/b8/5b012ba8247d41b50e4d8ba98be082b3cbfb1927936a05e9e7b27657582a/completions-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "077b30c67a122d493f9092267f62df1c", "sha256": "d9ff6254b2264d87f526d7b572593ea2826a87982bc172077efb8b6f1f28a755" }, "downloads": -1, "filename": "completions-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "077b30c67a122d493f9092267f62df1c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 7982, "upload_time": "2019-06-26T19:19:18", "url": "https://files.pythonhosted.org/packages/f9/7f/90c72564e1622bbde761141278f04e52f684f3944307f84eef492bd3dd46/completions-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b1255913cc82d33310136bdc5c3c4208", "sha256": "125557e3a34190adfb47cfb64345c60efb12cd5228b1f564cc5f2525b4594ae3" }, "downloads": -1, "filename": "completions-0.0.5.tar.gz", "has_sig": false, "md5_digest": "b1255913cc82d33310136bdc5c3c4208", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 8455, "upload_time": "2019-06-26T19:19:20", "url": "https://files.pythonhosted.org/packages/69/6c/2b9916e6382ace974eb2b7428e6296708620f115b1aa4fab704ee0d24002/completions-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "c5acdf8d885ddc7887d880ce03b24af5", "sha256": "f76bca81c0b77c34d50c123a3691c0a280021a3f42a312125a54224819cabf02" }, "downloads": -1, "filename": "completions-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "c5acdf8d885ddc7887d880ce03b24af5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 8020, "upload_time": "2019-07-01T19:06:28", "url": "https://files.pythonhosted.org/packages/df/98/f3c24a840db48ffdaf29df33a910617c4da73c00c4d2d50c0aed613c1085/completions-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4abce888442811dcd601b40f3ae0a1aa", "sha256": "39ad6b81d7dbb5b68896374f1dab8cb022279a053d2039480eee63e7608fbb87" }, "downloads": -1, "filename": "completions-0.0.6.tar.gz", "has_sig": false, "md5_digest": "4abce888442811dcd601b40f3ae0a1aa", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 8496, "upload_time": "2019-07-01T19:06:29", "url": "https://files.pythonhosted.org/packages/57/8f/9449275c6a73741fac7c901a4b0739edaba6b7e3924079ca1345c88c1124/completions-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "c83bcf5eaf75e7dac4f8a712a11b240a", "sha256": "34a0454a82093f5e2f9a4fb04f2df13b6cf4fa60708d30f76de5ad046c51a514" }, "downloads": -1, "filename": "completions-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "c83bcf5eaf75e7dac4f8a712a11b240a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 7999, "upload_time": "2019-07-01T19:09:39", "url": "https://files.pythonhosted.org/packages/15/62/6a18e050ebf290ae03dc69043ba5023c32b95d195857046b12f17686c165/completions-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d11d6720a7e2ccfb9bcc747bba981462", "sha256": "fe88567bd858fec54c6b939ed59d32aca7bc431350a2fc7d00da91c2187e7836" }, "downloads": -1, "filename": "completions-0.0.7.tar.gz", "has_sig": false, "md5_digest": "d11d6720a7e2ccfb9bcc747bba981462", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 8468, "upload_time": "2019-07-01T19:09:40", "url": "https://files.pythonhosted.org/packages/db/35/5e24bcbe46676645a1496291e6f683e41d26ecdeb919f6e756d15c6ef682/completions-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c83bcf5eaf75e7dac4f8a712a11b240a", "sha256": "34a0454a82093f5e2f9a4fb04f2df13b6cf4fa60708d30f76de5ad046c51a514" }, "downloads": -1, "filename": "completions-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "c83bcf5eaf75e7dac4f8a712a11b240a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 7999, "upload_time": "2019-07-01T19:09:39", "url": "https://files.pythonhosted.org/packages/15/62/6a18e050ebf290ae03dc69043ba5023c32b95d195857046b12f17686c165/completions-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d11d6720a7e2ccfb9bcc747bba981462", "sha256": "fe88567bd858fec54c6b939ed59d32aca7bc431350a2fc7d00da91c2187e7836" }, "downloads": -1, "filename": "completions-0.0.7.tar.gz", "has_sig": false, "md5_digest": "d11d6720a7e2ccfb9bcc747bba981462", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 8468, "upload_time": "2019-07-01T19:09:40", "url": "https://files.pythonhosted.org/packages/db/35/5e24bcbe46676645a1496291e6f683e41d26ecdeb919f6e756d15c6ef682/completions-0.0.7.tar.gz" } ] }