A Python client for the Lean Theorem Prover Server API.
Project description
Lean Client
A Python client for the Lean Server API.
This package provides a simple, asynchronous LeanClient to interact with the lean-server.
📦 Installation
As a Standalone Package
To install this package from PyPI (once published):
pip install lean-client
For Development
This package is part of a monorepo. For development, follow the setup instructions in the root README. The recommended installation command within the dev container is:
# This installs the client in editable mode
uv pip install -e .
🚀 Usage
The client is asynchronous and designed to be used with asyncio.
Here is a basic usage example:
import asyncio
from client import LeanClient
async def main():
# Assumes the server is running on http://localhost:8000
# The client can be used as an async context manager.
async with LeanClient("http://localhost:8000") as client:
proof_to_check = "def my_theorem : 1 + 1 = 2 := rfl"
# Optional configuration can be passed as a dictionary.
config = {"timeout": 60}
print(f"Checking proof: '{proof_to_check}'")
result = await client.check_proof(proof_to_check, config=config)
print("\nServer response:")
print(result)
if __name__ == "__main__":
# To run the example, save it as a file (e.g., `test_client.py`)
# and run `python test_client.py` in a terminal where the server is running.
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lmms_lean_client-0.0.1.dev1.tar.gz.
File metadata
- Download URL: lmms_lean_client-0.0.1.dev1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93499660a20820f84911a898becc933ba1cec6c3bec97297e8f78dc06765715e
|
|
| MD5 |
c0f0ec825cee26fd80ffeb7dbd95da6e
|
|
| BLAKE2b-256 |
2277afd4c6c7fff1054c859e21deef0dd24db778ae6638cf42d43cf081772132
|
File details
Details for the file lmms_lean_client-0.0.1.dev1-py3-none-any.whl.
File metadata
- Download URL: lmms_lean_client-0.0.1.dev1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4798ffa21e04a23312a3a47048dbf05ba41ef1313f6b8287d95362f7eaa3ad98
|
|
| MD5 |
b028bb373124f4c0e3181335090cb334
|
|
| BLAKE2b-256 |
b62fe7fb3ee2ccc87592a9770052a95c66b7a8a463f94e9131e1f517a40ae196
|