Registry / ai-ml / leanclient

leanclient

JSON →
library0.10.0pypypi✓ verified 30d ago

LeanClient is a Python library for interacting with the Lean theorem prover language server. It provides a client interface to the Lean 4 server, enabling automated theorem proving, project manipulation, and environment queries. Current version is 0.10.0, with a monthly release cadence.

ai-mldevops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from leanclient import LeanLSPClient
from leanclient import LeanClientPool
from leanclient import SingleFileClient

Initialize LeanClient, connect to a Lean server (specify Lean version or path to lake), and evaluate a simple expression.

import os from leanclient import LeanClient # Connect to an existing Lean server (e.g., via LSP) client = LeanClient( lean_version="v4.7.0", lake_path=os.environ.get('LAKE_PATH', '') ) # Evaluate a Lean expression result = client.evaluate("1+1") print(result) # "2"
Debug
Known footguns
breakingIn version 0.10.0, the `LeanClient` constructor now requires `lean_version` or `lake_path`. Omitting both raises `ValueError`. Previously some defaults were assumed.
deprecatedThe `LeanClient.connect()` method is deprecated since 0.9.0. Use direct instantiation.
gotchaThe library only supports Lean 4 (not Lean 3). Using it with Lean 3 projects will fail.
gotchaThe environment variable `LAKE_PATH` is not set automatically. If you don't set it, lake may not be found.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
12 hits · last 30 days
gptbot
3
amazonbot
3
mj12bot
1
ahrefsbot
1
Resources