Debian Codegraph @

PKG-INFO

raw
1 Metadata-Version: 2.1
2 Name: jedi
3 Version: 0.19.1
4 Summary: An autocompletion tool for Python that can be used for text editors.
5 Home-page: https://github.com/davidhalter/jedi
6 Author: David Halter
7 Author-email: [email protected]
8 Maintainer: David Halter
9 Maintainer-email: [email protected]
10 License: MIT
11 Project-URL: Documentation, https://jedi.readthedocs.io/en/latest/
12 Description: ####################################################################################
13 Jedi - an awesome autocompletion, static analysis and refactoring library for Python
14 ####################################################################################
15
16 .. image:: http://isitmaintained.com/badge/open/davidhalter/jedi.svg
17 :target: https://github.com/davidhalter/jedi/issues
18 :alt: The percentage of open issues and pull requests
19
20 .. image:: http://isitmaintained.com/badge/resolution/davidhalter/jedi.svg
21 :target: https://github.com/davidhalter/jedi/issues
22 :alt: The resolution time is the median time an issue or pull request stays open.
23
24 .. image:: https://github.com/davidhalter/jedi/workflows/ci/badge.svg?branch=master
25 :target: https://github.com/davidhalter/jedi/actions
26 :alt: Tests
27
28 .. image:: https://pepy.tech/badge/jedi
29 :target: https://pepy.tech/project/jedi
30 :alt: PyPI Downloads
31
32
33 Jedi is a static analysis tool for Python that is typically used in
34 IDEs/editors plugins. Jedi has a focus on autocompletion and goto
35 functionality. Other features include refactoring, code search and finding
36 references.
37
38 Jedi has a simple API to work with. There is a reference implementation as a
39 `VIM-Plugin <https://github.com/davidhalter/jedi-vim>`_. Autocompletion in your
40 REPL is also possible, IPython uses it natively and for the CPython REPL you
41 can install it. Jedi is well tested and bugs should be rare.
42
43 Jedi can currently be used with the following editors/projects:
44
45 - Vim (jedi-vim_, YouCompleteMe_, deoplete-jedi_, completor.vim_)
46 - `Visual Studio Code`_ (via `Python Extension <https://marketplace.visualstudio.com/items?itemName=ms-python.python>`_)
47 - Emacs (Jedi.el_, company-mode_, elpy_, anaconda-mode_, ycmd_)
48 - Sublime Text (SublimeJEDI_ [ST2 + ST3], anaconda_ [only ST3])
49 - TextMate_ (Not sure if it's actually working)
50 - Kate_ version 4.13+ supports it natively, you have to enable it, though. [`see
51 <https://projects.kde.org/projects/kde/applications/kate/repository/show?rev=KDE%2F4.13>`_]
52 - Atom_ (autocomplete-python-jedi_)
53 - `GNOME Builder`_ (with support for GObject Introspection)
54 - Gedit (gedi_)
55 - wdb_ - Web Debugger
56 - `Eric IDE`_
57 - `IPython 6.0.0+ <https://ipython.readthedocs.io/en/stable/whatsnew/version6.html>`_
58 - `xonsh shell <https://xon.sh/contents.html>`_ has `jedi extension <https://xon.sh/xontribs.html#jedi>`_
59
60 and many more!
61
62 There are a few language servers that use Jedi:
63
64 - `jedi-language-server <https://github.com/pappasam/jedi-language-server>`_
65 - `python-language-server <https://github.com/palantir/python-language-server>`_ (currently unmaintained)
66 - `python-lsp-server <https://github.com/python-lsp/python-lsp-server>`_ (fork from python-language-server)
67 - `anakin-language-server <https://github.com/muffinmad/anakin-language-server>`_
68
69 Here are some pictures taken from jedi-vim_:
70
71 .. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_complete.png
72
73 Completion for almost anything:
74
75 .. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_function.png
76
77 Documentation:
78
79 .. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_pydoc.png
80
81
82 Get the latest version from `github <https://github.com/davidhalter/jedi>`_
83 (master branch should always be kind of stable/working).
84
85 Docs are available at `https://jedi.readthedocs.org/en/latest/
86 <https://jedi.readthedocs.org/en/latest/>`_. Pull requests with enhancements
87 and/or fixes are awesome and most welcome. Jedi uses `semantic versioning
88 <https://semver.org/>`_.
89
90 If you want to stay **up-to-date** with releases, please **subscribe** to this
91 mailing list: https://groups.google.com/g/jedi-announce. To subscribe you can
92 simply send an empty email to ``[email protected]``.
93
94 Issues & Questions
95 ==================
96
97 You can file issues and questions in the `issue tracker
98 <https://github.com/davidhalter/jedi/>`. Alternatively you can also ask on
99 `Stack Overflow <https://stackoverflow.com/questions/tagged/python-jedi>`_ with
100 the label ``python-jedi``.
101
102 Installation
103 ============
104
105 `Check out the docs <https://jedi.readthedocs.org/en/latest/docs/installation.html>`_.
106
107 Features and Limitations
108 ========================
109
110 Jedi's features are listed here:
111 `Features <https://jedi.readthedocs.org/en/latest/docs/features.html>`_.
112
113 You can run Jedi on Python 3.6+ but it should also
114 understand code that is older than those versions. Additionally you should be
115 able to use `Virtualenvs <https://jedi.readthedocs.org/en/latest/docs/api.html#environments>`_
116 very well.
117
118 Tips on how to use Jedi efficiently can be found `here
119 <https://jedi.readthedocs.org/en/latest/docs/features.html#recipes>`_.
120
121 API
122 ---
123
124 You can find a comprehensive documentation for the
125 `API here <https://jedi.readthedocs.org/en/latest/docs/api.html>`_.
126
127 Autocompletion / Goto / Documentation
128 -------------------------------------
129
130 There are the following commands:
131
132 - ``jedi.Script.goto``
133 - ``jedi.Script.infer``
134 - ``jedi.Script.help``
135 - ``jedi.Script.complete``
136 - ``jedi.Script.get_references``
137 - ``jedi.Script.get_signatures``
138 - ``jedi.Script.get_context``
139
140 The returned objects are very powerful and are really all you might need.
141
142 Autocompletion in your REPL (IPython, etc.)
143 -------------------------------------------
144
145 Jedi is a dependency of IPython. Autocompletion in IPython with Jedi is
146 therefore possible without additional configuration.
147
148 Here is an `example video <https://vimeo.com/122332037>`_ how REPL completion
149 can look like.
150 For the ``python`` shell you can enable tab completion in a `REPL
151 <https://jedi.readthedocs.org/en/latest/docs/usage.html#tab-completion-in-the-python-shell>`_.
152
153 Static Analysis
154 ---------------
155
156 For a lot of forms of static analysis, you can try to use
157 ``jedi.Script(...).get_names``. It will return a list of names that you can
158 then filter and work with. There is also a way to list the syntax errors in a
159 file: ``jedi.Script.get_syntax_errors``.
160
161
162 Refactoring
163 -----------
164
165 Jedi supports the following refactorings:
166
167 - ``jedi.Script.inline``
168 - ``jedi.Script.rename``
169 - ``jedi.Script.extract_function``
170 - ``jedi.Script.extract_variable``
171
172 Code Search
173 -----------
174
175 There is support for module search with ``jedi.Script.search``, and project
176 search for ``jedi.Project.search``. The way to search is either by providing a
177 name like ``foo`` or by using dotted syntax like ``foo.bar``. Additionally you
178 can provide the API type like ``class foo.bar.Bar``. There are also the
179 functions ``jedi.Script.complete_search`` and ``jedi.Project.complete_search``.
180
181 Development
182 ===========
183
184 There's a pretty good and extensive `development documentation
185 <https://jedi.readthedocs.org/en/latest/docs/development.html>`_.
186
187 Testing
188 =======
189
190 The test suite uses ``pytest``::
191
192 pip install pytest
193
194 If you want to test only a specific Python version (e.g. Python 3.8), it is as
195 easy as::
196
197 python3.8 -m pytest
198
199 For more detailed information visit the `testing documentation
200 <https://jedi.readthedocs.org/en/latest/docs/testing.html>`_.
201
202 Acknowledgements
203 ================
204
205 Thanks a lot to all the
206 `contributors <https://jedi.readthedocs.org/en/latest/docs/acknowledgements.html>`_!
207
208
209 .. _jedi-vim: https://github.com/davidhalter/jedi-vim
210 .. _youcompleteme: https://github.com/ycm-core/YouCompleteMe
211 .. _deoplete-jedi: https://github.com/zchee/deoplete-jedi
212 .. _completor.vim: https://github.com/maralla/completor.vim
213 .. _Jedi.el: https://github.com/tkf/emacs-jedi
214 .. _company-mode: https://github.com/syohex/emacs-company-jedi
215 .. _elpy: https://github.com/jorgenschaefer/elpy
216 .. _anaconda-mode: https://github.com/proofit404/anaconda-mode
217 .. _ycmd: https://github.com/abingham/emacs-ycmd
218 .. _sublimejedi: https://github.com/srusskih/SublimeJEDI
219 .. _anaconda: https://github.com/DamnWidget/anaconda
220 .. _wdb: https://github.com/Kozea/wdb
221 .. _TextMate: https://github.com/lawrenceakka/python-jedi.tmbundle
222 .. _Kate: https://kate-editor.org
223 .. _Atom: https://atom.io/
224 .. _autocomplete-python-jedi: https://atom.io/packages/autocomplete-python-jedi
225 .. _GNOME Builder: https://wiki.gnome.org/Apps/Builder
226 .. _Visual Studio Code: https://code.visualstudio.com/
227 .. _gedi: https://github.com/isamert/gedi
228 .. _Eric IDE: https://eric-ide.python-projects.org
229
230
231 .. :changelog:
232
233 Changelog
234 ---------
235
236 Unreleased
237 ++++++++++
238
239 0.19.1 (2023-10-02)
240 +++++++++++++++++++
241
242 - Python 3.12 support (Thanks Peter!)
243
244 0.19.0 (2023-07-29)
245 +++++++++++++++++++
246
247 - Python 3.11 support
248 - Massive improvements in performance for ``Interpreter`` (e.g. IPython) users.
249 This especially affects ``pandas`` users with large datasets.
250 - Add ``jedi.settings.allow_unsafe_interpreter_executions`` to make it easier
251 for IPython users to avoid unsafe executions.
252
253 0.18.2 (2022-11-21)
254 +++++++++++++++++++
255
256 - Added dataclass-equivalent for attrs.define
257 - Find fixtures from Pytest entrypoints; Examples of pytest plugins installed
258 like this are pytest-django, pytest-sugar and Faker.
259 - Fixed Project.search, when a venv was involved, which is why for example
260 `:Pyimport django.db` did not work in some cases in jedi-vim.
261 - And many smaller bugfixes
262
263 0.18.1 (2021-11-17)
264 +++++++++++++++++++
265
266 - Implict namespaces are now a separate types in ``Name().type``
267 - Python 3.10 support
268 - Mostly bugfixes
269
270 0.18.0 (2020-12-25)
271 +++++++++++++++++++
272
273 - Dropped Python 2 and Python 3.5
274 - Using ``pathlib.Path()`` as an output instead of ``str`` in most places:
275 - ``Project.path``
276 - ``Script.path``
277 - ``Definition.module_path``
278 - ``Refactoring.get_renames``
279 - ``Refactoring.get_changed_files``
280 - Functions with ``@property`` now return ``property`` instead of ``function``
281 in ``Name().type``
282 - Started using annotations
283 - Better support for the walrus operator
284 - Project attributes are now read accessible
285 - Removed all deprecations
286
287 This is likely going to be the last minor release before 1.0.
288
289 0.17.2 (2020-07-17)
290 +++++++++++++++++++
291
292 - Added an option to pass environment variables to ``Environment``
293 - ``Project(...).path`` exists now
294 - Support for Python 3.9
295 - A few bugfixes
296
297 This will be the last release that supports Python 2 and Python 3.5.
298 ``0.18.0`` will be Python 3.6+.
299
300 0.17.1 (2020-06-20)
301 +++++++++++++++++++
302
303 - Django ``Model`` meta class support
304 - Django Manager support (completion on Managers/QuerySets)
305 - Added Django Stubs to Jedi, thanks to all contributors of the
306 `Django Stubs <https://github.com/typeddjango/django-stubs>`_ project
307 - Added ``SyntaxError.get_message``
308 - Python 3.9 support
309 - Bugfixes (mostly towards Generics)
310
311 0.17.0 (2020-04-14)
312 +++++++++++++++++++
313
314 - Added ``Project`` support. This allows a user to specify which folders Jedi
315 should work with.
316 - Added support for Refactoring. The following refactorings have been
317 implemented: ``Script.rename``, ``Script.inline``,
318 ``Script.extract_variable`` and ``Script.extract_function``.
319 - Added ``Script.get_syntax_errors`` to display syntax errors in the current
320 script.
321 - Added code search capabilities both for individual files and projects. The
322 new functions are ``Project.search``, ``Project.complete_search``,
323 ``Script.search`` and ``Script.complete_search``.
324 - Added ``Script.help`` to make it easier to display a help window to people.
325 Now returns pydoc information as well for Python keywords/operators. This
326 means that on the class keyword it will now return the docstring of Python's
327 builtin function ``help('class')``.
328 - The API documentation is now way more readable and complete. Check it out
329 under https://jedi.readthedocs.io. A lot of it has been rewritten.
330 - Removed Python 3.4 support
331 - Many bugfixes
332
333 This is likely going to be the last minor version that supports Python 2 and
334 Python3.5. Bugfixes will be provided in 0.17.1+. The next minor/major version
335 will probably be Jedi 1.0.0.
336
337 0.16.0 (2020-01-26)
338 +++++++++++++++++++
339
340 - **Added** ``Script.get_context`` to get information where you currently are.
341 - Completions/type inference of **Pytest fixtures**.
342 - Tensorflow, Numpy and Pandas completions should now be about **4-10x faster**
343 after the first time they are used.
344 - Dict key completions are working now. e.g. ``d = {1000: 3}; d[10`` will
345 expand to ``1000``.
346 - Completion for "proxies" works now. These are classes that have a
347 ``__getattr__(self, name)`` method that does a ``return getattr(x, name)``.
348 after loading them initially.
349 - Goto on a function/attribute in a class now goes to the definition in its
350 super class.
351 - Big **Script API Changes**:
352 - The line and column parameters of ``jedi.Script`` are now deprecated
353 - ``completions`` deprecated, use ``complete`` instead
354 - ``goto_assignments`` deprecated, use ``goto`` instead
355 - ``goto_definitions`` deprecated, use ``infer`` instead
356 - ``call_signatures`` deprecated, use ``get_signatures`` instead
357 - ``usages`` deprecated, use ``get_references`` instead
358 - ``jedi.names`` deprecated, use ``jedi.Script(...).get_names()``
359 - ``BaseName.goto_assignments`` renamed to ``BaseName.goto``
360 - Add follow_imports to ``Name.goto``. Now its signature matches
361 ``Script.goto``.
362 - **Python 2 support deprecated**. For this release it is best effort. Python 2
363 has reached the end of its life and now it's just about a smooth transition.
364 Bugs for Python 2 will not be fixed anymore and a third of the tests are
365 already skipped.
366 - Removed ``settings.no_completion_duplicates``. It wasn't tested and nobody
367 was probably using it anyway.
368 - Removed ``settings.use_filesystem_cache`` and
369 ``settings.additional_dynamic_modules``, they have no usage anymore. Pretty
370 much nobody was probably using them.
371
372 0.15.2 (2019-12-20)
373 +++++++++++++++++++
374
375 - Signatures are now detected a lot better
376 - Add fuzzy completions with ``Script(...).completions(fuzzy=True)``
377 - Files bigger than one MB (about 20kLOC) get cropped to avoid getting
378 stuck completely.
379 - Many small Bugfixes
380 - A big refactoring around contexts/values
381
382 0.15.1 (2019-08-13)
383 +++++++++++++++++++
384
385 - Small bugfix and removal of a print statement
386
387 0.15.0 (2019-08-11)
388 +++++++++++++++++++
389
390 - Added file path completions, there's a **new** ``Completion.type`` now:
391 ``path``. Example: ``'/ho`` -> ``'/home/``
392 - ``*args``/``**kwargs`` resolving. If possible Jedi replaces the parameters
393 with the actual alternatives.
394 - Better support for enums/dataclasses
395 - When using Interpreter, properties are now executed, since a lot of people
396 have complained about this. Discussion in #1299, #1347.
397
398 New APIs:
399
400 - ``Name.get_signatures() -> List[Signature]``. Signatures are similar to
401 ``CallSignature``. ``Name.params`` is therefore deprecated.
402 - ``Signature.to_string()`` to format signatures.
403 - ``Signature.params -> List[ParamName]``, ParamName has the
404 following additional attributes ``infer_default()``, ``infer_annotation()``,
405 ``to_string()``, and ``kind``.
406 - ``Name.execute() -> List[Name]``, makes it possible to infer
407 return values of functions.
408
409
410 0.14.1 (2019-07-13)
411 +++++++++++++++++++
412
413 - CallSignature.index should now be working a lot better
414 - A couple of smaller bugfixes
415
416 0.14.0 (2019-06-20)
417 +++++++++++++++++++
418
419 - Added ``goto_*(prefer_stubs=True)`` as well as ``goto_*(prefer_stubs=True)``
420 - Stubs are used now for type inference
421 - Typeshed is used for better type inference
422 - Reworked Name.full_name, should have more correct return values
423
424 0.13.3 (2019-02-24)
425 +++++++++++++++++++
426
427 - Fixed an issue with embedded Python, see https://github.com/davidhalter/jedi-vim/issues/870
428
429 0.13.2 (2018-12-15)
430 +++++++++++++++++++
431
432 - Fixed a bug that led to Jedi spawning a lot of subprocesses.
433
434 0.13.1 (2018-10-02)
435 +++++++++++++++++++
436
437 - Bugfixes, because tensorflow completions were still slow.
438
439 0.13.0 (2018-10-02)
440 +++++++++++++++++++
441
442 - A small release. Some bug fixes.
443 - Remove Python 3.3 support. Python 3.3 support has been dropped by the Python
444 foundation.
445 - Default environments are now using the same Python version as the Python
446 process. In 0.12.x, we used to load the latest Python version on the system.
447 - Added ``include_builtins`` as a parameter to usages.
448 - ``goto_assignments`` has a new ``follow_builtin_imports`` parameter that
449 changes the previous behavior slightly.
450
451 0.12.1 (2018-06-30)
452 +++++++++++++++++++
453
454 - This release forces you to upgrade parso. If you don't, nothing will work
455 anymore. Otherwise changes should be limited to bug fixes. Unfortunately Jedi
456 still uses a few internals of parso that make it hard to keep compatibility
457 over multiple releases. Parso >=0.3.0 is going to be needed.
458
459 0.12.0 (2018-04-15)
460 +++++++++++++++++++
461
462 - Virtualenv/Environment support
463 - F-String Completion/Goto Support
464 - Cannot crash with segfaults anymore
465 - Cleaned up import logic
466 - Understand async/await and autocomplete it (including async generators)
467 - Better namespace completions
468 - Passing tests for Windows (including CI for Windows)
469 - Remove Python 2.6 support
470
471 0.11.1 (2017-12-14)
472 +++++++++++++++++++
473
474 - Parso update - the caching layer was broken
475 - Better usages - a lot of internal code was ripped out and improved.
476
477 0.11.0 (2017-09-20)
478 +++++++++++++++++++
479
480 - Split Jedi's parser into a separate project called ``parso``.
481 - Avoiding side effects in REPL completion.
482 - Numpy docstring support should be much better.
483 - Moved the `settings.*recursion*` away, they are no longer usable.
484
485 0.10.2 (2017-04-05)
486 +++++++++++++++++++
487
488 - Python Packaging sucks. Some files were not included in 0.10.1.
489
490 0.10.1 (2017-04-05)
491 +++++++++++++++++++
492
493 - Fixed a few very annoying bugs.
494 - Prepared the parser to be factored out of Jedi.
495
496 0.10.0 (2017-02-03)
497 +++++++++++++++++++
498
499 - Actual semantic completions for the complete Python syntax.
500 - Basic type inference for ``yield from`` PEP 380.
501 - PEP 484 support (most of the important features of it). Thanks Claude! (@reinhrst)
502 - Added ``get_line_code`` to ``Name`` and ``Completion`` objects.
503 - Completely rewritten the type inference engine.
504 - A new and better parser for (fast) parsing diffs of Python code.
505
506 0.9.0 (2015-04-10)
507 ++++++++++++++++++
508
509 - The import logic has been rewritten to look more like Python's. There is now
510 an ``InferState.modules`` import cache, which resembles ``sys.modules``.
511 - Integrated the parser of 2to3. This will make refactoring possible. It will
512 also be possible to check for error messages (like compiling an AST would give)
513 in the future.
514 - With the new parser, the type inference also completely changed. It's now
515 simpler and more readable.
516 - Completely rewritten REPL completion.
517 - Added ``jedi.names``, a command to do static analysis. Thanks to that
518 sourcegraph guys for sponsoring this!
519 - Alpha version of the linter.
520
521
522 0.8.1 (2014-07-23)
523 +++++++++++++++++++
524
525 - Bugfix release, the last release forgot to include files that improve
526 autocompletion for builtin libraries. Fixed.
527
528 0.8.0 (2014-05-05)
529 +++++++++++++++++++
530
531 - Memory Consumption for compiled modules (e.g. builtins, sys) has been reduced
532 drastically. Loading times are down as well (it takes basically as long as an
533 import).
534 - REPL completion is starting to become usable.
535 - Various small API changes. Generally this release focuses on stability and
536 refactoring of internal APIs.
537 - Introducing operator precedence, which makes calculating correct Array
538 indices and ``__getattr__`` strings possible.
539
540 0.7.0 (2013-08-09)
541 ++++++++++++++++++
542
543 - Switched from LGPL to MIT license.
544 - Added an Interpreter class to the API to make autocompletion in REPL
545 possible.
546 - Added autocompletion support for namespace packages.
547 - Add sith.py, a new random testing method.
548
549 0.6.0 (2013-05-14)
550 ++++++++++++++++++
551
552 - Much faster parser with builtin part caching.
553 - A test suite, thanks @tkf.
554
555 0.5 versions (2012)
556 +++++++++++++++++++
557
558 - Initial development.
559
560 Keywords: python completion refactoring vim
561 Platform: any
562 Classifier: Development Status :: 4 - Beta
563 Classifier: Environment :: Plugins
564 Classifier: Intended Audience :: Developers
565 Classifier: License :: OSI Approved :: MIT License
566 Classifier: Operating System :: OS Independent
567 Classifier: Programming Language :: Python :: 3
568 Classifier: Programming Language :: Python :: 3.6
569 Classifier: Programming Language :: Python :: 3.7
570 Classifier: Programming Language :: Python :: 3.8
571 Classifier: Programming Language :: Python :: 3.9
572 Classifier: Programming Language :: Python :: 3.10
573 Classifier: Programming Language :: Python :: 3.11
574 Classifier: Programming Language :: Python :: 3.12
575 Classifier: Topic :: Software Development :: Libraries :: Python Modules
576 Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
577 Classifier: Topic :: Utilities
578 Requires-Python: >=3.6
579 Provides-Extra: docs
580 Provides-Extra: qa
581 Provides-Extra: testing