4 Summary: An autocompletion tool for Python that can be used for text editors.
5 Home-page: https://github.com/davidhalter/jedi
7 Author-email: davidhalter88@gmail.com
8 Maintainer: David Halter
9 Maintainer-email: davidhalter88@gmail.com
11 Project-URL: Documentation, https://jedi.readthedocs.io/en/latest/
12 Keywords: python completion refactoring vim
14 Classifier: Development Status :: 4 - Beta
15 Classifier: Environment :: Plugins
16 Classifier: Intended Audience :: Developers
17 Classifier: License :: OSI Approved :: MIT License
18 Classifier: Operating System :: OS Independent
19 Classifier: Programming Language :: Python :: 3
20 Classifier: Programming Language :: Python :: 3.6
21 Classifier: Programming Language :: Python :: 3.7
22 Classifier: Programming Language :: Python :: 3.8
23 Classifier: Programming Language :: Python :: 3.9
24 Classifier: Programming Language :: Python :: 3.10
25 Classifier: Programming Language :: Python :: 3.11
26 Classifier: Programming Language :: Python :: 3.12
27 Classifier: Topic :: Software Development :: Libraries :: Python Modules
28 Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
29 Classifier: Topic :: Utilities
30 Requires-Python: >=3.6
31 Requires-Dist: parso (<0.9.0,>=0.8.3)
33 Requires-Dist: Jinja2 (==2.11.3) ; extra == 'docs'
34 Requires-Dist: MarkupSafe (==1.1.1) ; extra == 'docs'
35 Requires-Dist: Pygments (==2.8.1) ; extra == 'docs'
36 Requires-Dist: alabaster (==0.7.12) ; extra == 'docs'
37 Requires-Dist: babel (==2.9.1) ; extra == 'docs'
38 Requires-Dist: chardet (==4.0.0) ; extra == 'docs'
39 Requires-Dist: commonmark (==0.8.1) ; extra == 'docs'
40 Requires-Dist: docutils (==0.17.1) ; extra == 'docs'
41 Requires-Dist: future (==0.18.2) ; extra == 'docs'
42 Requires-Dist: idna (==2.10) ; extra == 'docs'
43 Requires-Dist: imagesize (==1.2.0) ; extra == 'docs'
44 Requires-Dist: mock (==1.0.1) ; extra == 'docs'
45 Requires-Dist: packaging (==20.9) ; extra == 'docs'
46 Requires-Dist: pyparsing (==2.4.7) ; extra == 'docs'
47 Requires-Dist: pytz (==2021.1) ; extra == 'docs'
48 Requires-Dist: readthedocs-sphinx-ext (==2.1.4) ; extra == 'docs'
49 Requires-Dist: recommonmark (==0.5.0) ; extra == 'docs'
50 Requires-Dist: requests (==2.25.1) ; extra == 'docs'
51 Requires-Dist: six (==1.15.0) ; extra == 'docs'
52 Requires-Dist: snowballstemmer (==2.1.0) ; extra == 'docs'
53 Requires-Dist: sphinx-rtd-theme (==0.4.3) ; extra == 'docs'
54 Requires-Dist: sphinx (==1.8.5) ; extra == 'docs'
55 Requires-Dist: sphinxcontrib-serializinghtml (==1.1.4) ; extra == 'docs'
56 Requires-Dist: sphinxcontrib-websupport (==1.2.4) ; extra == 'docs'
57 Requires-Dist: urllib3 (==1.26.4) ; extra == 'docs'
59 Requires-Dist: flake8 (==5.0.4) ; extra == 'qa'
60 Requires-Dist: mypy (==0.971) ; extra == 'qa'
61 Requires-Dist: types-setuptools (==67.2.0.1) ; extra == 'qa'
62 Provides-Extra: testing
63 Requires-Dist: Django ; extra == 'testing'
64 Requires-Dist: attrs ; extra == 'testing'
65 Requires-Dist: colorama ; extra == 'testing'
66 Requires-Dist: docopt ; extra == 'testing'
67 Requires-Dist: pytest (<7.0.0) ; extra == 'testing'
69 ####################################################################################
70 Jedi - an awesome autocompletion, static analysis and refactoring library for Python
71 ####################################################################################
73 .. image:: http://isitmaintained.com/badge/open/davidhalter/jedi.svg
74 :target: https://github.com/davidhalter/jedi/issues
75 :alt: The percentage of open issues and pull requests
77 .. image:: http://isitmaintained.com/badge/resolution/davidhalter/jedi.svg
78 :target: https://github.com/davidhalter/jedi/issues
79 :alt: The resolution time is the median time an issue or pull request stays open.
81 .. image:: https://github.com/davidhalter/jedi/workflows/ci/badge.svg?branch=master
82 :target: https://github.com/davidhalter/jedi/actions
85 .. image:: https://pepy.tech/badge/jedi
86 :target: https://pepy.tech/project/jedi
90 Jedi is a static analysis tool for Python that is typically used in
91 IDEs/editors plugins. Jedi has a focus on autocompletion and goto
92 functionality. Other features include refactoring, code search and finding
95 Jedi has a simple API to work with. There is a reference implementation as a
96 `VIM-Plugin <https://github.com/davidhalter/jedi-vim>`_. Autocompletion in your
97 REPL is also possible, IPython uses it natively and for the CPython REPL you
98 can install it. Jedi is well tested and bugs should be rare.
100 Jedi can currently be used with the following editors/projects:
102 - Vim (jedi-vim_, YouCompleteMe_, deoplete-jedi_, completor.vim_)
103 - `Visual Studio Code`_ (via `Python Extension <https://marketplace.visualstudio.com/items?itemName=ms-python.python>`_)
104 - Emacs (Jedi.el_, company-mode_, elpy_, anaconda-mode_, ycmd_)
105 - Sublime Text (SublimeJEDI_ [ST2 + ST3], anaconda_ [only ST3])
106 - TextMate_ (Not sure if it's actually working)
107 - Kate_ version 4.13+ supports it natively, you have to enable it, though. [`see
108 <https://projects.kde.org/projects/kde/applications/kate/repository/show?rev=KDE%2F4.13>`_]
109 - Atom_ (autocomplete-python-jedi_)
110 - `GNOME Builder`_ (with support for GObject Introspection)
112 - wdb_ - Web Debugger
114 - `IPython 6.0.0+ <https://ipython.readthedocs.io/en/stable/whatsnew/version6.html>`_
115 - `xonsh shell <https://xon.sh/contents.html>`_ has `jedi extension <https://xon.sh/xontribs.html#jedi>`_
119 There are a few language servers that use Jedi:
121 - `jedi-language-server <https://github.com/pappasam/jedi-language-server>`_
122 - `python-language-server <https://github.com/palantir/python-language-server>`_ (currently unmaintained)
123 - `python-lsp-server <https://github.com/python-lsp/python-lsp-server>`_ (fork from python-language-server)
124 - `anakin-language-server <https://github.com/muffinmad/anakin-language-server>`_
126 Here are some pictures taken from jedi-vim_:
128 .. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_complete.png
130 Completion for almost anything:
132 .. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_function.png
136 .. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_pydoc.png
139 Get the latest version from `github <https://github.com/davidhalter/jedi>`_
140 (master branch should always be kind of stable/working).
142 Docs are available at `https://jedi.readthedocs.org/en/latest/
143 <https://jedi.readthedocs.org/en/latest/>`_. Pull requests with enhancements
144 and/or fixes are awesome and most welcome. Jedi uses `semantic versioning
145 <https://semver.org/>`_.
147 If you want to stay **up-to-date** with releases, please **subscribe** to this
148 mailing list: https://groups.google.com/g/jedi-announce. To subscribe you can
149 simply send an empty email to ``jedi-announce+subscribe@googlegroups.com``.
154 You can file issues and questions in the `issue tracker
155 <https://github.com/davidhalter/jedi/>`. Alternatively you can also ask on
156 `Stack Overflow <https://stackoverflow.com/questions/tagged/python-jedi>`_ with
157 the label ``python-jedi``.
162 `Check out the docs <https://jedi.readthedocs.org/en/latest/docs/installation.html>`_.
164 Features and Limitations
165 ========================
167 Jedi's features are listed here:
168 `Features <https://jedi.readthedocs.org/en/latest/docs/features.html>`_.
170 You can run Jedi on Python 3.6+ but it should also
171 understand code that is older than those versions. Additionally you should be
172 able to use `Virtualenvs <https://jedi.readthedocs.org/en/latest/docs/api.html#environments>`_
175 Tips on how to use Jedi efficiently can be found `here
176 <https://jedi.readthedocs.org/en/latest/docs/features.html#recipes>`_.
181 You can find a comprehensive documentation for the
182 `API here <https://jedi.readthedocs.org/en/latest/docs/api.html>`_.
184 Autocompletion / Goto / Documentation
185 -------------------------------------
187 There are the following commands:
189 - ``jedi.Script.goto``
190 - ``jedi.Script.infer``
191 - ``jedi.Script.help``
192 - ``jedi.Script.complete``
193 - ``jedi.Script.get_references``
194 - ``jedi.Script.get_signatures``
195 - ``jedi.Script.get_context``
197 The returned objects are very powerful and are really all you might need.
199 Autocompletion in your REPL (IPython, etc.)
200 -------------------------------------------
202 Jedi is a dependency of IPython. Autocompletion in IPython with Jedi is
203 therefore possible without additional configuration.
205 Here is an `example video <https://vimeo.com/122332037>`_ how REPL completion
207 For the ``python`` shell you can enable tab completion in a `REPL
208 <https://jedi.readthedocs.org/en/latest/docs/usage.html#tab-completion-in-the-python-shell>`_.
213 For a lot of forms of static analysis, you can try to use
214 ``jedi.Script(...).get_names``. It will return a list of names that you can
215 then filter and work with. There is also a way to list the syntax errors in a
216 file: ``jedi.Script.get_syntax_errors``.
222 Jedi supports the following refactorings:
224 - ``jedi.Script.inline``
225 - ``jedi.Script.rename``
226 - ``jedi.Script.extract_function``
227 - ``jedi.Script.extract_variable``
232 There is support for module search with ``jedi.Script.search``, and project
233 search for ``jedi.Project.search``. The way to search is either by providing a
234 name like ``foo`` or by using dotted syntax like ``foo.bar``. Additionally you
235 can provide the API type like ``class foo.bar.Bar``. There are also the
236 functions ``jedi.Script.complete_search`` and ``jedi.Project.complete_search``.
241 There's a pretty good and extensive `development documentation
242 <https://jedi.readthedocs.org/en/latest/docs/development.html>`_.
247 The test suite uses ``pytest``::
251 If you want to test only a specific Python version (e.g. Python 3.8), it is as
256 For more detailed information visit the `testing documentation
257 <https://jedi.readthedocs.org/en/latest/docs/testing.html>`_.
262 Thanks a lot to all the
263 `contributors <https://jedi.readthedocs.org/en/latest/docs/acknowledgements.html>`_!
266 .. _jedi-vim: https://github.com/davidhalter/jedi-vim
267 .. _youcompleteme: https://github.com/ycm-core/YouCompleteMe
268 .. _deoplete-jedi: https://github.com/zchee/deoplete-jedi
269 .. _completor.vim: https://github.com/maralla/completor.vim
270 .. _Jedi.el: https://github.com/tkf/emacs-jedi
271 .. _company-mode: https://github.com/syohex/emacs-company-jedi
272 .. _elpy: https://github.com/jorgenschaefer/elpy
273 .. _anaconda-mode: https://github.com/proofit404/anaconda-mode
274 .. _ycmd: https://github.com/abingham/emacs-ycmd
275 .. _sublimejedi: https://github.com/srusskih/SublimeJEDI
276 .. _anaconda: https://github.com/DamnWidget/anaconda
277 .. _wdb: https://github.com/Kozea/wdb
278 .. _TextMate: https://github.com/lawrenceakka/python-jedi.tmbundle
279 .. _Kate: https://kate-editor.org
280 .. _Atom: https://atom.io/
281 .. _autocomplete-python-jedi: https://atom.io/packages/autocomplete-python-jedi
282 .. _GNOME Builder: https://wiki.gnome.org/Apps/Builder
283 .. _Visual Studio Code: https://code.visualstudio.com/
284 .. _gedi: https://github.com/isamert/gedi
285 .. _Eric IDE: https://eric-ide.python-projects.org
299 - Python 3.12 support (Thanks Peter!)
304 - Python 3.11 support
305 - Massive improvements in performance for ``Interpreter`` (e.g. IPython) users.
306 This especially affects ``pandas`` users with large datasets.
307 - Add ``jedi.settings.allow_unsafe_interpreter_executions`` to make it easier
308 for IPython users to avoid unsafe executions.
313 - Added dataclass-equivalent for attrs.define
314 - Find fixtures from Pytest entrypoints; Examples of pytest plugins installed
315 like this are pytest-django, pytest-sugar and Faker.
316 - Fixed Project.search, when a venv was involved, which is why for example
317 `:Pyimport django.db` did not work in some cases in jedi-vim.
318 - And many smaller bugfixes
323 - Implict namespaces are now a separate types in ``Name().type``
324 - Python 3.10 support
330 - Dropped Python 2 and Python 3.5
331 - Using ``pathlib.Path()`` as an output instead of ``str`` in most places:
334 - ``Definition.module_path``
335 - ``Refactoring.get_renames``
336 - ``Refactoring.get_changed_files``
337 - Functions with ``@property`` now return ``property`` instead of ``function``
339 - Started using annotations
340 - Better support for the walrus operator
341 - Project attributes are now read accessible
342 - Removed all deprecations
344 This is likely going to be the last minor release before 1.0.
349 - Added an option to pass environment variables to ``Environment``
350 - ``Project(...).path`` exists now
351 - Support for Python 3.9
354 This will be the last release that supports Python 2 and Python 3.5.
355 ``0.18.0`` will be Python 3.6+.
360 - Django ``Model`` meta class support
361 - Django Manager support (completion on Managers/QuerySets)
362 - Added Django Stubs to Jedi, thanks to all contributors of the
363 `Django Stubs <https://github.com/typeddjango/django-stubs>`_ project
364 - Added ``SyntaxError.get_message``
366 - Bugfixes (mostly towards Generics)
371 - Added ``Project`` support. This allows a user to specify which folders Jedi
373 - Added support for Refactoring. The following refactorings have been
374 implemented: ``Script.rename``, ``Script.inline``,
375 ``Script.extract_variable`` and ``Script.extract_function``.
376 - Added ``Script.get_syntax_errors`` to display syntax errors in the current
378 - Added code search capabilities both for individual files and projects. The
379 new functions are ``Project.search``, ``Project.complete_search``,
380 ``Script.search`` and ``Script.complete_search``.
381 - Added ``Script.help`` to make it easier to display a help window to people.
382 Now returns pydoc information as well for Python keywords/operators. This
383 means that on the class keyword it will now return the docstring of Python's
384 builtin function ``help('class')``.
385 - The API documentation is now way more readable and complete. Check it out
386 under https://jedi.readthedocs.io. A lot of it has been rewritten.
387 - Removed Python 3.4 support
390 This is likely going to be the last minor version that supports Python 2 and
391 Python3.5. Bugfixes will be provided in 0.17.1+. The next minor/major version
392 will probably be Jedi 1.0.0.
397 - **Added** ``Script.get_context`` to get information where you currently are.
398 - Completions/type inference of **Pytest fixtures**.
399 - Tensorflow, Numpy and Pandas completions should now be about **4-10x faster**
400 after the first time they are used.
401 - Dict key completions are working now. e.g. ``d = {1000: 3}; d[10`` will
403 - Completion for "proxies" works now. These are classes that have a
404 ``__getattr__(self, name)`` method that does a ``return getattr(x, name)``.
405 after loading them initially.
406 - Goto on a function/attribute in a class now goes to the definition in its
408 - Big **Script API Changes**:
409 - The line and column parameters of ``jedi.Script`` are now deprecated
410 - ``completions`` deprecated, use ``complete`` instead
411 - ``goto_assignments`` deprecated, use ``goto`` instead
412 - ``goto_definitions`` deprecated, use ``infer`` instead
413 - ``call_signatures`` deprecated, use ``get_signatures`` instead
414 - ``usages`` deprecated, use ``get_references`` instead
415 - ``jedi.names`` deprecated, use ``jedi.Script(...).get_names()``
416 - ``BaseName.goto_assignments`` renamed to ``BaseName.goto``
417 - Add follow_imports to ``Name.goto``. Now its signature matches
419 - **Python 2 support deprecated**. For this release it is best effort. Python 2
420 has reached the end of its life and now it's just about a smooth transition.
421 Bugs for Python 2 will not be fixed anymore and a third of the tests are
423 - Removed ``settings.no_completion_duplicates``. It wasn't tested and nobody
424 was probably using it anyway.
425 - Removed ``settings.use_filesystem_cache`` and
426 ``settings.additional_dynamic_modules``, they have no usage anymore. Pretty
427 much nobody was probably using them.
432 - Signatures are now detected a lot better
433 - Add fuzzy completions with ``Script(...).completions(fuzzy=True)``
434 - Files bigger than one MB (about 20kLOC) get cropped to avoid getting
436 - Many small Bugfixes
437 - A big refactoring around contexts/values
442 - Small bugfix and removal of a print statement
447 - Added file path completions, there's a **new** ``Completion.type`` now:
448 ``path``. Example: ``'/ho`` -> ``'/home/``
449 - ``*args``/``**kwargs`` resolving. If possible Jedi replaces the parameters
450 with the actual alternatives.
451 - Better support for enums/dataclasses
452 - When using Interpreter, properties are now executed, since a lot of people
453 have complained about this. Discussion in #1299, #1347.
457 - ``Name.get_signatures() -> List[Signature]``. Signatures are similar to
458 ``CallSignature``. ``Name.params`` is therefore deprecated.
459 - ``Signature.to_string()`` to format signatures.
460 - ``Signature.params -> List[ParamName]``, ParamName has the
461 following additional attributes ``infer_default()``, ``infer_annotation()``,
462 ``to_string()``, and ``kind``.
463 - ``Name.execute() -> List[Name]``, makes it possible to infer
464 return values of functions.
470 - CallSignature.index should now be working a lot better
471 - A couple of smaller bugfixes
476 - Added ``goto_*(prefer_stubs=True)`` as well as ``goto_*(prefer_stubs=True)``
477 - Stubs are used now for type inference
478 - Typeshed is used for better type inference
479 - Reworked Name.full_name, should have more correct return values
484 - Fixed an issue with embedded Python, see https://github.com/davidhalter/jedi-vim/issues/870
489 - Fixed a bug that led to Jedi spawning a lot of subprocesses.
494 - Bugfixes, because tensorflow completions were still slow.
499 - A small release. Some bug fixes.
500 - Remove Python 3.3 support. Python 3.3 support has been dropped by the Python
502 - Default environments are now using the same Python version as the Python
503 process. In 0.12.x, we used to load the latest Python version on the system.
504 - Added ``include_builtins`` as a parameter to usages.
505 - ``goto_assignments`` has a new ``follow_builtin_imports`` parameter that
506 changes the previous behavior slightly.
511 - This release forces you to upgrade parso. If you don't, nothing will work
512 anymore. Otherwise changes should be limited to bug fixes. Unfortunately Jedi
513 still uses a few internals of parso that make it hard to keep compatibility
514 over multiple releases. Parso >=0.3.0 is going to be needed.
519 - Virtualenv/Environment support
520 - F-String Completion/Goto Support
521 - Cannot crash with segfaults anymore
522 - Cleaned up import logic
523 - Understand async/await and autocomplete it (including async generators)
524 - Better namespace completions
525 - Passing tests for Windows (including CI for Windows)
526 - Remove Python 2.6 support
531 - Parso update - the caching layer was broken
532 - Better usages - a lot of internal code was ripped out and improved.
537 - Split Jedi's parser into a separate project called ``parso``.
538 - Avoiding side effects in REPL completion.
539 - Numpy docstring support should be much better.
540 - Moved the `settings.*recursion*` away, they are no longer usable.
545 - Python Packaging sucks. Some files were not included in 0.10.1.
550 - Fixed a few very annoying bugs.
551 - Prepared the parser to be factored out of Jedi.
556 - Actual semantic completions for the complete Python syntax.
557 - Basic type inference for ``yield from`` PEP 380.
558 - PEP 484 support (most of the important features of it). Thanks Claude! (@reinhrst)
559 - Added ``get_line_code`` to ``Name`` and ``Completion`` objects.
560 - Completely rewritten the type inference engine.
561 - A new and better parser for (fast) parsing diffs of Python code.
566 - The import logic has been rewritten to look more like Python's. There is now
567 an ``InferState.modules`` import cache, which resembles ``sys.modules``.
568 - Integrated the parser of 2to3. This will make refactoring possible. It will
569 also be possible to check for error messages (like compiling an AST would give)
571 - With the new parser, the type inference also completely changed. It's now
572 simpler and more readable.
573 - Completely rewritten REPL completion.
574 - Added ``jedi.names``, a command to do static analysis. Thanks to that
575 sourcegraph guys for sponsoring this!
576 - Alpha version of the linter.
582 - Bugfix release, the last release forgot to include files that improve
583 autocompletion for builtin libraries. Fixed.
588 - Memory Consumption for compiled modules (e.g. builtins, sys) has been reduced
589 drastically. Loading times are down as well (it takes basically as long as an
591 - REPL completion is starting to become usable.
592 - Various small API changes. Generally this release focuses on stability and
593 refactoring of internal APIs.
594 - Introducing operator precedence, which makes calculating correct Array
595 indices and ``__getattr__`` strings possible.
600 - Switched from LGPL to MIT license.
601 - Added an Interpreter class to the API to make autocompletion in REPL
603 - Added autocompletion support for namespace packages.
604 - Add sith.py, a new random testing method.
609 - Much faster parser with builtin part caching.
610 - A test suite, thanks @tkf.
615 - Initial development.