srclib-python is a srclib toolchain that performs Python code analysis: type checking, documentation generation, jump-to-definition, dependency resolution, etc.
It enables this functionality in any client application whose code analysis is powered by srclib, including Sourcegraph.com.
This toolchain is not a standalone program; it provides additional functionality to applications that use srclib.
First,
install the srclib
program (see srclib installation instructions).
Installing srclib
should automatically install srclib-python
.
To verify that installation succeeded, run:
srclib toolchain list
You should see this srclib-python toolchain in the list.
Now that this toolchain is installed, any program that relies on srclib will support Python.
srclib-python is alpha-quality software. It powers code analysis on Sourcegraph.com but has not been widely tested or adapted for other use cases.
It also expects projects to follow best practices such as including a setup.py
file. It doesn't currently handle
decorators or namespace packages correctly.
There also seems to be a problem with some function parameter type detection.
srclib-python runs on Python 2.7 (and some glue code in Go), but it can still process Python 3 libraries.
srclib-python's type analysis is based on Jedi.