JEDI(1) Jedi JEDI(1) (NAME) jedi - Jedi [: GitHub] [] [: ] [] [: .] [] [: ] [] [: ] [] [: PyPI] [] : Jedi Python IDE . Jedi (autocompletion) (goto) . (refactoring) . Jedi API . VIM . REPL IPython CPython REPL . Jedi . : >>> import jedi >>> source = ''' ... import json ... json.lo''' >>> script = jedi.Script(source, path='example.py') >>> script >>> completions = script.complete(3, len('json.lo')) >>> completions [, ] >>> print(completions[0].complete) ad >>> print(completions[0].name) load jedi-vim : [] Jedi Jedi . Jedi Python IPython . (type hinting) . (Language Servers) o jedi-language-server o python-language-server ( ) o python-lsp-server ( python-language-server) o anakin-language-server (Editor Plugins) Vim o jedi-vim o YouCompleteMe o deoplete-jedi Visual Studio Code o Python Extension Emacs o Jedi.el o elpy o anaconda-mode Sublime Text 2/3 o SublimeJEDI (ST2 ST3) o anaconda ( ST3) SynWrite o SynJedi TextMate o Textmate ( ) Kate o Kate 4.13+ . Atom o autocomplete-python-jedi GNOME Builder o GNOME Builder . Gedit o gedi o Eric IDE (Web Debugger) o wdb xonsh (xonsh shell) Jedi xonsh . : xontrib load jedi ! Tab (Tab Completion in the Python Shell) Jedi IPython IPython . REPL . Jedi python : $HOME/.pythonrc.py PYTHONSTARTUP. PYTHONSTARTUP Jedi ( .bashrc) . Linux/Mac readline Windows . Jedi REPL IPython : export PYTHONSTARTUP="$(python -m jedi repl)" Jedi : $ python Python 3.14.0+ (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 # doctest: +SKIP ..dex ..sert $HOME/.pythonrc.py jedi.utils.setup_readline(namespace_module=, fuzzy=False) readline Jedi . PYTHONSTARTUP ( $HOME/.pythonrc.py) : try: from jedi.utils import setup_readline except ImportError: # Fallback to the stdlib readline completer if it is installed. # Taken from http://docs.python.org/2/library/rlcompleter.html print("Jedi is not installed, falling back to readline") try: import readline import rlcompleter readline.parse_and_bind("tab: complete") except ImportError: print("Readline is not installed either. No tab completion is enabled.") else: setup_readline() Jedi readline . readline (global namespace) : ran range . Jedi : range(10).cou range(10).count readline cPython . export PYTHONSTARTUP=$HOME/.pythonrc.py ( bash .bash_profile .profile) . Jedi . (Type Hinting) Jedi Python docstring (annotation) . (gradual typing) docstring . [] (Official Gradual Typing) Python PEP : o PEP 484 o PEP 526 o PEP 589 TypeDict o :) . (Function annotations): def myfunction(node: ProgramNode, foo: str) -> None: """Do something with a ``node``. """ node.| # complete here for with: import typing x: int = foo() y: typing.Optional[int] = 3 key: str value: Employee for key, value in foo.items(): pass f: Union[int, float] with foo() as f: print(f + 3) PEP-0484 . issue . stub . Sphinx (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 Numpydoc numpydoc numpydoc . def foo(var1, var2, long_var_name='hi'): r""" A one-line summary that does not use variable names or the function name. ... Parameters ---------- 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 API Jedi : o : Script.complete() <#jedi.Script .complete> REPL ( IPython ) <#repl-completion> o / : Script.goto() <#jedi .Script.goto> Script.infer() <#jedi.Script.infer> o : Script.get_names() <#jedi.Script .get_names> Script.get_syntax_errors() <#jedi.Script .get_syntax_errors> o : Script.rename() <#jedi.Script .rename> Script.inline() <#jedi.Script.inline> Script.extract_variable() <#jedi.Script.extract_variable> Script.extract_function() <#jedi.Script.extract_function> o : Script.search() <#jedi.Script.search> Project.search() <#jedi.Project.search> o Python 3.10+ o o / / o virtualenv/venv o type hinting <#type-hinting> o stub o docstring sphinx epydoc numpydoc o . . Jedi : o (builtins) o returns yields yield from o (tuple assignments) / / / (star unpacking) o with-statement / o *args / **kwargs o / lambda / (closures) o (generators) / (iterators) o (descriptors): property / staticmethod / classmethod / o : __call__ __iter__ __next__ __get__ __getitem__ __init__ o list.append() set.add() list.extend() o (list comprehensions) / (ternary expressions) o (relative imports) o getattr() / __getattr__ / __getattribute__ o (function annotations) o sys.path o isinstance if/while/assert o ( pkgutil pkg_resources PEP420) o Django / Flask / Buildout o Pytest (Limitations) Jedi Jedi . Jedi . : o : enum dataclass Jedi . (stubs) . o setattr() __import__() o : globals() locals() object.__dict__ o (Performance Issues) numpy . preload_module() <#jedi.preload_module> Jedi . . PySide wx tensorflow pandas . Jedi () . Jedi . . Dave Halter Jedi Rust Jedi 1.0 . (Security) Script <#jedi.Script> Jedi . Jedi . . load_unsafe_extensions=True Project <#jedi.Project> (c_builtin) Jedi . ..SS Interpreter <#jedi.Interpreter> Interpreter <#jedi.Interpreter> . Jedi (properties) . : (import) . API (API Overview) : /IDE Jedi . API : o complete/goto: Script Interpreter. Jedi . o API <#api-classes> o Python Virtualenv find_system_environments() find_virtualenvs() o / o : preload_module() set_debug_function() Jedi : +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.complete | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.goto | | | | | | | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.infer | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.help | | | | | | | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.get_signatures | | | | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.get_references | | | | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.get_context | | | | (scope context) | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.get_names | | | | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.get_syntax_errors | | | | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.rename | | | | | | | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.inline | | | | | | | (inline) | | | . | | | | | | | | | | | | | | | | | | | | | | | | bar::. | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.extract_variable | | | | (statement) | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.extract_function | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.search | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Script.complete_search | Script.search() | | | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Project.search | | | | | | | . | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ |Project.complete_search | Script.search() | | | | | | | | | . | |Script | | |0.0 | | | | | |class jedi.Script(code=None, *, path=None, environment=None, project=None) | | | Script (completions) (goto) | | |Jedi . Interpreter | | | REPL . | | | . | | | code path . | | | ( ) . | | | sys.path Script : | | |7.0 | | |o 2 | | | project sys_path . | | |o 2 | | | environment sys.path | | |( Environment.get_sys_path) | | |o 2 | | | sys.path Jedi | | | sys path import Jedi . | | | | | |168u | | | line column . Jedi | | | (1-based) (zero based) . | | | . | | |Jedi . | | | . | | |: | | |7.0 | | |3.5 | | | jedi.settings.fast_parser <#jedi.settings.fast_parser> | | | parso ( ). | | |Jedi thread safe | | |Script . | | | . | | | Jedi . | | | | | | . : | | | . | | | | | |168u | | | | | |168u | | |7.0 | | | | | | (Parameters) | | |7.0 | | |o 2 | | |code (str ) -- . | | |o 2 | | |path (str pathlib.Path None) -- '' | | | . | | |o 2 | | |environment (Environment <#jedi.api.environment.Environment>) -- Environment | | | Python virtualenv. | | |o 2 | | |project (Project <#jedi.Project>) -- Project | | | . | | | sys path . | | | | | |168u | | | | | |168u | | |7.0 | | | | | |complete(line=None, column=None, *, fuzzy=False) | | | . | | | . | | |7.0 | | | | | | (Parameters) | | |fuzzy -- False. | | | ooa foobar . | | | | | | (Returns) | | | Completion . | | | "" _ | | | (name mangled) __ . | | | | | | (Return type) | | | Completion <#jedi.api.classes.Completion> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |infer(line=None, column=None, *, only_stubs=False, prefer_stubs=False) | | | . | | | (type inference) Jedi . | | | | | | . goto() | | |infer() goto() | | |import . | | | | | | . | | |7.0 | | | | | | (Parameters) | | |7.0 | | |o 2 | | |only_stubs -- stub . | | |o 2 | | |prefer_stubs -- stub Python . | | | | | |168u | | | | | | (Return type) | | | Name <#jedi.api.classes.Name> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |goto(line=None, column=None, *, follow_imports=False, follow_builtin_imports=False, only_stubs=False, prefer_stubs=False) | | | . | | | import . | | | | | | . | | |7.0 | | | | | | (Parameters) | | |7.0 | | |o 2 | | |follow_imports -- import . | | |o 2 | | |follow_builtin_imports -- follow_imports True | | | builtins ( ) . | | |o 2 | | |only_stubs -- stub . | | |o 2 | | |prefer_stubs -- stub Python . | | | | | |168u | | | | | | (Return type) | | | Name <#jedi.api.classes.Name> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |search(string, *, all_scopes=False) | | | . | | | | | |Project.search(). | | |7.0 | | | | | | (Parameters) | | |all_scopes (bool ) -- False | | | (top level) | | | . | | | | | | (Yields) | | |Name <#jedi.api.classes.Name> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |complete_search(string, **kwargs) | | | Script.search() . | | | | | | . | | |7.0 | | | | | | (Parameters) | | |7.0 | | |o 2 | | |all_scopes (bool ) -- False | | | | | | . | | |o 2 | | |fuzzy -- False. | | | ooa foobar . | | | | | |168u | | | | | | (Yields) | | |Completion <#jedi.api.classes.Completion> | | | | | |168u | | | | | |168u | | |7.0.TP | | |help(line=None, column=None) | | | . Script.goto() | | | . | | | BaseName.docstring() <#jedi.api.classes.BaseName.docstring> | | | . | | | Name(...).type == 'keyword' . | | | docstring help() | | | . | | |7.0 | | | | | | | | | Name <#jedi.api.classes.Name> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |get_references(line=None, column=None, **kwargs) | | | . | | | Jedi Jedi | | | . | | |7.0 | | | | | | | | |7.0 | | |o 2 | | |include_builtins -- True . False | | | ( sys) . | | |o 2 | | |scope -- 'project' . 'file' | | | . | | | | | |168u | | | | | | | | | Name <#jedi.api.classes.Name> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |get_signatures(line=None, column=None) | | | . | | | : | | |7.0 | | |3.5 | | | | | |abs(# <-- cursor is here | | | | | | | | |168u | | | | | |168u | | | abs . : | | |7.0 | | |3.5 | | | | | |abs()# <-- cursor is here | | | | | | | | |168u | | | | | |168u | | | . | | |7.0 | | | | | | | | | Signature <#jedi.api.classes.Signature> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |get_context(line=None, column=None) | | | . | | | . | | |7.0 | | | | | | | | |Name <#jedi.api.classes.Name> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |get_names(**kwargs) | | | . | | |7.0 | | | | | | | | |7.0 | | |o 2 | | |all_scopes -- True | | | . | | |o 2 | | |definitions -- True | | | (a = b a ). | | |o 2 | | |references -- True | | |definitions=True a = b b . | | | | | |168u | | | | | | | | | Name <#jedi.api.classes.Name> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |get_syntax_errors() | | | . | | |7.0 | | | | | | | | | SyntaxError <#jedi.api.errors.SyntaxError> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |rename(line=None, column=None, *, new_name) | | | . | | |7.0 | | | | | | | | |new_name -- . | | | | | | | | |RefactoringError | | | | | | | | |Refactoring <#jedi.api.refactoring.Refactoring> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |extract_variable(line, column, *, new_name, until_line=None, until_column=None) | | | . | | | foo new_name | | |bar : | | |7.0 | | |3.5 | | | | | |foo = 3.1 | | |x = int(foo + 1) | | | | | | | | |168u | | | | | |168u | | | : | | |7.0 | | |3.5 | | | | | |foo = 3.1 | | |bar = foo + 1 | | |x = int(bar) | | | | | | | | |168u | | | | | |168u | | |7.0 | | | | | | | | |7.0 | | |o 2 | | |new_name -- | | | . | | |o 2 | | |until_line (int ) -- | | | Jedi . | | |o 2 | | |until_column (int ) -- | | | Jedi . | | | | | |168u | | | | | | | | |RefactoringError | | | | | | | | |Refactoring <#jedi.api.refactoring.Refactoring> | | | | | |168u | | | | | |168u | | |7.0.TP | | |extract_function(line, column, *, new_name, until_line=None, until_column=None) | | | . | | | foo new_name bar : | | |7.0 | | |3.5 | | | | | |global_var = 3 | | | | | |def x(): | | | foo = 3.1 | | | x = int(foo + 1 + global_var) | | | | | | | | |168u | | | | | |168u | | | : | | |7.0 | | |3.5 | | | | | |global_var = 3 | | | | | |def bar(foo): | | | return int(foo + 1 + global_var) | | | | | |def x(): | | | foo = 3.1 | | | x = bar(foo) | | | | | | | | |168u | | | | | |168u | | |7.0 | | | | | | (Parameters) | | |7.0 | | |o 2 | | |new_name -- . | | |o 2 | | |until_line (int ) -- Jedi . | | |o 2 | | |until_column (int ) -- Jedi . | | | | | |168u | | | | | | (Raises) | | |RefactoringError | | | | | | (Return type) | | |Refactoring <#jedi.api.refactoring.Refactoring> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |inline(line=None, column=None) | | | (inline) . . bar: | | |7.0 | | |3.5 | | | | | |foo = 3.1 | | |bar = foo + 1 | | |x = int(bar) | | | | | | | | |168u | | | | | |168u | | | : | | |7.0 | | |3.5 | | | | | |foo = 3.1 | | |x = int(foo + 1) | | | | | | | | |168u | | | | | |168u | | |7.0 | | | | | | (Raises) | | |RefactoringError | | | | | | (Return type) | | |Refactoring <#jedi.api.refactoring.Refactoring> | | | | | |168u | | | | | |168u | | |0.0 | | | | | |class jedi.Interpreter(code, namespaces, *, project=None, **kwds) | | | (API) Jedi REPL . | | | Script . | | | REPL | | |str.upper Jedi | | | . Jedi str().upper . | | | | | |>>> from os.path import join | | |>>> namespace = locals() | | |>>> script = Interpreter('join("").up', [namespace]) | | |>>> print(script.complete()[0].name) | | |upper | | | | | | Script . | | |7.0 | | | | | | (Parameters) | | |7.0 | | |o 2 | | |code (str ) -- . | | |o 2 | | |namespaces (List [dict ]) -- | | | globals() locals() . | | | | | |168u | | | | | |168u | | | | | |168u | | | (Projects) | | | Jedi . | | | | | | sys | | |Project . | | | | | | . | | |0.0 | | | | | |jedi.get_default_project(path=None) | | | Jedi | | | . Jedi | | | : | | |7.0 | | |1. 3 | | | .jedi/config.json | | |2. 3 | | | : setup.py .git .hg | | |requirements.txt MANIFEST.in. | | | | | |168u | | | | | |168u | | |0.0 | | | | | |class jedi.Project(path, *, environment_path=None, load_unsafe_extensions=False, sys_path=None, added_sys_path=(), smart_sys_path=True) | | | | | |(import resolution) Jedi . Script | | | . . | | |7.0 | | | | | | (Parameters) | | |7.0 | | |o 2 | | |path -- . | | |o 2 | | |environment_path -- | | | (virtual environment). | | |o 2 | | |load_unsafe_extensions -- False. | | | sys path . | | | git | | | (import) . | | |o 2 | | |sys_path -- str. sys path | | |. sys.path ( ) | | | . | | |o 2 | | |added_sys_path -- str. | | |sys path . | | |o 2 | | |smart_sys_path -- () | | | . | | | sys.path . | | | | | |168u | | | | | |168u | | |7.0 | | | | | |classmethod load(path) | | | . | | |.jedi/project.json . | | |7.0 | | | | | | (Parameters) | | |path -- . | | | | | |168u | | | | | |168u | | |7.0 | | | | | |save() | | | .jedi/project.json . | | | | | |168u | | |7.0 | | | | | |added_sys_path | | | sys path . | | | | | |168u | | |7.0 | | | | | |property path | | | . | | | | | |168u | | |7.0 | | | | | |property sys_path | | | sys path . None | | | . | | | | | |168u | | |7.0 | | | | | |property smart_sys_path | | | sys path | | | . | | | | | |168u | | |7.0 | | | | | |property load_unsafe_extensions | | | . | | | | | |168u | | |7.0 | | | | | |search(string, *, all_scopes=False) | | | . | | |Jedi . (generator) | | | . | | | : | | |7.0 | | |o 2 | | |foo foo | | |foo.py foo.pyi. | | |o 2 | | |foo.bar foo bar | | | . | | |o 2 | | |class foo.bar.Bar def foo.bar.baz | | |API . | | | | | |168u | | |7.0 | | | | | | (Parameters) | | |all_scopes (bool ) -- False | | | . | | | | | | (Yields) | | |Name <#jedi.api.classes.Name> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |complete_search(string, **kwargs) | | | Script.search() . | | | . | | |7.0 | | | | | | (Parameters) | | |all_scopes (bool ) -- False | | | . | | | | | | (Yields) | | |Completion <#jedi.api.classes.Completion> | | | | | |168u | | | | | |168u | | | Python Virtualenv | | | (static analysis) . Python . | | |0.0 | | | | | |jedi.find_system_environments(*, env_vars=None) | | | (virtualenvs) Python | | | . Python (portable) | | | . | | | Python . | | |7.0 | | | | | | (Yields) | | |Environment | | | | | |168u | | | | | |168u | | |0.0 | | | | | |jedi.find_virtualenvs(paths=None, *, safe=True, use_environment_vars=True) | | |7.0 | | | | | | (Parameters) | | |7.0 | | |o 2 | | |paths -- | | |Virtualenv . | | | Python . | | |o 2 | | |safe -- True . False | | | python . | | | | | | . (root) . | | |o 2 | | |use_environment_vars -- True . True VIRTUAL_ENV | | | VirtualEnv . | | | CONDA_PREFIX conda | | | . | | | | | |168u | | | | | | (Yields) | | |Environment | | | | | |168u | | | | | |168u | | |0.0 | | | | | |jedi.get_system_environment(version, *, env_vars=None) | | | Python 'X.Y' | | | X Y (major) (minor) . | | |7.0 | | | | | | (Raises) | | |InvalidPythonEnvironment | | | | | | (Returns) | | |Environment | | | | | |168u | | | | | |168u | | |0.0 | | | | | |jedi.create_environment(path, *, safe=True, env_vars=None) | | | Environment Virtualenv | | | . | | |7.0 | | | | | | (Raises) | | |InvalidPythonEnvironment | | | | | | (Returns) | | |Environment | | | | | |168u | | | | | |168u | | |0.0 | | | | | |jedi.get_default_environment() | | | Virtualenv conda . | | | VIRTUAL_ENV CONDA_PREFIX | | | Python . | | | Python | | | (autocompletion) . | | |7.0 | | | | | | (Returns) | | |Environment | | | | | |168u | | | | | |168u | | |0.0 | | | | | |exception jedi.InvalidPythonEnvironment | | | Python Virtualenv | | | Python . | | | | | |168u | | |0.0 | | | | | |class jedi.api.environment.Environment(executable, env_vars=None) | | | Jedi . | | | . create_environment . | | | . | | |7.0 | | | | | |get_sys_path() | | | sys (sys path) . | | | sys.path . | | |7.0 | | | | | | (Returns) | | |list of str | | | | | |168u | | | | | |168u | | |0.0 | | | | | |jedi.preload_module(*modules) | | | Jedi (lazy parsing) . (IDE) . | | |7.0 | | | | | | | | |modules -- . | | | | | |168u | | | | | |168u | | |0.0 | | | | | |jedi.set_debug_function(func_cb=, warnings=True, notices=True, speed=True) | | | (callback) . | | | stdout . | | |7.0 | | | | | | | | |func_cb -- . | | | | | |168u | | | | | |168u | | | | | |0.0 | | | | | |exception jedi.InternalError | | | (subprocess) (crash ). C . Jedi . . | | | | | |168u | | |0.0 | | | | | |exception jedi.RefactoringError | | | (Refactorings) . Script.rename() Script.inline() Script.extract_variable() Script.extract_function() (catch ). . | | | RefactoringError (inlining) . | | | | | |168u | | | | | | (Completions) | | |0.0 | | |3.5 | | | | | |>>> import jedi | | |>>> code = '''import json; json.l''' | | |>>> script = jedi.Script(code, path='example.py') | | |>>> script | | |> | | |>>> completions = script.complete(1, 19) | | |>>> completions | | |[, ] | | |>>> completions[1] | | | | | |>>> completions[1].complete | | |'oads' | | |>>> completions[1].name | | |'loads' | | | | | | | | |168u | | | | | |168u | | | / (Type Inference / Goto) | | |0.0 | | |3.5 | | | | | |>>> import jedi | | |>>> code = '''\ | | |... def my_func(): | | |... print 'called' | | |... | | |... alias = my_func | | |... my_list = [1, None, alias] | | |... inception = my_list[2] | | |... | | |... inception()''' | | |>>> script = jedi.Script(code) | | |>>> | | |>>> script.goto(8, 1) | | |[] | | |>>> | | |>>> script.infer(8, 1) | | |[] | | | | | | | | |168u | | |0.0 | | |3.5 | | | | | |>>> import jedi | | |>>> code = '''\ | | |... x = 3 | | |... if 1 == 2: | | |... x = 4 | | |... else: | | |... del x''' | | |>>> script = jedi.Script(code) | | |>>> rns = script.get_references(5, 8) | | |>>> rns | | |[, | | | , | | | ] | | |>>> rns[1].line | | |3 | | |>>> rns[1].column | | |4 | | | | | | | | |168u | | | | | |168u | | |" (Deprecations)" | | | : | | |0.0 | | |1. 3 | | | . | | |2. 3 | | | (major release) . | | | | | |168u | | |" API (API Return Classes)" | | |" (Abstract Base Class)" | | |0.0 | | | | | |class jedi.api.classes.BaseName(inference_state, name) | | | : object | | | . | | |7.0 | | | | | |property module_path: Path | None | | | /usr/lib/python3.14/os.py | | | | | |168u | | |7.0 | | | | | |property name | | | ///. | | | x = None 'x' . | | |7.0 | | | | | | (Return type) | | |str None | | | | | |168u | | | | | |168u | | |7.0 | | | | | |property type | | | . | | | . . variable Jedi jedi.Script.infer() <#jedi.Script.infer> sys f C x . | | | | | |>>> from jedi import Script | | |>>> source = ''' | | |... import keyword | | |... | | |... class C: | | |... pass | | |... | | |... class D: | | |... pass | | |... | | |... x = D() | | |... | | |... def f(): | | |... pass | | |... | | |... for variable in [keyword, f, C, x]: | | |... variable''' | | | | | | | | |>>> script = Script(source) | | |>>> defs = script.infer() | | | | | | defs line . | | | | | |>>> defs = sorted(defs, key=lambda d: d.line) | | |>>> print(defs) | | |[, | | | , | | | , | | | ] | | | | | | type : | | | | | |>>> defs = [d.type for d in defs] | | |>>> defs[0] | | |'module' | | |>>> defs[1] | | |'class' | | |>>> defs[2] | | |'instance' | | |>>> defs[3] | | |'function' | | | | | | module class instance function param path keyword property statement. | | | | | |168u | | |7.0 | | | | | |property module_name | | | __name__ . | | | | | |>>> from jedi import Script | | |>>> source = 'import json' | | |>>> script = Script(source, path='example.py') | | |>>> d = script.infer()[0] | | |>>> print(d.module_name) | | |json | | | | | | | | |168u | | |7.0 | | | | | |in_builtin_module() | | | (builtin) True . | | | | | |168u | | |7.0 | | | | | |property line | | | ( ). | | | | | |168u | | |7.0 | | | | | |property column | | | ( ). | | | | | |168u | | |7.0 | | | | | |get_definition_start_position() | | | ( ) . . | | |7.0 | | | | | | (Return type) | | |Optional[Tuple[int , int ]] | | | | | |168u | | | | | |168u | | |7.0 | | | | | |get_definition_end_position() | | | ( ) . . | | |7.0 | | | | | | (Return type) | | |Optional[Tuple[int , int ]] | | | | | |168u | | | | | |168u | | |7.0 | | | | | |docstring(raw=False, fast=True) | | | (docstring) . | | |:.sp | | | | | |>>> from jedi import Script | | |>>> source = '''\ | | |... def f(a, b=1): | | |... "Document for function f." | | |... ''' | | |>>> script = Script(source, path='example.py') | | |>>> doc = script.infer(1, len('def f'))[0].docstring() | | |>>> print(doc) | | |f(a, b=1) | | | | | |Document for function f. | | | | | | docstring docstring . | | | docstring raw=True . | | | | | |>>> print(script.infer(1, len('def f'))[0].docstring(raw=True)) | | |Document for function f. | | | | | |7.0 | | | | | | | | |fast -- | | |import foo from foo import bar . | | | . | | |foo.docstring(fast=False) import a | | | a . | | | | | |168u | | | | | |168u | | |7.0 | | | | | |property description | | | Name | | | isinstance def isinstance . | | |: | | | | | |>>> from jedi import Script | | |>>> source = ''' | | |... def f(): | | |... pass | | |... | | |... class C: | | |... pass | | |... | | |... variable = f if random.choice([0,1]) else C''' | | |>>> script = Script(source) # line is maximum by default | | |>>> defs = script.infer(column=3) | | |>>> defs = sorted(defs, key=lambda d: d.line) | | |>>> print(defs) | | |[, | | | ] | | |>>> str(defs[0].description) | | |'def f' | | |>>> str(defs[1].description) | | |'class C' | | | | | | | | |168u | | |7.0 | | | | | |property full_name | | | . | | | [.[...]][.] . | | | | | |. | | |: | | | | | |>>> from jedi import Script | | |>>> source = ''' | | |... import os | | |... os.path.join''' | | |>>> script = Script(source, path='example.py') | | |>>> print(script.infer(3, len('os.path.join'))[0].full_name) | | |os.path.join | | | | | | ( ) 'posixpath.join' | | |'os.path.join' . | | |` . | | | . | | | | | |168u | | |7.0 | | | | | |is_stub() | | | stub True . | | | | | |168u | | |7.0 | | | | | |is_side_effect() | | | self.foo = 3 . self | | | False foo True . | | | | | |168u | | |7.0 | | | | | |goto(*, follow_imports=False, follow_builtin_imports=False, only_stubs=False, prefer_stubs=False) | | | Script.goto() <#jedi.Script.goto> ( ) | | | . | | | Script.get_names() <#jedi.Script.get_names> . | | |7.0 | | | | | | | | |7.0 | | |o 2 | | |follow_imports -- goto . | | |o 2 | | |follow_builtin_imports -- follow_imports True | | | builtins ( ) . | | |o 2 | | |only_stubs -- goto stub . | | |o 2 | | |prefer_stubs -- goto stub . | | | | | |168u | | | | | | | | | Name | | | | | |168u | | | | | |168u | | |7.0 | | | | | |infer(*, only_stubs=False, prefer_stubs=False) | | | Script.infer() <#jedi.Script.infer> | | | . | | | . | | | Jedi . | | | (<=20) | | |docstring . . | | | ( numpy) . | | |7.0 | | | | | | | | |7.0 | | |o 2 | | |only_stubs -- goto stub . | | |o 2 | | |prefer_stubs -- stub | | | . | | | | | |168u | | | | | | | | | Name | | | | | |168u | | | | | |168u | | |7.0 | | | | | |parent() | | | (parent scope) . | | |7.0 | | | | | | | | |Name <#jedi.api.classes.Name> | | | | | |168u | | | | | |168u | | |7.0 | | | | | |get_line_code(before=0, after=0) | | | . | | |7.0 | | | | | | | | |7.0 | | |o 2 | | |before -- n . | | |o 2 | | |after -- n . | | | | | |168u | | | | | | str | | | ( ) (builtin) | | | . | | | | | |168u | | | | | |168u | | |7.0.TP | | |get_signatures() | | | . stub @overload . | | |7.0 | | | | | | | | | BaseSignature | | | | | |168u | | | | | |168u | | |7.0 | | | | | |execute() | | | (type inference) "" . | | |7.0 | | | | | | | | | Name | | | | | |168u | | | | | |168u | | |7.0 | | | | | |get_type_hint() | | | Iterable[int] Union[int, str] . | | | . Callable[[int, str], str] . | | |7.0 | | | | | | | | |str | | | | | |168u | | | | | |168u | | | | | |168u | | |Name | | |0.0 | | | | | |class jedi.api.classes.Name(inference_state, definition) | | | : BaseName | | | Name API Script.goto() <#jedi.Script.goto> Script.infer() <#jedi.Script.infer> . | | |7.0 | | | | | |defined_names() | | | ( ) . | | |7.0 | | | | | | | | | Name | | | | | |168u | | | | | |168u | | |7.0 | | | | | |is_definition() | | | True False . | | | | | |168u | | | | | |168u | | |Completion | | |0.0 | | | | | |class jedi.api.classes.Completion(inference_state, name, stack, like_name_length, is_fuzzy, cached_name=None) | | | : BaseName | | | Completion Script.complete() <#jedi.Script.complete> . . | | |7.0 | | | | | |property complete | | | (non-fuzzy) . None . | | | isinstance: | | |7.0 | | |3.5 | | | | | |isinstan# <-- Cursor is here | | | | | | | | |168u | | | | | |168u | | | 'ce' . settings.py . | | | : | | |7.0 | | |3.5 | | | | | |def foo(param=0): | | | pass | | | | | | | | |168u | | | | | |168u | | | foo(par Completion complete am= . | | | | | |168u | | |7.0 | | | | | |property name_with_symbols | | | name name : | | |7.0 | | |3.5 | | | | | |def foo(param=0): | | | pass | | | | | | | | |168u | | | | | |168u | | | foo( Completion name_with_symbols "param=" . | | | | | |168u | | |7.0 | | | | | |docstring(raw=False, fast=True) | | | BaseName.docstring() . | | | | | |168u | | |7.0 | | | | | |property type | | | BaseName.type() . | | | | | |168u | | |7.0 | | | | | |get_completion_prefix_length() | | | . | | | isinstance: | | |7.0 | | |3.5 | | | | | |isinstan# <-- Cursor is here | | | | | | | | |168u | | | | | |168u | | | 8 len('isinstan') == 8 . | | | : | | |7.0 | | |3.5 | | | | | |def foo(param=0): | | | pass | | | | | | | | |168u | | | | | |168u | | | foo(par 3 . | | | | | |168u | | |0.0 | | | | | |class jedi.api.classes.BaseSignature(inference_state, signature) | | | : Name | | | BaseName.get_signatures() | | | . | | |7.0 | | | | | |property params | | | . | | | *args **kwargs . | | |7.0 | | | | | | | | | ParamName | | | | | |168u | | | | | |168u | | |7.0 | | | | | |to_string() | | | . | | | foo(bar, baz: int, **kwargs) . | | |7.0 | | | | | | | | |str | | | | | |168u | | | | | |168u | | | | | |168u | | |Signature | | |0.0 | | | | | |class jedi.api.classes.Signature(inference_state, signature, call_details) | | | : BaseSignature | | | | | |Script.get_signatures() <#jedi.Script.get_signatures> . | | |7.0 | | | | | |property index | | | . | | | None . | | |7.0 | | | | | | | | |int | | | | | |168u | | | | | |168u | | |7.0 | | | | | |property bracket_start | | | / | | | . . | | |7.0 | | | | | | | | |int , int | | | | | |168u | | | | | |168u | | | | | |168u | | |ParamName | | |0.0 | | | | | |class jedi.api.classes.ParamName(inference_state, definition) | | | : Name | | |7.0 | | | | | |infer_default() | | | 1 def foo(x=1): . | | |7.0 | | | | | | | | | Name | | | | | |168u | | | | | |168u | | |7.0 | | | | | |infer_annotation(**kwargs) | | |7.0 | | | | | | | | |execute_annotation -- True False | | | . | | | | | | | | | Name | | | | | |168u | | | | | |168u | | |7.0 | | | | | |to_string() | | | | | |f: Callable[..., Any]. | | |7.0 | | | | | | | | |str | | | | | |168u | | | | | |168u | | |7.0 | | | | | |property kind | | | enum Parameter | | |inspect . | | |7.0 | | | | | | | | |inspect.Parameter.kind | | | | | |168u | | | | | |168u | | |0.0 | | | | | |class jedi.api.refactoring.Refactoring(inference_state, file_to_node_changes, renames=()) | | | : object | | |7.0 | | | | | |get_renames() -> Iterable [Tuple [Path , Path ]] | | | . | | | | | |168u | | |7.0 | | | | | |apply() | | | . | | | | | |168u | | | | | |168u | | |0.0 | | | | | |class jedi.api.errors.SyntaxError(parso_error) | | | : object | | | Script.get_syntax_errors() <#jedi.Script.get_syntax_errors> . | | |7.0 | | | | | |property line | | | ( ). | | | | | |168u | | |7.0 | | | | | |property column | | | ( ). | | | | | |168u | | |7.0 | | | | | |property until_line | | | ( ). | | | | | |168u | | |7.0 | | | | | |property until_column | | | ( ). | | | | | |168u | | | | | |168u | | | (Installation and Configuration) | | |: | | |0.0 | | |3.5 | | | Jedi (submodule) (vendored) pip . Jedi . virtualenv Jedi . Jedi IDE . | | | Jedi . (Vendoring) . | | | | | |168u | | | | | |168u | | | Jedi ( jedi-vim ) . | | |: | | |0.0 | | |3.5 | | | Jedi <#editor-plugins> . . | | | | | |168u | | | | | |168u | | | (The normal way) | | | Jedi <#editor-plugins> . Jedi . . | | | pip (With pip) | | | Jedi (Python Package Index) pip : | | |0.0 | | |3.5 | | | | | |sudo pip install jedi | | | | | | | | |168u | | | | | |168u | | | ( master) : | | |0.0 | | |3.5 | | | | | |sudo pip install -e git+https://github.com/davidhalter/jedi.git#egg=jedi | | | | | | | | |168u | | |Arch Linux | | | Jedi Arch Linux : | | |0.0 | | |o 2 | | |python-jedi | | | | | |168u | | |( vim : | | |vim-jedi Arch Linux .) | | |Debian | | | Debian unstable . | | | | | | Jedi Fedora . | | | GitHub | | | GitHub . : | | |0.0 | | |3.5 | | | | | |git clone --recurse-submodules https://github.com/davidhalter/jedi | | |cd jedi | | |sudo python setup.py install | | | | | | | | |168u | | | | | |168u | | | submodule | | | jedi-vim Jedi | | |submodule . Vim Vundle | | |Pathogen submodule . | | | (Settings) | | | Jedi . | | | Jedi jedi.settings . | | | . | | | : | | |0.0 | | |3.5 | | | | | |from jedi import settings | | |settings.case_insensitive_completion = True | | | | | | | | |168u | | | | | |168u | | | (Completion output) | | |0.0 | | | | | |jedi.settings.case_insensitive_completion = True | | | (case insensitive). | | | | | |168u | | |0.0 | | | | | |jedi.settings.add_bracket_after_function = False | | | / . | | | | | |168u | | | (Filesystem cache) | | |0.0 | | | | | |jedi.settings.cache_directory = '/build/.cache/jedi' | | | (cache) . | | | Linux ~/.cache/jedi/ OS X | | |~/Library/Caches/Jedi/ Windows %LOCALAPPDATA%\Jedi\Jedi\ . | | | Linux $XDG_CACHE_HOME | | |$XDG_CACHE_HOME/jedi . | | | | | |168u | | | (Parser) | | |0.0 | | | | | |jedi.settings.fast_parser = True | | | (diff parser) Parso . | | | Script <#jedi.Script> . | | | (syntax tree) . | | |0.0 | | | | | |jedi.settings.dynamic_array_additions = True | | | append : [] {} () list/set. | | | | | |168u | | |0.0 | | | | | |jedi.settings.dynamic_params = True | | | (callees) . | | | | | |168u | | |0.0 | | | | | |jedi.settings.dynamic_params_for_other_modules = True | | | . | | | | | |168u | | |0.0 | | | | | |jedi.settings.auto_import_modules = ['gi'] | | | Python . setattr globals() . | | | | | |168u | | | (Caching) | | |0.0 | | | | | |jedi.settings.call_signatures_validity = 3.0 | | | (0.1-0.5s). (cache) . | | | | | |168u | | | Jedi (Jedi Development) | | |: | | |0.0 | | |3.5 | | | Jedi Jedi Jedi . Jedi IDE plugin api . | | | . | | | | | |168u | | | | | |168u | | | (Introduction) | | | Jedi . (type inference) Python . Jedi . . | | | Jedi : | | |0.0 | | |o 2 | | | Jedi | | |o 2 | | | | | |o 2 | | | (Imports & Modules) | | |o 2 | | | (Stubs & Annotations) | | |o 2 | | | (Caching & Recursions) | | |o 2 | | | | | | | | |168u | | |: | | |0.0 | | |3.5 | | | (Testing) . | | | | | |168u | | | | | |168u | | | Jedi (The Jedi Core) | | | Jedi : | | |0.0 | | |o 2 | | | (Parser) | | |o 2 | | | Python | | |o 2 | | |API | | | | | |168u | | | . (parser) jedi.inference ..SS (Parser) | | | Jedi parso . | | | Jedi . . | | | (inference/__init__.py) | | | Jedi : | | |0.0 | | |o 2 | | | (side effects) . Jedi list/tuple/set Jedi ( list.append ). | | |o 2 | | | (magic) : | | |2.0 | | |o 2 | | | (metaclasses) | | |o 2 | | |setattr() / __import__() | | |o 2 | | | globals() locals() object.__dict__ | | | | | |168u | | |o 2 | | | :-) | | | | | |168u | | | << >> (lazy type inference) . infer_expr_stmt . API inference_state (expression) . | | | TODO: jedi . | | | infer_expr_stmt . : | | |0.0 | | |3.5 | | | | | |import datetime | | |datetime.date.toda# <-- cursor here | | | | | | | | |168u | | | | | |168u | | | . datetime.date . infer_expr_stmt date . | | | ( ): | | |0.0 | | |o 2 | | | InferenceState.infer_expr_stmt . | | |o 2 | | | Context.infer_node (dotted path) . | | |o 2 | | | InferenceState.find_types datetime import . | | |o 2 | | | import datetime . | | |o 2 | | | find_types infer_node date datetime . | | | | | |168u | | | datetime.date.foo.bar find_types . ( foo date ). | | | import ExprStmt : | | |0.0 | | |3.5 | | | | | |from foo import bar | | |Date = bar.baz | | | | | | | | |168u | | | | | |168u | | |... . (recursion) infer_expr_stmt . . . (list comprehensions) . | | | Jedi . "" . . . | | | . ..SS (inference/base_value.py) | | | "values" Python . Values "" . | | | ValueSet . Jedi . | | | (inference/finder.py) | | | (scope) . Jedi Python . descripter | | |__getattribute__ __getattr__ global . | | | . | | | (Flow checks) | | | . isinstance . if isinstance(a, type_or_tuple) . ( a == '' -> a ). . | | | API (api/__init__.py api/classes.py) | | | (API) . API : . API . API . API . | | | (Core Extensions) | | | : | | |0.0 | | |o 2 | | | (Iterables & Dynamic Arrays) | | |o 2 | | | (Dynamic Parameters) | | |o 2 | | | (Docstrings) | | |o 2 | | | (Refactoring) | | | | | |168u | | | Jedi Jedi Jedi . | | | (inference/value/iterable.py) | | | Python Jedi Python : | | | lists dicts (generators) (iterators) . | | | (inference/dynamic_params.py) | | | Jedi : | | |0.0 | | |3.5 | | | | | |def foo(bar): | | | bar. # completion here | | |foo(1) | | | | | | | | |168u | | | | | |168u | | | bar int foo('str') . | | | : | | |0.0 | | |o 2 | | |Jedi | | |o 2 | | | foo | | |o 2 | | | . | | | (Docstrings) . | | |jedi.inference.dynamic_params | | | . | | | Jedi : | | |0.0 | | |o 2 | | |Sphinx | | |o 2 | | |Epydoc | | |o 2 | | |Numpydoc | | | | | |168u | | | :type foo: str | | | foo str . | | | | | | . | | | (api/refactoring.py) | | | (Imports & Modules) | | |0.0 | | |o 2 | | | | | |o 2 | | | | | |o 2 | | | | | | | | |168u | | | (inference/compiled.py) | | | (inference/imports.py) | | |jedi.inference.imports import | | |// . | | | . | | | . | | | . | | | import | | | from datetim ( datetime ). | | | (inference/gradual) | | | (stubs) (annotations) Jedi . | | | . | | | (Caching & Recursions) | | |0.0 | | |o 2 | | | (Caching) | | |o 2 | | | (Recursions) | | | | | |168u | | | (cache.py) | | | . | | | . : | | |0.0 | | |o 2 | | | time_cache | | | . | | | | | |168u | | | Jedi (thread-safe ). | | | . | | | API . | | | (recursion.py) | | | Jedi . | | | . Jedi | | | . . | | | jedi.inference.cache Jedi | | | ( thread-safe) execution_recursion_decorator | | | . | | | (Settings) | | | | | | . | | | Jedi | | | (inception!). | | | . | | | . | | |0.0 | | | | | |jedi.inference.recursion.recursion_limit = 15 | | | sys.getrecursionlimit() Jedi. | | | | | |168u | | |0.0 | | | | | |jedi.inference.recursion.total_function_execution_limit = 200 | | | (hard limit) (non-builtin) . | | | | | |168u | | |0.0 | | | | | |jedi.inference.recursion.per_function_execution_limit = 6 | | | . | | | | | |168u | | |0.0 | | | | | |jedi.inference.recursion.per_function_recursion_limit = 2 | | | . | | | Jedi . Jedi . | | | Jedi (Jedi Testing) | | | pytest : | | |0.0 | | |3.5 | | | | | |pip install pytest | | | | | | | | |168u | | | | | |168u | | | ( Python 3.14) : | | |0.0 | | |3.5 | | | | | |python3.14 -m pytest | | | | | | | | |168u | | | | | |168u | | | GitHub Actions . | | | Jedi ! . Blackbox Tests . . | | | API (unit tests) . | | | (Integration Tests - run.py) | | |Jedi << >> ("integration tests") . (type inference) API . Jedi . doctests/unittests . | | | : | | |0.0 | | |o 2 | | | / #? (completions / inference) | | |o 2 | | | (goto): #! | | |o 2 | | | (references): #< | | | | | |168u | | | (How to run tests?) | | |Jedi pytest . pytest . | | | test/completion : | | |0.0 | | |o 2 | | |#? (completions / inference) | | |o 2 | | |#! (goto) | | |o 2 | | |#< (references) | | | | | |168u | | | (third-party) . --thirdparty . | | | -k -m pytest -T (--test-files`) . ``FILE_NAME[:LINE[,LINE[,...]]] FILE_NAME test/completion LINE . : | | | completion/basic.py completion/imports.py: | | |0.0 | | |3.5 | | | | | |pytest test/test_integration.py -T basic.py -T imports.py | | | | | | | | |168u | | | | | |168u | | | 4 6 8 completion/basic.py: | | |0.0 | | |3.5 | | | | | |pytest test/test_integration.py -T basic.py:4,6,8 | | | | | | | | |168u | | | | | |168u | | | pytest --help . | | | (debug) --pdb ..SS (Alternate Test Runner) | | | pytest ./run.py . : | | |0.0 | | |3.5 | | | | | |./run.py basic 4 6 8 50-80 | | | | | | | | |168u | | | | | |168u | | | . | | | (Auto-Completion Tests) | | | . . #? . . : | | |0.0 | | |3.5 | | | | | |#? ['upper'] | | |a = 'foo'; a.upp | | | | | | | | |168u | | | | | |168u | | | (Inference Tests) | | | . : | | |0.0 | | |3.5 | | | | | |#? int() | | |ab = 3; ab | | | | | | | | |168u | | | | | |168u | | | Goto (Goto Tests) | | | Goto : | | |0.0 | | |3.5 | | | | | |abc = 1 | | |#! ['abc=1'] | | |abc | | | | | | | | |168u | | | | | |168u | | | ( ): | | |0.0 | | |3.5 | | | | | |#! 2 ['abc=1'] | | |abc | | | | | | | | |168u | | | | | |168u | | | (Reference Tests) | | | : | | |0.0 | | |3.5 | | | | | |abc = 1 | | |#< (1,0), (3,0) | | |abc | | | | | | | | |168u | | | | | |168u | | | (Refactoring Tests - refactor.py) | | | . . test/refactor ..SS " (History & Acknowledgements)" | | |" (Acknowledgements)" | | |0.0 | | |o 2 | | |Dave Halter Jedi Parso. | | |o 2 | | |Takafumi Arakaki (@tkf) . | | |o 2 | | |Danilo Bargen (@dbrgn) :). | | |o 2 | | |Guido van Rossum (@gvanrossum) pgen2 | | |( lib2to3 ). | | |o 2 | | | . | | | | | |168u | | |" (A Little Bit of History)" | | | Dave. | | | Jedi Star Wars . Jedi Jedi . Monty Python :-). | | | Star Wars . Jedidjah . | | | Jedi VIM . auto-completion . PyCharm VIM . Rope . . | | | . (static analysis) . (parsers) . . . . | | | (refactoring) . Jedi . ( ) gradual typing stubs . | | | . . . . | | | | | |---- | | | | | | . Guido van Rossum auto-completion : | | |0.0 | | |3.5 | | |" ..." | | | | | |168u | | | | | |168u | | | :-). | | |" (Main Authors)" | | |0.0 | | |o 2 | | |David Halter (@davidhalter) <> | | |o 2 | | |Takafumi Arakaki (@tkf) <> | | | | | |168u | | |" (Code Contributors)" | | |0.0 | | |o 2 | | |Danilo Bargen (@dbrgn) <> | | |o 2 | | |Laurens Van Houtven (@lvh) <<_@lvh.cc>> | | |o 2 | | |Aldo Stracquadanio (@Astrac) <> | | |o 2 | | |Jean-Louis Fuchs (@ganwell) <> | | |o 2 | | |tek (@tek) | | |o 2 | | |Yasha Borevich (@jjay) <> | | |o 2 | | |Aaron Griffin <> | | |o 2 | | |andviro (@andviro) | | |o 2 | | |Mike Gilbert (@floppym) <> | | |o 2 | | |Aaron Meurer (@asmeurer) <> | | |o 2 | | |Lubos Trilety <> | | |o 2 | | |Akinori Hattori (@hattya) <> | | |o 2 | | |srusskih (@srusskih) | | |o 2 | | |Steven Silvester (@blink1073) | | |o 2 | | |Colin Duquesnoy (@ColinDuquesnoy) <> | | |o 2 | | |Jorgen Schaefer (@jorgenschaefer) <> | | |o 2 | | |Fredrik Bergroth (@fbergroth) | | |o 2 | | |Mathias Fussenegger (@mfussenegger) | | |o 2 | | |Syohei Yoshida (@syohex) <> | | |o 2 | | |ppalucky (@ppalucky) | | |o 2 | | |immerrr (@immerrr) | | |o 2 | | |Albertas Agejevas (@alga) | | |o 2 | | |Savor d'Isavano (@KenetJervet) <> | | |o 2 | | |Phillip Berndt (@phillipberndt) <> | | |o 2 | | |Ian Lee (@IanLee1521) <> | | |o 2 | | |Farkhad Khatamov (@hatamov) <> | | |o 2 | | |Kevin Kelley (@kelleyk) <> | | |o 2 | | |Sid Shanker (@squidarth) <> | | |o 2 | | |Reinoud Elhorst (@reinhrst) | | |o 2 | | |Guido van Rossum (@gvanrossum) <> | | |o 2 | | |Dmytro Sadovnychyi (@sadovnychyi) <> | | |o 2 | | |Cristi Burca (@scribu) | | |o 2 | | |bstaint (@bstaint) | | |o 2 | | |Mathias Rav (@Mortal) <> | | |o 2 | | |Daniel Fiterman (@dfit99) <> | | |o 2 | | |Simon Ruggier (@sruggier) | | |o 2 | | |Elie Gouzien (@ElieGouzien) | | |o 2 | | |Robin Roth (@robinro) | | |o 2 | | |Malte Plath (@langsamer) | | |o 2 | | |Anton Zub (@zabulazza) | | |o 2 | | |Maksim Novikov (@m-novikov) <> | | |o 2 | | |Tobias Rzepka (@TobiasRzepka) | | |o 2 | | |micbou (@micbou) | | |o 2 | | |Dima Gerasimov (@karlicoss) <> | | |o 2 | | |Max Woerner Chase (@mwchase) <> | | |o 2 | | |Johannes Maria Frank (@jmfrank63) <> | | |o 2 | | |Shane Steinert-Threlkeld (@shanest) <> | | |o 2 | | |Tim Gates (@timgates42) <> | | |o 2 | | |Lior Goldberg (@goldberglior) | | |o 2 | | |Ryan Clary (@mrclary) | | |o 2 | | |Max Mausezahl (@mmaeusezahl) <> | | |o 2 | | |Vladislav Serebrennikov (@endilll).IP o 2 | | |Andrii Kolomoiets (@muffinmad) | | |o 2 | | |Leo Ryu (@Leo-Ryu) | | |o 2 | | |Joseph Birkner (@josephbirkner) | | |o 2 | | |Marcio Mazza (@marciomazza) | | |o 2 | | |Martin Vielsmaier (@moser) <> | | |o 2 | | |TingJia Wu (@WutingjiaX) <> | | |o 2 | | |Nguyn Hng Quan <> | | | | | |168u | | | "" . | | |: (@user) GitHub . | | | (Changelog) | | | (Unreleased) | | |0.20.0 (2026-05-02) | | |0.0 | | |o 2 | | | Python 3.14 | | |o 2 | | | Python 3.8 3.9 | | |o 2 | | | Typeshed | | |o 2 | | | Final/ClassVar | | |o 2 | | | __new__ (signature) TypeVar | | |o 2 | | | Self | | |o 2 | | | TypeAlias type[...] tuple[...] | | | | | |168u | | |0.19.2 (2024-11-10) | | |0.0 | | |o 2 | | | Python 3.13 | | | | | |168u | | |0.19.1 (2023-10-02) | | |0.0 | | |o 2 | | | Python 3.12 ( Peter!) | | | | | |168u | | |0.19.0 (2023-07-29) | | |0.0 | | |o 2 | | | Python 3.11 | | |o 2 | | | Interpreter ( IPython). | | | pandas . | | |o 2 | | | jedi.settings.allow_unsafe_interpreter_executions | | | IPython. | | | | | |168u | | |0.18.2 (2022-11-21) | | |0.0 | | |o 2 | | | dataclass attrs.define | | |o 2 | | | fixture (entrypoints) Pytest pytest | | | pytest-django pytest-sugar Faker. | | |o 2 | | | Project.search venv | | | :Pyimport django.db jedi-vim . | | |o 2 | | | | | | | | |168u | | |0.18.1 (2021-11-17) | | |0.0 | | |o 2 | | | (Implicit namespaces) Name().type | | |o 2 | | | Python 3.10 | | |o 2 | | | | | |0.0 | | |o 2 | | | Python 2 Python 3.5 | | |o 2 | | | pathlib.Path() str : | | |- Project.path | | |- Script.path | | |- Definition.module_path | | |- Refactoring.get_renames | | |- Refactoring.get_changed_files | | |o 2 | | | @property Name().type function property | | |o 2 | | | (annotations) | | |o 2 | | | (walrus operator) | | |o 2 | | | Project | | |o 2 | | | | | | | | |168u | | | 1.0 . | | |0.17.2 (2020-07-17) | | |0.0 | | |o 2 | | | Environment | | |o 2 | | | Project(...).path | | |o 2 | | | Python 3.9 | | |o 2 | | | | | | | | |168u | | | Python 2 Python 3.5 . | | | 0.18.0 Python 3.6+ . | | |0.17.1 (2020-06-20) | | |0.0 | | |o 2 | | | (meta class) Model Django | | |o 2 | | | Django Manager ( Managers/QuerySets) | | |o 2 | | | Django Stubs Jedi | | |Django Stubs | | |o 2 | | | SyntaxError.get_message | | |o 2 | | | Python 3.9 | | |o 2 | | | ( Generics) | | | | | |168u | | |0.17.0 (2020-04-14) | | |0.0 | | |o 2 | | | Project. Jedi . | | |o 2 | | | (Refactoring). : | | |Script.rename Script.inline | | |Script.extract_variable Script.extract_function. | | |o 2 | | | Script.get_syntax_errors . | | |o 2 | | | . : | | |Project.search Project.complete_search | | |Script.search Script.complete_search. | | |o 2 | | | Script.help . | | | pydoc / Python . class (docstring) help('class') Python . | | |o 2 | | | API . | | | . . | | |o 2 | | | Python 3.4 | | |o 2 | | | | | | | | |168u | | | Python 2 Python 3.5 . 0.17.1+ . / Jedi 1.0.0 ..SS 0.16.0 (2020-01-26) | | |0.0 | | |o 2 | | | Script.get_context . | | |o 2 | | | (type inference) Pytest fixtures. | | |o 2 | | | Tensorflow Numpy Pandas - | | |. | | |o 2 | | | d = {1000: 3}; d[10 | | |1000 . | | |o 2 | | | "proxies" . | | |__getattr__(self, name) return getattr(x, name) . | | |o 2 | | | Goto / (attribute) | | | (super class) . | | |o 2 | | |2.0 | | | | | | Script API: | | |7.0 | | |o 2 | | | line column jedi.Script | | |o 2 | | | completions complete | | |o 2 | | | goto_assignments goto | | |o 2 | | | goto_definitions infer | | |o 2 | | | call_signatures get_signatures | | |o 2 | | | usages get_references | | |o 2 | | | jedi.names jedi.Script(...).get_names() | | | | | |168u | | | | | |168u | | |o 2 | | | BaseName.goto_assignments BaseName.goto | | |o 2 | | | follow_imports Name.goto. | | |Script.goto . | | |o 2 | | | Python 2 . (best effort) . Python 2 | | | . | | | Python 2 | | | . | | |o 2 | | | settings.no_completion_duplicates . | | | . | | |o 2 | | | settings.use_filesystem_cache | | |settings.additional_dynamic_modules . | | | . | | | | | |168u | | |0.15.2 (2019-12-20) | | |0.0 | | |o 2 | | | | | |o 2 | | | (fuzzy) Script(...).completions(fuzzy=True) | | |o 2 | | | ( ) | | | (crop) . | | |o 2 | | | | | |o 2 | | | (refactoring) contexts/values | | | | | |168u | | |0.15.1 (2019-08-13) | | |0.0 | | |o 2 | | | print | | | | | |168u | | |0.15.0 (2019-08-11) | | |0.0 | | |o 2 | | | Completion.type : | | |path. : '/ho -> '/home/ | | |o 2 | | | *args/**kwargs. Jedi | | | . | | |o 2 | | | enums/dataclasses | | |o 2 | | | Interpreter (properties) | | | . #1299 #1347. | | | | | |168u | | |API : | | |0.0 | | |o 2 | | |Name.get_signatures() -> List[Signature]. | | |CallSignature . Name.params . | | |o 2 | | |Signature.to_string() . | | |o 2 | | |Signature.params -> List[ParamName] ParamName | | | : infer_default() infer_annotation() | | |to_string() kind. | | |o 2 | | |Name.execute() -> List[Name] | | | . | | |0.0 | | |o 2 | | | CallSignature.index | | |o 2 | | | | | | | | |168u | | |0.14.0 (2019-06-20) | | |0.0 | | |o 2 | | | goto_*(prefer_stubs=True) goto_*(prefer_stubs=True) | | |o 2 | | | stub (type inference) | | |o 2 | | | Typeshed | | |o 2 | | | Name.full_name | | | | | |168u | | |0.13.3 (2019-02-24) | | |0.0 | | |o 2 | | | Python (embedded) | | | | | |168u | | |0.13.2 (2018-12-15) | | |0.0 | | |o 2 | | | (subprocess) Jedi . | | | | | |168u | | |0.13.1 (2018-10-02) | | |0.0 | | |o 2 | | | tensorflow . | | | | | |168u | | |0.13.0 (2018-10-02) | | |0.0 | | |o 2 | | | . . | | |o 2 | | | Python 3.3. Python 3.3 . | | |o 2 | | | Python Python . 0.12.x Python . | | |o 2 | | | include_builtins usages. | | |o 2 | | | goto_assignments follow_builtin_imports . | | | | | |168u | | |0.12.1 (2018-06-30) | | |0.0 | | |o 2 | | | parso . . . Jedi parso . parso >=0.3.0 . | | | | | |168u | | |0.12.0 (2018-04-15) | | |0.0 | | |o 2 | | | Virtualenv/Environment | | |o 2 | | | /Goto F-String | | |o 2 | | | segfault (crash) | | |o 2 | | | import | | |o 2 | | | async/await ( async generators) | | |o 2 | | | (namespace) | | |o 2 | | | Windows ( CI Windows) | | |o 2 | | | Python 2.6 | | | | | |168u | | |0.11.1 (2017-12-14) | | |0.0 | | |o 2 | | | parso - (caching) | | |o 2 | | | usages - . | | |0.0 | | |o 2 | | | Jedi parso. | | |o 2 | | | REPL. | | |o 2 | | | docstring Numpy . | | |o 2 | | | settings.*recursion* . | | | | | |168u | | |0.10.2 (2017-04-05) | | |0.0 | | |o 2 | | | (Python Packaging) . 0.10.1 . | | | | | |168u | | |0.10.1 (2017-04-05) | | |0.0 | | |o 2 | | | . | | |o 2 | | | Jedi. | | | | | |168u | | |0.10.0 (2017-02-03) | | |0.0 | | |o 2 | | | . | | |o 2 | | | (type inference) yield from PEP 380. | | |o 2 | | | PEP 484 ( ). Claude! (@reinhrst) | | |o 2 | | | get_line_code Name Completion. | | |o 2 | | | . | | |o 2 | | | () diff . | | | | | |168u | | |0.9.0 (2015-04-10) | | |0.0 | | |o 2 | | | (import) . InferState.modules sys.modules . | | |o 2 | | | 2to3. (refactoring) . ( AST ) . | | |o 2 | | | . . | | |o 2 | | | REPL. | | |o 2 | | | jedi.names (static analysis). sourcegraph ! | | |o 2 | | | (linter). | | | | | |168u | | |0.8.1 (2014-07-23) | | |0.0 | | |o 2 | | | (builtins) . . | | | | | |168u | | |0.8.0 (2014-05-05) | | |0.0 | | |o 2 | | | ( builtins sys) . ( import ). | | |o 2 | | | REPL . | | |o 2 | | | API. API . | | |o 2 | | | (operator precedence) Array __getattr__ . | | | | | |168u | | |0.7.0 (2013-08-09) | | |0.0 | | |o 2 | | | LGPL MIT. | | |o 2 | | | Interpreter API REPL. | | |o 2 | | | (namespace packages). | | |o 2 | | | sith.py . | | |0.0 | | |o 2 | | | . | | |o 2 | | | @tkf. | | | | | |168u | | |" 0.5 (2012)" | | |0.0 | | |o 2 | | | . | | | | | |168u | | |" (RESOURCES)" | | | | | | : . | | | jedi-announce+subscribe@googlegroups.com . | | |0.0 | | |o 2 | | | Github | | |o 2 | | |Python Package Index | | | | | |168u | | |" (AUTHORS)" | | | Jedi | | |" (COPYRIGHT)" | | | jedi | | +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------+ 0.20.0 September 4, 2026 JEDI(1)