Interact with the Lean theorem prover language server
Actively maintained. Last release 3 months ago, commits in 7 of the last 26 weeks. A safe choice.
pip install leanclientleanclient
Interact with the Lean 4 language server in Python.
leanclient is a thin Python wrapper around the native Lean 4 language server. It enables interaction with a Lean 4 language server instance running in a subprocess.
Check out the documentation for more information.
Key Features
- Interact: Query and change lean files via the LSP.
- Thin wrapper: Directly expose the Lean Language Server.
- Fast: Typically more than 95% of time is spent waiting.
- Parallel: Easy batch processing of files using all your cores.
Quickstart
The best way to get started is to check out this minimal example in Google Colab:
Or try it locally:
-
Setup a new lean project or use an existing one. See the colab notebook for a basic Ubuntu setup.
-
Install the package:
pip install leanclient
# Or with uv:
uv pip install leanclient