Metadata-Version: 2.4
Name: slop-ai
Version: 0.1.0rc2
Summary: Python SDK for the SLOP protocol — let AI observe and interact with your app's state
Project-URL: Homepage, https://slopai.dev
Project-URL: Repository, https://github.com/devteapot/slop
Project-URL: Documentation, https://docs.slopai.dev/api/python
Project-URL: Guide, https://docs.slopai.dev/guides/python
License-Expression: MIT
Keywords: ai,llm,protocol,slop,state
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: all
Requires-Dist: pytest>=9.0; extra == 'all'
Requires-Dist: websockets>=12.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: pytest>=9.0; extra == 'dev'
Requires-Dist: websockets>=12.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest>=9.0; extra == 'test'
Provides-Extra: websocket
Requires-Dist: websockets>=12.0; extra == 'websocket'
Description-Content-Type: text/markdown

# `slop-ai`

Python SDK for the [SLOP protocol](https://slopai.dev).

The package includes provider and consumer APIs, descriptor helpers, tree scaling utilities, and transports for ASGI, WebSocket, Unix socket, and stdio flows.

## Install

```bash
pip install slop-ai[websocket]
```

Use the `websocket` extra when you want the standalone WebSocket transport. The core package itself has no required runtime dependencies.

## Quick start

```python
from fastapi import FastAPI
from slop_ai import SlopServer
from slop_ai.transports.asgi import SlopMiddleware

app = FastAPI()
slop = SlopServer("my-api", "My API")

@slop.node("todos")
def todos_node():
    return {
        "type": "collection",
        "items": [
            {"id": str(todo.id), "props": {"title": todo.title, "done": todo.done}}
            for todo in db.get_todos()
        ],
    }

@slop.action("todos", "create", params={"title": "string"})
def create_todo(title: str):
    db.create_todo(title)

app.add_middleware(SlopMiddleware, slop=slop)
```

## Included modules

- `slop_ai.SlopServer` and `slop_ai.SlopConsumer`
- `slop_ai.pick`, `slop_ai.omit`, `slop_ai.normalize_descriptor`
- `slop_ai.transports.asgi`, `.websocket`, `.unix`, `.stdio`
- scaling helpers such as `prepare_tree`, `truncate_tree`, and `auto_compact`

## Documentation

- API reference: https://docs.slopai.dev/api/python
- Python guide: https://docs.slopai.dev/guides/python
- Protocol spec: https://docs.slopai.dev/spec/core/overview
