Using Jedi

Jedi is can be used with a variety of plugins, language servers and other software. It is also possible to use Jedi in the Python shell or with IPython.

Below you can also find a list of recipes for type hinting.

Language Servers

Editor Plugins

Visual Studio Code

Sublime Text 2/3



  • Textmate (Not sure if it’s actually working)


GNOME Builder


Eric IDE

Web Debugger

xonsh shell

Jedi is a preinstalled extension in xonsh shell. Run the following command to enable:

xontrib load jedi

and many more!

Tab Completion in the Python Shell

Jedi is a dependency of IPython. Autocompletion in IPython is therefore possible without additional configuration.

Here is an example video how REPL completion can look like in a different shell.

There are two different options how you can use Jedi autocompletion in your python interpreter. One with your custom $HOME/ file and one that uses PYTHONSTARTUP.


To use Jedi completion in Python interpreter, add the following in your shell setup (e.g., .bashrc). This works only on Linux/Mac, because readline is not available on Windows. If you still want Jedi autocompletion in your REPL, just use IPython instead:

export PYTHONSTARTUP="$(python -m jedi repl)"

Then you will be able to use Jedi completer in your Python interpreter:

$ python
Python 3.9.2+ (default, Jul 20 2020, 22:15:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.join('a', 'b').split().in<TAB>            # doctest: +SKIP
..dex   ..sert

Using a Custom $HOME/

jedi.utils.setup_readline(namespace_module=<module 'sphinx.__main__' from '/home/docs/checkouts/'>, fuzzy=False)[source]

This function sets up readline to use Jedi in a Python interactive shell.

If you want to use a custom PYTHONSTARTUP file (typically $HOME/, you can add this piece of code:

    from jedi.utils import setup_readline
except ImportError:
    # Fallback to the stdlib readline completer if it is installed.
    # Taken from
    print("Jedi is not installed, falling back to readline")
        import readline
        import rlcompleter
        readline.parse_and_bind("tab: complete")
    except ImportError:
        print("Readline is not installed either. No tab completion is enabled.")

This will fallback to the readline completer if Jedi is not installed. The readline completer will only complete names in the global namespace, so for example:


will complete to range.

With Jedi the following code:


will complete to range(10).count, this does not work with the default cPython readline completer.

You will also need to add export PYTHONSTARTUP=$HOME/ to your shell profile (usually .bash_profile or .profile if you use bash).


Here are some tips on how to use Jedi efficiently.

Type Hinting

If Jedi cannot detect the type of a function argument correctly (due to the dynamic nature of Python), you can help it by hinting the type using one of the docstring/annotation styles below. Only gradual typing will always work, all the docstring solutions are glorified hacks and more complicated cases will probably not work.

Sphinx style

def myfunction(node, foo):
    Do something with a ``node``.

    :type node: ProgramNode
    :param str foo: foo parameter description
    node.| # complete here


def myfunction(node):
    Do something with a ``node``.

    @type node: ProgramNode
    node.| # complete here


In order to support the numpydoc format, you need to install the numpydoc package.

def foo(var1, var2, long_var_name='hi'):
    A one-line summary that does not use variable names or the
    function name.


    var1 : array_like
        Array_like means all those objects -- lists, nested lists,
        etc. -- that can be converted to an array. We can also
        refer to variables like `var1`.
    var2 : int
        The type above can either refer to an actual Python type
        (e.g. ``int``), or describe the type of the variable in more
        detail, e.g. ``(N,) ndarray`` or ``array_like``.
    long_variable_name : {'hi', 'ho'}, optional
        Choices in brackets, default first when optional.


    var2.| # complete here