Skip to content

Python SDK

artano-lemma is the Python distribution of Lemma. It targets the same surface as the Node MCP server, but lets you read the corpus in-process from a notebook or script.

Install

Terminal window
pip install artano-lemma

After install, a lemma command is on your PATH:

Terminal window
lemma paths # where the corpus + schema resolve
lemma list # list every card
lemma show density-of-states # pretty-print one card

Use it from Python

from artano_lemma import load_cards
cards = load_cards()
print(f"{len(cards)} cards loaded")
# filter to one domain
condensed = [c for c in cards if (c.domain or "").startswith("physics-condensed-matter")]
for c in condensed:
print(c.id, c.kind)
# inspect a single card
card = next(c for c in cards if c.id == "density-of-states")
print(card.name)

Pointing at a different corpus

By default the SDK reads the bundled corpus. Pass an explicit path (or set LEMMA_CARDS_DIR) to read a private fork or an unreleased card you are drafting:

from pathlib import Path
from artano_lemma import load_cards
cards = load_cards(Path("/path/to/your/cards"))

Status

The cards loader and the lemma CLI are usable today. The standalone cross-check engine in the SDK is still being finished — for production verification right now, prefer the Node MCP server, which ships hypothesis_crosscheck. artano-lemma is published as a 0.1.0a0 alpha. Apache-2.0.

The full public API surface — typed card models, the validator, the corpus loader, the engine, and the MCP client — is documented in the package source under sdk-py/.