Metadata-Version: 2.4
Name: woodglue
Version: 0.0.6
Summary: Self documenting opinionated async server that host logic and data
Project-URL: Repository, https://github.com/walnutgeek/woodglue
Author-email: Walnut Geek <wg@walnutgeek.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: <4.0,>=3.11
Requires-Dist: cryptography
Requires-Dist: lythonic
Requires-Dist: polars
Requires-Dist: pydantic-yaml
Requires-Dist: tornado
Description-Content-Type: text/markdown

# Woodglue

![CI](https://github.com/walnutgeek/woodglue/actions/workflows/ci.yml/badge.svg)
[![Docs](https://github.com/walnutgeek/woodglue/actions/workflows/docs.yml/badge.svg)](https://walnutgeek.github.io/woodglue/)
[![PyPI](https://img.shields.io/pypi/v/woodglue)](https://pypi.org/project/woodglue/)
[![Python](https://img.shields.io/pypi/pyversions/woodglue)](https://pypi.org/project/woodglue/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

JSON-RPC 2.0 server with auto-generated docs, built on [lythonic](https://github.com/walnutgeek/lythonic).

## Architecture

```
┌─────────────────────────────────────────────────┐
│  woodglue                                       │
│  HTTP server · JSON-RPC · Auth · UI · Docs      │
├─────────────────────────────────────────────────┤
│  lythonic                                       │
│  Namespaces · DAGs · Caching · Triggers         │
└─────────────────────────────────────────────────┘
```

**lythonic** provides the core runtime: namespaces for organizing methods, DAG-based orchestration, result caching, and scheduled triggers.

**woodglue** adds the serving layer: a Tornado HTTP server, JSON-RPC 2.0 dispatch, bearer token authentication, a built-in browser UI, and automatic docs generation (llms.txt, OpenAPI, per-method markdown).

## Features

- JSON-RPC 2.0 with multi-namespace routing (`billing.create_invoice`, `analytics.query`)
- Auto-generated docs: `llms.txt` index, per-method markdown, OpenAPI 3.0.3
- Built-in UI for API browsing, trigger management, and DAG visualization
- Bearer token authentication
- Typed async client with auto-resolved return types via `x-global-ref`
- YAML-driven namespace configuration with per-method tags
- DAG orchestration with scheduled triggers (via lythonic)

## Quick Start

```bash
pip install woodglue
```

Define a namespace with methods:

```python
from lythonic.compose.namespace import Namespace
from pydantic import BaseModel

class GreetIn(BaseModel):
    name: str

class GreetOut(BaseModel):
    message: str

def greet(input: GreetIn) -> GreetOut:
    return GreetOut(message=f"Hello, {input.name}!")

ns = Namespace()
ns.register(greet, tags=["api"])
```

Start the server:

```bash
wgl start
```

Endpoints:

- `POST /rpc` -- JSON-RPC 2.0
- `GET /docs/llms.txt` -- LLM-friendly method index
- `GET /docs/openapi.json` -- OpenAPI 3.0.3 spec
- `GET /ui/` -- browser UI

## Documentation

[walnutgeek.github.io/woodglue](https://walnutgeek.github.io/woodglue/)

