Jedi

Static analysis library for Python powering autocompletion, goto, refactoring, and reference search across editors and IDEs

Library
PyPI
v0.20.0
6,170stars
Custom / Unknown

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
53/100Fair
Development Activity36
Maintenance4
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
77/100Good
Architecture85
Code Quality82
Innovation80
Learning Curve60

Jedi is a static analysis library for Python that provides autocompletion, goto/definition lookup, type inference, refactoring, and find-references functionality, meant to be embedded inside editor and IDE plugins rather than used as a standalone application. It analyzes Python source without executing it, using its own inference engine to resolve names, types, and imports.

Jedi is the autocompletion engine behind IPython’s tab completion and is used as the core library by numerous editor integrations, including jedi-vim, the Python extension for Visual Studio Code (historically), python-lsp-server, and jedi-language-server. Its author has since released a Rust-based successor project (Zuban) aimed at mypy-compatible language serving, but Jedi itself remains widely deployed and actively maintained as the analysis engine behind many existing Python tooling integrations.

What You Get

  • A Script(code).complete(line, column) API returning ranked autocompletion suggestions at a given cursor position
  • goto() and infer() methods for jumping to a name’s definition or inferring its type/value without executing the code
  • get_references() and get_signatures() for find-all-references and call-signature/parameter-hint lookups
  • Basic refactoring support (jedi.api.refactor) for operations like renaming and inlining
  • A static-analysis mode (test/static_analysis) capable of flagging certain classes of errors without running the code
  • Support for cross-version and cross-environment analysis via its own Environment/virtualenv detection, so completions can reflect a target interpreter different from the one running Jedi

Common Use Cases

  • Powering editor/IDE autocompletion plugins (jedi-vim, python-lsp-server, jedi-language-server) for Python
  • Providing IPython’s and other REPLs’ interactive tab-completion
  • Building custom Python tooling that needs goto-definition, find-references, or type inference without invoking a full type checker
  • Implementing lightweight refactoring tools (rename, extract) driven by Jedi’s static analysis of scope and references

Under The Hood

Architecture - Jedi parses Python source into its own AST-like tree (via the sibling parso library) and runs a custom, non-executing inference engine (jedi/inference) that resolves names, attribute access, and imports by static reasoning about scopes, stub files, and (optionally) installed third-party packages; the jedi/api layer wraps this engine behind the stable Script class that editor plugins call, while jedi/plugins extends inference for specific frameworks (e.g. Django) with special-cased handling. Tech Stack - Pure Python with parso as its core parsing dependency and no other required third-party dependencies; it supports analyzing code written for different Python versions/environments than the one Jedi itself runs under via its own Environment abstraction, and is packaged with a classic setup.py/pyproject.toml combination. Code Quality - The test/ directory includes dedicated suites for completion, refactoring, static analysis, and API-level integration tests, run via pytest with CI on GitHub Actions across Python versions; the project has 6,167 GitHub stars, active recent development, and a long operating history (its isitmaintained badges track issue-resolution speed publicly in the README). API Design - The primary entry point is a single Script object constructed from source code, exposing consistently named line/column-based methods (complete, goto, infer, get_references, get_signatures) that mirror the operations an editor’s language-server implementation needs, making it straightforward to wrap Jedi behind the Language Server Protocol (as jedi-language-server and python-lsp-server do).

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search