argcomplete


Nameargcomplete JSON
Version 3.5.1 PyPI version JSON
download
home_pagehttps://github.com/kislyuk/argcomplete
SummaryBash tab completion for argparse
upload_time2024-10-07 04:00:39
maintainerNone
docs_urlNone
authorAndrey Kislyuk
requires_python>=3.8
licenseApache Software License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            argcomplete - Bash/zsh tab completion for argparse
==================================================
*Tab complete all the things!*

Argcomplete provides easy, extensible command line tab completion of arguments for your Python application.

It makes two assumptions:

* You're using bash or zsh as your shell
* You're using `argparse <http://docs.python.org/3/library/argparse.html>`_ to manage your command line arguments/options

Argcomplete is particularly useful if your program has lots of options or subparsers, and if your program can
dynamically suggest completions for your argument/option values (for example, if the user is browsing resources over
the network).

Installation
------------
::

    pip install argcomplete
    activate-global-python-argcomplete

See `Activating global completion`_ below for details about the second step.

Refresh your shell environment (start a new shell).

Synopsis
--------
Add the ``PYTHON_ARGCOMPLETE_OK`` marker and a call to ``argcomplete.autocomplete()`` to your Python application as
follows:

.. code-block:: python

    #!/usr/bin/env python
    # PYTHON_ARGCOMPLETE_OK
    import argcomplete, argparse
    parser = argparse.ArgumentParser()
    ...
    argcomplete.autocomplete(parser)
    args = parser.parse_args()
    ...

Register your Python application with your shell's completion framework by running ``register-python-argcomplete``::

    eval "$(register-python-argcomplete my-python-app)"

Quotes are significant; the registration will fail without them. See `Global completion`_ below for a way to enable
argcomplete generally without registering each application individually.

argcomplete.autocomplete(*parser*)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This method is the entry point to the module. It must be called **after** ArgumentParser construction is complete, but
**before** the ``ArgumentParser.parse_args()`` method is called. The method looks for an environment variable that the
completion hook shellcode sets, and if it's there, collects completions, prints them to the output stream (fd 8 by
default), and exits. Otherwise, it returns to the caller immediately.

.. admonition:: Side effects

 Argcomplete gets completions by running your program. It intercepts the execution flow at the moment
 ``argcomplete.autocomplete()`` is called. After sending completions, it exits using ``exit_method`` (``os._exit``
 by default). This means if your program has any side effects that happen before ``argcomplete`` is called, those
 side effects will happen every time the user presses ``<TAB>`` (although anything your program prints to stdout or
 stderr will be suppressed). For this reason it's best to construct the argument parser and call
 ``argcomplete.autocomplete()`` as early as possible in your execution flow.

.. admonition:: Performance

 If the program takes a long time to get to the point where ``argcomplete.autocomplete()`` is called, the tab completion
 process will feel sluggish, and the user may lose confidence in it. So it's also important to minimize the startup time
 of the program up to that point (for example, by deferring initialization or importing of large modules until after
 parsing options).

Specifying completers
---------------------
You can specify custom completion functions for your options and arguments. Two styles are supported: callable and
readline-style. Callable completers are simpler. They are called with the following keyword arguments:

* ``prefix``: The prefix text of the last word before the cursor on the command line.
  For dynamic completers, this can be used to reduce the work required to generate possible completions.
* ``action``: The ``argparse.Action`` instance that this completer was called for.
* ``parser``: The ``argparse.ArgumentParser`` instance that the action was taken by.
* ``parsed_args``: The result of argument parsing so far (the ``argparse.Namespace`` args object normally returned by
  ``ArgumentParser.parse_args()``).

Completers can return their completions as an iterable of strings or a mapping (dict) of strings to their
descriptions (zsh will display the descriptions as context help alongside completions). An example completer for names
of environment variables might look like this:

.. code-block:: python

    def EnvironCompleter(**kwargs):
        return os.environ

To specify a completer for an argument or option, set the ``completer`` attribute of its associated action. An easy
way to do this at definition time is:

.. code-block:: python

    from argcomplete.completers import EnvironCompleter

    parser = argparse.ArgumentParser()
    parser.add_argument("--env-var1").completer = EnvironCompleter
    parser.add_argument("--env-var2").completer = EnvironCompleter
    argcomplete.autocomplete(parser)

If you specify the ``choices`` keyword for an argparse option or argument (and don't specify a completer), it will be
used for completions.

A completer that is initialized with a set of all possible choices of values for its action might look like this:

.. code-block:: python

    class ChoicesCompleter(object):
        def __init__(self, choices):
            self.choices = choices

        def __call__(self, **kwargs):
            return self.choices

The following two ways to specify a static set of choices are equivalent for completion purposes:

.. code-block:: python

    from argcomplete.completers import ChoicesCompleter

    parser.add_argument("--protocol", choices=('http', 'https', 'ssh', 'rsync', 'wss'))
    parser.add_argument("--proto").completer=ChoicesCompleter(('http', 'https', 'ssh', 'rsync', 'wss'))

Note that if you use the ``choices=<completions>`` option, argparse will show
all these choices in the ``--help`` output by default. To prevent this, set
``metavar`` (like ``parser.add_argument("--protocol", metavar="PROTOCOL",
choices=('http', 'https', 'ssh', 'rsync', 'wss'))``).

The following `script <https://raw.github.com/kislyuk/argcomplete/master/docs/examples/describe_github_user.py>`_ uses
``parsed_args`` and `Requests <http://python-requests.org/>`_ to query GitHub for publicly known members of an
organization and complete their names, then prints the member description:

.. code-block:: python

    #!/usr/bin/env python
    # PYTHON_ARGCOMPLETE_OK
    import argcomplete, argparse, requests, pprint

    def github_org_members(prefix, parsed_args, **kwargs):
        resource = "https://api.github.com/orgs/{org}/members".format(org=parsed_args.organization)
        return (member['login'] for member in requests.get(resource).json() if member['login'].startswith(prefix))

    parser = argparse.ArgumentParser()
    parser.add_argument("--organization", help="GitHub organization")
    parser.add_argument("--member", help="GitHub member").completer = github_org_members

    argcomplete.autocomplete(parser)
    args = parser.parse_args()

    pprint.pprint(requests.get("https://api.github.com/users/{m}".format(m=args.member)).json())

`Try it <https://raw.github.com/kislyuk/argcomplete/master/docs/examples/describe_github_user.py>`_ like this::

    ./describe_github_user.py --organization heroku --member <TAB>

If you have a useful completer to add to the `completer library
<https://github.com/kislyuk/argcomplete/blob/master/argcomplete/completers.py>`_, send a pull request!

Readline-style completers
~~~~~~~~~~~~~~~~~~~~~~~~~
The readline_ module defines a completer protocol in rlcompleter_. Readline-style completers are also supported by
argcomplete, so you can use the same completer object both in an interactive readline-powered shell and on the command
line. For example, you can use the readline-style completer provided by IPython_ to get introspective completions like
you would get in the IPython shell:

.. _readline: http://docs.python.org/3/library/readline.html
.. _rlcompleter: http://docs.python.org/3/library/rlcompleter.html#completer-objects
.. _IPython: http://ipython.org/

.. code-block:: python

    import IPython
    parser.add_argument("--python-name").completer = IPython.core.completer.Completer()

``argcomplete.CompletionFinder.rl_complete`` can also be used to plug in an argparse parser as a readline completer.

Printing warnings in completers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Normal stdout/stderr output is suspended when argcomplete runs. Sometimes, though, when the user presses ``<TAB>``, it's
appropriate to print information about why completions generation failed. To do this, use ``warn``:

.. code-block:: python

    from argcomplete import warn

    def AwesomeWebServiceCompleter(prefix, **kwargs):
        if login_failed:
            warn("Please log in to Awesome Web Service to use autocompletion")
        return completions

Using a custom completion validator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default, argcomplete validates your completions by checking if they start with the prefix given to the completer. You
can override this validation check by supplying the ``validator`` keyword to ``argcomplete.autocomplete()``:

.. code-block:: python

    def my_validator(completion_candidate, current_input):
        """Complete non-prefix substring matches."""
        return current_input in completion_candidate

    argcomplete.autocomplete(parser, validator=my_validator)

Global completion
-----------------
In global completion mode, you don't have to register each argcomplete-capable executable separately. Instead, the shell
will look for the string **PYTHON_ARGCOMPLETE_OK** in the first 1024 bytes of any executable that it's running
completion for, and if it's found, follow the rest of the argcomplete protocol as described above.

Additionally, completion is activated for scripts run as ``python <script>`` and ``python -m <module>``. If you're using
multiple Python versions on the same system, the version being used to run the script must have argcomplete installed.

.. admonition:: Bash version compatibility

 When using bash, global completion requires bash support for ``complete -D``, which was introduced in bash 4.2. Since
 Mac OS ships with an outdated version of Bash (3.2), you can either use zsh or install a newer version of bash using
 `Homebrew <http://brew.sh/>`_ (``brew install bash`` - you will also need to add ``/opt/homebrew/bin/bash`` to
 ``/etc/shells``, and run ``chsh`` to change your shell). You can check the version of the running copy of bash with
 ``echo $BASH_VERSION``.

.. note:: If you use setuptools/distribute ``scripts`` or ``entry_points`` directives to package your module,
 argcomplete will follow the wrapper scripts to their destination and look for ``PYTHON_ARGCOMPLETE_OK`` in the
 destination code.

If you choose not to use global completion, or ship a completion module that depends on argcomplete, you must register
your script explicitly using ``eval "$(register-python-argcomplete my-python-app)"``. Standard completion module
registration rules apply: namely, the script name is passed directly to ``complete``, meaning it is only tab completed
when invoked exactly as it was registered. In the above example, ``my-python-app`` must be on the path, and the user
must be attempting to complete it by that name. The above line alone would **not** allow you to complete
``./my-python-app``, or ``/path/to/my-python-app``.

Activating global completion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The script ``activate-global-python-argcomplete`` installs the global completion script
`bash_completion.d/_python-argcomplete <https://github.com/kislyuk/argcomplete/blob/master/argcomplete/bash_completion.d/_python-argcomplete>`_
into an appropriate location on your system for both bash and zsh. The specific location depends on your platform and
whether you installed argcomplete system-wide using ``sudo`` or locally (into your user's home directory).

Zsh Support
-----------
Argcomplete supports zsh. On top of plain completions like in bash, zsh allows you to see argparse help strings as
completion descriptions. All shellcode included with argcomplete is compatible with both bash and zsh, so the same
completer commands ``activate-global-python-argcomplete`` and ``eval "$(register-python-argcomplete my-python-app)"``
work for zsh as well.

Python Support
--------------
Argcomplete requires Python 3.7+.

Support for other shells
------------------------
Argcomplete maintainers provide support only for the bash and zsh shells on Linux and MacOS. For resources related to
other shells and platforms, including fish, tcsh, xonsh, powershell, and Windows, please see the
`contrib <https://github.com/kislyuk/argcomplete/tree/develop/contrib>`_ directory.

Common Problems
---------------
If global completion is not completing your script, bash may have registered a default completion function::

    $ complete | grep my-python-app
    complete -F _minimal my-python-app

You can fix this by restarting your shell, or by running ``complete -r my-python-app``.

Debugging
---------
Set the ``_ARC_DEBUG`` variable in your shell to enable verbose debug output every time argcomplete runs. This will
disrupt the command line composition state of your terminal, but make it possible to see the internal state of the
completer if it encounters problems.

Acknowledgments
---------------
Inspired and informed by the optcomplete_ module by Martin Blais.

.. _optcomplete: http://pypi.python.org/pypi/optcomplete

Links
-----
* `Project home page (GitHub) <https://github.com/kislyuk/argcomplete>`_
* `Documentation <https://kislyuk.github.io/argcomplete/>`_
* `Package distribution (PyPI) <https://pypi.python.org/pypi/argcomplete>`_
* `Change log <https://github.com/kislyuk/argcomplete/blob/master/Changes.rst>`_

Bugs
~~~~
Please report bugs, issues, feature requests, etc. on `GitHub <https://github.com/kislyuk/argcomplete/issues>`_.

License
-------
Copyright 2012-2023, Andrey Kislyuk and argcomplete contributors. Licensed under the terms of the
`Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>`_. Distribution of the LICENSE and NOTICE
files with source copies of this package and derivative works is **REQUIRED** as specified by the Apache License.

.. image:: https://github.com/kislyuk/argcomplete/workflows/Python%20package/badge.svg
        :target: https://github.com/kislyuk/argcomplete/actions
.. image:: https://codecov.io/github/kislyuk/argcomplete/coverage.svg?branch=master
        :target: https://codecov.io/github/kislyuk/argcomplete?branch=master
.. image:: https://img.shields.io/pypi/v/argcomplete.svg
        :target: https://pypi.python.org/pypi/argcomplete
.. image:: https://img.shields.io/pypi/l/argcomplete.svg
        :target: https://pypi.python.org/pypi/argcomplete

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kislyuk/argcomplete",
    "name": "argcomplete",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Andrey Kislyuk",
    "author_email": "kislyuk@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5f/39/27605e133e7f4bb0c8e48c9a6b87101515e3446003e0442761f6a02ac35e/argcomplete-3.5.1.tar.gz",
    "platform": "MacOS X",
    "description": "argcomplete - Bash/zsh tab completion for argparse\n==================================================\n*Tab complete all the things!*\n\nArgcomplete provides easy, extensible command line tab completion of arguments for your Python application.\n\nIt makes two assumptions:\n\n* You're using bash or zsh as your shell\n* You're using `argparse <http://docs.python.org/3/library/argparse.html>`_ to manage your command line arguments/options\n\nArgcomplete is particularly useful if your program has lots of options or subparsers, and if your program can\ndynamically suggest completions for your argument/option values (for example, if the user is browsing resources over\nthe network).\n\nInstallation\n------------\n::\n\n    pip install argcomplete\n    activate-global-python-argcomplete\n\nSee `Activating global completion`_ below for details about the second step.\n\nRefresh your shell environment (start a new shell).\n\nSynopsis\n--------\nAdd the ``PYTHON_ARGCOMPLETE_OK`` marker and a call to ``argcomplete.autocomplete()`` to your Python application as\nfollows:\n\n.. code-block:: python\n\n    #!/usr/bin/env python\n    # PYTHON_ARGCOMPLETE_OK\n    import argcomplete, argparse\n    parser = argparse.ArgumentParser()\n    ...\n    argcomplete.autocomplete(parser)\n    args = parser.parse_args()\n    ...\n\nRegister your Python application with your shell's completion framework by running ``register-python-argcomplete``::\n\n    eval \"$(register-python-argcomplete my-python-app)\"\n\nQuotes are significant; the registration will fail without them. See `Global completion`_ below for a way to enable\nargcomplete generally without registering each application individually.\n\nargcomplete.autocomplete(*parser*)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nThis method is the entry point to the module. It must be called **after** ArgumentParser construction is complete, but\n**before** the ``ArgumentParser.parse_args()`` method is called. The method looks for an environment variable that the\ncompletion hook shellcode sets, and if it's there, collects completions, prints them to the output stream (fd 8 by\ndefault), and exits. Otherwise, it returns to the caller immediately.\n\n.. admonition:: Side effects\n\n Argcomplete gets completions by running your program. It intercepts the execution flow at the moment\n ``argcomplete.autocomplete()`` is called. After sending completions, it exits using ``exit_method`` (``os._exit``\n by default). This means if your program has any side effects that happen before ``argcomplete`` is called, those\n side effects will happen every time the user presses ``<TAB>`` (although anything your program prints to stdout or\n stderr will be suppressed). For this reason it's best to construct the argument parser and call\n ``argcomplete.autocomplete()`` as early as possible in your execution flow.\n\n.. admonition:: Performance\n\n If the program takes a long time to get to the point where ``argcomplete.autocomplete()`` is called, the tab completion\n process will feel sluggish, and the user may lose confidence in it. So it's also important to minimize the startup time\n of the program up to that point (for example, by deferring initialization or importing of large modules until after\n parsing options).\n\nSpecifying completers\n---------------------\nYou can specify custom completion functions for your options and arguments. Two styles are supported: callable and\nreadline-style. Callable completers are simpler. They are called with the following keyword arguments:\n\n* ``prefix``: The prefix text of the last word before the cursor on the command line.\n  For dynamic completers, this can be used to reduce the work required to generate possible completions.\n* ``action``: The ``argparse.Action`` instance that this completer was called for.\n* ``parser``: The ``argparse.ArgumentParser`` instance that the action was taken by.\n* ``parsed_args``: The result of argument parsing so far (the ``argparse.Namespace`` args object normally returned by\n  ``ArgumentParser.parse_args()``).\n\nCompleters can return their completions as an iterable of strings or a mapping (dict) of strings to their\ndescriptions (zsh will display the descriptions as context help alongside completions). An example completer for names\nof environment variables might look like this:\n\n.. code-block:: python\n\n    def EnvironCompleter(**kwargs):\n        return os.environ\n\nTo specify a completer for an argument or option, set the ``completer`` attribute of its associated action. An easy\nway to do this at definition time is:\n\n.. code-block:: python\n\n    from argcomplete.completers import EnvironCompleter\n\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"--env-var1\").completer = EnvironCompleter\n    parser.add_argument(\"--env-var2\").completer = EnvironCompleter\n    argcomplete.autocomplete(parser)\n\nIf you specify the ``choices`` keyword for an argparse option or argument (and don't specify a completer), it will be\nused for completions.\n\nA completer that is initialized with a set of all possible choices of values for its action might look like this:\n\n.. code-block:: python\n\n    class ChoicesCompleter(object):\n        def __init__(self, choices):\n            self.choices = choices\n\n        def __call__(self, **kwargs):\n            return self.choices\n\nThe following two ways to specify a static set of choices are equivalent for completion purposes:\n\n.. code-block:: python\n\n    from argcomplete.completers import ChoicesCompleter\n\n    parser.add_argument(\"--protocol\", choices=('http', 'https', 'ssh', 'rsync', 'wss'))\n    parser.add_argument(\"--proto\").completer=ChoicesCompleter(('http', 'https', 'ssh', 'rsync', 'wss'))\n\nNote that if you use the ``choices=<completions>`` option, argparse will show\nall these choices in the ``--help`` output by default. To prevent this, set\n``metavar`` (like ``parser.add_argument(\"--protocol\", metavar=\"PROTOCOL\",\nchoices=('http', 'https', 'ssh', 'rsync', 'wss'))``).\n\nThe following `script <https://raw.github.com/kislyuk/argcomplete/master/docs/examples/describe_github_user.py>`_ uses\n``parsed_args`` and `Requests <http://python-requests.org/>`_ to query GitHub for publicly known members of an\norganization and complete their names, then prints the member description:\n\n.. code-block:: python\n\n    #!/usr/bin/env python\n    # PYTHON_ARGCOMPLETE_OK\n    import argcomplete, argparse, requests, pprint\n\n    def github_org_members(prefix, parsed_args, **kwargs):\n        resource = \"https://api.github.com/orgs/{org}/members\".format(org=parsed_args.organization)\n        return (member['login'] for member in requests.get(resource).json() if member['login'].startswith(prefix))\n\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"--organization\", help=\"GitHub organization\")\n    parser.add_argument(\"--member\", help=\"GitHub member\").completer = github_org_members\n\n    argcomplete.autocomplete(parser)\n    args = parser.parse_args()\n\n    pprint.pprint(requests.get(\"https://api.github.com/users/{m}\".format(m=args.member)).json())\n\n`Try it <https://raw.github.com/kislyuk/argcomplete/master/docs/examples/describe_github_user.py>`_ like this::\n\n    ./describe_github_user.py --organization heroku --member <TAB>\n\nIf you have a useful completer to add to the `completer library\n<https://github.com/kislyuk/argcomplete/blob/master/argcomplete/completers.py>`_, send a pull request!\n\nReadline-style completers\n~~~~~~~~~~~~~~~~~~~~~~~~~\nThe readline_ module defines a completer protocol in rlcompleter_. Readline-style completers are also supported by\nargcomplete, so you can use the same completer object both in an interactive readline-powered shell and on the command\nline. For example, you can use the readline-style completer provided by IPython_ to get introspective completions like\nyou would get in the IPython shell:\n\n.. _readline: http://docs.python.org/3/library/readline.html\n.. _rlcompleter: http://docs.python.org/3/library/rlcompleter.html#completer-objects\n.. _IPython: http://ipython.org/\n\n.. code-block:: python\n\n    import IPython\n    parser.add_argument(\"--python-name\").completer = IPython.core.completer.Completer()\n\n``argcomplete.CompletionFinder.rl_complete`` can also be used to plug in an argparse parser as a readline completer.\n\nPrinting warnings in completers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nNormal stdout/stderr output is suspended when argcomplete runs. Sometimes, though, when the user presses ``<TAB>``, it's\nappropriate to print information about why completions generation failed. To do this, use ``warn``:\n\n.. code-block:: python\n\n    from argcomplete import warn\n\n    def AwesomeWebServiceCompleter(prefix, **kwargs):\n        if login_failed:\n            warn(\"Please log in to Awesome Web Service to use autocompletion\")\n        return completions\n\nUsing a custom completion validator\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nBy default, argcomplete validates your completions by checking if they start with the prefix given to the completer. You\ncan override this validation check by supplying the ``validator`` keyword to ``argcomplete.autocomplete()``:\n\n.. code-block:: python\n\n    def my_validator(completion_candidate, current_input):\n        \"\"\"Complete non-prefix substring matches.\"\"\"\n        return current_input in completion_candidate\n\n    argcomplete.autocomplete(parser, validator=my_validator)\n\nGlobal completion\n-----------------\nIn global completion mode, you don't have to register each argcomplete-capable executable separately. Instead, the shell\nwill look for the string **PYTHON_ARGCOMPLETE_OK** in the first 1024 bytes of any executable that it's running\ncompletion for, and if it's found, follow the rest of the argcomplete protocol as described above.\n\nAdditionally, completion is activated for scripts run as ``python <script>`` and ``python -m <module>``. If you're using\nmultiple Python versions on the same system, the version being used to run the script must have argcomplete installed.\n\n.. admonition:: Bash version compatibility\n\n When using bash, global completion requires bash support for ``complete -D``, which was introduced in bash 4.2. Since\n Mac OS ships with an outdated version of Bash (3.2), you can either use zsh or install a newer version of bash using\n `Homebrew <http://brew.sh/>`_ (``brew install bash`` - you will also need to add ``/opt/homebrew/bin/bash`` to\n ``/etc/shells``, and run ``chsh`` to change your shell). You can check the version of the running copy of bash with\n ``echo $BASH_VERSION``.\n\n.. note:: If you use setuptools/distribute ``scripts`` or ``entry_points`` directives to package your module,\n argcomplete will follow the wrapper scripts to their destination and look for ``PYTHON_ARGCOMPLETE_OK`` in the\n destination code.\n\nIf you choose not to use global completion, or ship a completion module that depends on argcomplete, you must register\nyour script explicitly using ``eval \"$(register-python-argcomplete my-python-app)\"``. Standard completion module\nregistration rules apply: namely, the script name is passed directly to ``complete``, meaning it is only tab completed\nwhen invoked exactly as it was registered. In the above example, ``my-python-app`` must be on the path, and the user\nmust be attempting to complete it by that name. The above line alone would **not** allow you to complete\n``./my-python-app``, or ``/path/to/my-python-app``.\n\nActivating global completion\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nThe script ``activate-global-python-argcomplete`` installs the global completion script\n`bash_completion.d/_python-argcomplete <https://github.com/kislyuk/argcomplete/blob/master/argcomplete/bash_completion.d/_python-argcomplete>`_\ninto an appropriate location on your system for both bash and zsh. The specific location depends on your platform and\nwhether you installed argcomplete system-wide using ``sudo`` or locally (into your user's home directory).\n\nZsh Support\n-----------\nArgcomplete supports zsh. On top of plain completions like in bash, zsh allows you to see argparse help strings as\ncompletion descriptions. All shellcode included with argcomplete is compatible with both bash and zsh, so the same\ncompleter commands ``activate-global-python-argcomplete`` and ``eval \"$(register-python-argcomplete my-python-app)\"``\nwork for zsh as well.\n\nPython Support\n--------------\nArgcomplete requires Python 3.7+.\n\nSupport for other shells\n------------------------\nArgcomplete maintainers provide support only for the bash and zsh shells on Linux and MacOS. For resources related to\nother shells and platforms, including fish, tcsh, xonsh, powershell, and Windows, please see the\n`contrib <https://github.com/kislyuk/argcomplete/tree/develop/contrib>`_ directory.\n\nCommon Problems\n---------------\nIf global completion is not completing your script, bash may have registered a default completion function::\n\n    $ complete | grep my-python-app\n    complete -F _minimal my-python-app\n\nYou can fix this by restarting your shell, or by running ``complete -r my-python-app``.\n\nDebugging\n---------\nSet the ``_ARC_DEBUG`` variable in your shell to enable verbose debug output every time argcomplete runs. This will\ndisrupt the command line composition state of your terminal, but make it possible to see the internal state of the\ncompleter if it encounters problems.\n\nAcknowledgments\n---------------\nInspired and informed by the optcomplete_ module by Martin Blais.\n\n.. _optcomplete: http://pypi.python.org/pypi/optcomplete\n\nLinks\n-----\n* `Project home page (GitHub) <https://github.com/kislyuk/argcomplete>`_\n* `Documentation <https://kislyuk.github.io/argcomplete/>`_\n* `Package distribution (PyPI) <https://pypi.python.org/pypi/argcomplete>`_\n* `Change log <https://github.com/kislyuk/argcomplete/blob/master/Changes.rst>`_\n\nBugs\n~~~~\nPlease report bugs, issues, feature requests, etc. on `GitHub <https://github.com/kislyuk/argcomplete/issues>`_.\n\nLicense\n-------\nCopyright 2012-2023, Andrey Kislyuk and argcomplete contributors. Licensed under the terms of the\n`Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>`_. Distribution of the LICENSE and NOTICE\nfiles with source copies of this package and derivative works is **REQUIRED** as specified by the Apache License.\n\n.. image:: https://github.com/kislyuk/argcomplete/workflows/Python%20package/badge.svg\n        :target: https://github.com/kislyuk/argcomplete/actions\n.. image:: https://codecov.io/github/kislyuk/argcomplete/coverage.svg?branch=master\n        :target: https://codecov.io/github/kislyuk/argcomplete?branch=master\n.. image:: https://img.shields.io/pypi/v/argcomplete.svg\n        :target: https://pypi.python.org/pypi/argcomplete\n.. image:: https://img.shields.io/pypi/l/argcomplete.svg\n        :target: https://pypi.python.org/pypi/argcomplete\n",
    "bugtrack_url": null,
    "license": "Apache Software License",
    "summary": "Bash tab completion for argparse",
    "version": "3.5.1",
    "project_urls": {
        "Change Log": "https://github.com/kislyuk/argcomplete/blob/develop/Changes.rst",
        "Documentation": "https://kislyuk.github.io/argcomplete",
        "Homepage": "https://github.com/kislyuk/argcomplete",
        "Issue Tracker": "https://github.com/kislyuk/argcomplete/issues",
        "Source Code": "https://github.com/kislyuk/argcomplete"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7bea606a6701d491cfae75583c80a6583f8abe9c36c0b9666e867e7cdd62fe8",
                "md5": "e6fc76c73be571612474d4dd07913c0f",
                "sha256": "1a1d148bdaa3e3b93454900163403df41448a248af01b6e849edc5ac08e6c363"
            },
            "downloads": -1,
            "filename": "argcomplete-3.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6fc76c73be571612474d4dd07913c0f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 43498,
            "upload_time": "2024-10-07T04:00:36",
            "upload_time_iso_8601": "2024-10-07T04:00:36.986514Z",
            "url": "https://files.pythonhosted.org/packages/f7/be/a606a6701d491cfae75583c80a6583f8abe9c36c0b9666e867e7cdd62fe8/argcomplete-3.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f3927605e133e7f4bb0c8e48c9a6b87101515e3446003e0442761f6a02ac35e",
                "md5": "d41f3c39f4be81d29bb6166e8e57116a",
                "sha256": "eb1ee355aa2557bd3d0145de7b06b2a45b0ce461e1e7813f5d066039ab4177b4"
            },
            "downloads": -1,
            "filename": "argcomplete-3.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d41f3c39f4be81d29bb6166e8e57116a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 82280,
            "upload_time": "2024-10-07T04:00:39",
            "upload_time_iso_8601": "2024-10-07T04:00:39.242602Z",
            "url": "https://files.pythonhosted.org/packages/5f/39/27605e133e7f4bb0c8e48c9a6b87101515e3446003e0442761f6a02ac35e/argcomplete-3.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-07 04:00:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kislyuk",
    "github_project": "argcomplete",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "argcomplete"
}
        
Elapsed time: 1.02328s