Skip to main content

lackpy

Python that lacks most of Python. lackpy runs plain Python that a validator has checked.

PyPI Tests Docs

What it does

A lackpy program is a plain Python 3 program. It uses only a small part of the standard library, and it reads and writes files through pathlib.Path:

from pathlib import Path

path = Path("notes.md")
text = path.read_text()
assert text.count("Status: draft") == 1, "the status line occurs once"
path.write_text(text.replace("Status: draft", "Status: final"))

Before a program runs, a validator checks it against the style guide. Then lackpy runs it. Each file access goes through a path policy that reads the Read(...) and Edit(...) permission rules of Claude Code. A refusal stops the program with an error. It never changes a result.

The same program runs unchanged under python3 from the workspace directory, with the same output. Inside lackpy, it can only do less.

lackpy can also write the program. delegate sends a natural-language intent to a model that you configure, then validates and runs the program it gets back.

Run a program

run_program validates and runs a program that you already have:

lackpy patch.py                      # a program file is the first argument
lackpy count.py --param name=README.md
import asyncio
from lackpy.service import LackpyService

PROGRAM = '''
from pathlib import Path

params = {"name": "README.md"}
text = Path(params["name"]).read_text()
print(len(text.splitlines()))
'''

async def main():
    svc = LackpyService()
    result = await svc.run_program(PROGRAM, params={"name": "pyproject.toml"})
    print(result.success, result.stdout, result.error)

asyncio.run(main())

Delegate an intent

delegate generates a program from an intent, then runs it:

lackpy -c "count the TODO lines in each .cpp file under src"
import asyncio
from lackpy.service import LackpyService

async def main():
    svc = LackpyService()
    result = await svc.delegate("count the TODO lines in each .cpp file under src")
    print(result["program"])
    print(result["stdout"])

asyncio.run(main())

The MCP server (lackpyctl mcp serve, with pip install lackpy[mcp]) gives the same two actions as the run_program and delegate tools. It also has the tools generate, validate and create, and the resources lackpy://config, lackpy://providers and lackpy://language-spec.

The kit-era MCP tools profile_create, profile_info, docs_index and resolve_doc, and the resources lackpy://toolbox and lackpy://profiles, were removed with the tool kits.

Install

pip install lackpy            # runtime + local/cloud model inference (via woollama)
pip install lackpy[full]      # + all optional features (sandbox, mcp, blq, …)

pip install lackpy-lang       # JUST the language (validator, style guide, spec),
                              # no runtime — for tools that only reason about programs

Model calls go through woollama's core, a dependency. Local Ollama and cloud backends (Anthropic, OpenAI, …) all work with no extra for each vendor. A cloud backend needs its API key in your environment.

lackpy and lackpy-lang share the lackpy namespace (PEP 420). Neither ships a top-level lackpy/__init__.py, so import from submodules (from lackpy.lang import validate, from lackpy.service import LackpyService).

Development (monorepo)

This repo builds two distributions. For an editable checkout, install both. lackpy pins lackpy-lang, so install the local copy first:

pip install -e ./packages/lackpy-lang -e ".[dev]"

Quick start

lackpyctl init --ollama-model qwen2.5-coder:7b   # writes .lackpy/config.toml
lackpy -c "read the file README.md"

lackpyctl init adds a local Ollama model to the inference order. The model choice is per machine, not a package default. Without a model, only the templates and rules tiers run, so most intents do not generate.

Documentation

Full docs at lackpy.readthedocs.io:

Part of the Rigged Suite

lackpy is part of the Rigged developer tool suite but is independently installable.

License

Apache-2.0. See LICENSE. Versions up to v0.9.0 were released under AGPL-3.0-or-later.

Metadata

Release files for lackpy 0.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lackpy 0.16.0
File Size Uploaded Provenance Actions
lackpy-0.16.0.tar.gz 1.2 MB With provenance Details for lackpy-0.16.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lackpy 0.16.0
File Interpreter ABI Platform Actions
lackpy-0.16.0-py3-none-any.whl Python 3 none any Details for lackpy-0.16.0-py3-none-any.whl

Total release size: 1.6 MB

Release files / lackpy-0.16.0.tar.gz

Download URL lackpy-0.16.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
b9a4a9e0511baafd8f12a25dfb1e8158ba24a3eaa22c627136509a3db2d960ed
BLAKE2b-256 checksum
How to use checksums
a61e8882af29cd531ca54f7880cf0ac040f063d7a58b02a5aad272715756bbdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / lackpy-0.16.0-py3-none-any.whl

Download URL lackpy-0.16.0-py3-none-any.whl
Size 334.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
383d3f576522364b4ed5745194b425f4837ed6af8df542d4e2ae9d182fd9735b
BLAKE2b-256 checksum
How to use checksums
a1b1b27a48de9a09a12f7ff8f206e45068452e814c12f878b7dda9ba4464137c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for lackpy 0.16.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lackpy-0.16.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page