Skip to main content

Python that lacks most of Python. Restricted program generation and execution for tool composition.

Project description

lackpy

Python that lacks most of Python. A micro-inferencer that translates natural language intent into sandboxed tool-composition programs.

PyPI Tests Docs

What it does

$ lackpy -c "read file main.py and count its lines" --profile read_file,find_files

lackpy takes an intent, generates a restricted Python program using a local model you configure (any Ollama-served coder model), validates it against a strict AST whitelist, and runs it with traced tool calls. One MCP call replaces N tool round-trips.

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 (grammar/validator/grader/spec),
                              # no runtime — for tools that only reason about programs

Model inference is built in — calls route through woollama's core (a dependency), so local Ollama and cloud backends (Anthropic, OpenAI, …) all work without a per-vendor extra; cloud backends just need the relevant 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 a working editable checkout, install bothlackpy pins lackpy-lang, which isn't on PyPI until its own tag, so install the local copy first:

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

Quick start

lackpyctl init --ollama-url http://localhost:11434   # writes .lackpy/config.toml
lackpy -c "find all python files" --profile read_file,find_files

lackpyctl init wires a local Ollama model into the inference order — pick the model with --ollama-model (the choice is per-machine, not a package default). Without it, only the deterministic templates/rules tiers run and compositional intents won't generate.

from lackpy.service import LackpyService
from lackpy.kit.toolbox import ToolSpec, ArgSpec
import asyncio

async def main():
    svc = LackpyService()
    result = await svc.delegate("read file README.md", profile=["read_file"])
    print(result["output"])

asyncio.run(main())

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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lackpy-0.14.0.tar.gz (584.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lackpy-0.14.0-py3-none-any.whl (183.4 kB view details)

Uploaded Python 3

File details

Details for the file lackpy-0.14.0.tar.gz.

File metadata

  • Download URL: lackpy-0.14.0.tar.gz
  • Upload date:
  • Size: 584.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lackpy-0.14.0.tar.gz
Algorithm Hash digest
SHA256 0ec4da427dedc1e838f018c554850c9bee14e143f3943f004e10b97ea46b2945
MD5 eb06ec735b8b5a5d8797968748af4460
BLAKE2b-256 63674bdba4dfcc015a772dc65e166a0216de1f71109f3e55419d6e8217c271a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for lackpy-0.14.0.tar.gz:

Publisher: ci.yml on teaguesterling/lackpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lackpy-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: lackpy-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 183.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lackpy-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e6cce9d51b7d52009390e6c4e243da067bec99bd041f84b1fecf0ac1b37afa8
MD5 1f59f4b51b83db24654387eeea415806
BLAKE2b-256 e90fed0192314a49fff67558cf255954d7db564db95aa983f7457e711add65cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for lackpy-0.14.0-py3-none-any.whl:

Publisher: ci.yml on teaguesterling/lackpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page