Metadata-Version: 2.4
Name: richforms
Version: 0.5.0
Summary: Turn Pydantic models into interactive Rich terminal forms — with built-in Click & Typer integrations.
Project-URL: Homepage, https://github.com/shinybrar/richforms
Project-URL: Documentation, https://shinybrar.github.io/richforms
Project-URL: Repository, https://github.com/shinybrar/richforms
Project-URL: Issues, https://github.com/shinybrar/richforms/issues
Project-URL: Changelog, https://github.com/shinybrar/richforms/releases
Author-email: Shiny Brar <shiny.brar@nrc-cnrc.gc.ca>
Maintainer-email: Shiny Brar <shiny.brar@nrc-cnrc.gc.ca>
License-Expression: MIT
License-File: LICENSE
Keywords: cli,click,forms,interactive,prompt,pydantic,rich,terminal,tui,typer,validation
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Framework :: Pydantic
Classifier: Framework :: Pydantic :: 2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pydantic>=2.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=14.0
Requires-Dist: typer>=0.20
Description-Content-Type: text/markdown

# richforms

`richforms` turns Pydantic models into rich interactive terminal forms.

## Installation

You can add `richforms` to your project with `uv`.

```bash
uv add richforms
```

## Usage

You can start from Python in-process or from the bundled CLI.

### Python API

```python
from richforms.example.model import Metadata
from richforms import fill


metadata = fill(Metadata)
print(metadata.model_dump_json(indent=2))
```

### CLI

```bash
richforms fill richforms.example.model:Metadata --output project-metadata.json
```

### Integrations

You can integrate `richforms` directly into Click and Typer option callbacks.

```python
import typer

from richforms.integrations.typer import form_callback
from richforms.example.model import Metadata

app = typer.Typer()


@app.command()
def release(
    metadata: Metadata = typer.Option(
        None,
        callback=form_callback(Metadata),
    ),
) -> None:
    print(metadata.model_dump())
```

## Documentation

For more information, see the [documentation](https://shinybrar.github.io/richforms/).
