__init__.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. """
  2. Jedi is a static analysis tool for Python that is typically used in
  3. IDEs/editors plugins. Jedi has a focus on autocompletion and goto
  4. functionality. Other features include refactoring, code search and finding
  5. references.
  6. Jedi has a simple API to work with. There is a reference implementation as a
  7. `VIM-Plugin <https://github.com/davidhalter/jedi-vim>`_. Autocompletion in your
  8. REPL is also possible, IPython uses it natively and for the CPython REPL you
  9. can install it. Jedi is well tested and bugs should be rare.
  10. Here's a simple example of the autocompletion feature:
  11. >>> import jedi
  12. >>> source = '''
  13. ... import json
  14. ... json.lo'''
  15. >>> script = jedi.Script(source, path='example.py')
  16. >>> script
  17. <Script: 'example.py' ...>
  18. >>> completions = script.complete(3, len('json.lo'))
  19. >>> completions
  20. [<Completion: load>, <Completion: loads>]
  21. >>> print(completions[0].complete)
  22. ad
  23. >>> print(completions[0].name)
  24. load
  25. """
  26. __version__ = '0.19.2'
  27. from jedi.api import Script, Interpreter, set_debug_function, preload_module
  28. from jedi import settings
  29. from jedi.api.environment import find_virtualenvs, find_system_environments, \
  30. get_default_environment, InvalidPythonEnvironment, create_environment, \
  31. get_system_environment, InterpreterEnvironment
  32. from jedi.api.project import Project, get_default_project
  33. from jedi.api.exceptions import InternalError, RefactoringError
  34. # Finally load the internal plugins. This is only internal.
  35. from jedi.plugins import registry
  36. del registry