Metadata-Version: 2.4
Name: velotype
Version: 0.2.0
Summary: Velarium IR to .pyi stub generation (velotype backend)
Project-URL: Homepage, https://github.com/eddiethedean/velarium
Project-URL: Repository, https://github.com/eddiethedean/velarium
Project-URL: Documentation, https://github.com/eddiethedean/velarium/blob/main/docs/README.md
Project-URL: Changelog, https://github.com/eddiethedean/velarium/blob/main/CHANGELOG.md
Author: Velarium contributors
License: MIT
Keywords: ir,pyi,static-analysis,stubs,typing,velarium
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
Requires-Dist: typer>=0.9.0
Requires-Dist: velarium>=0.2.0
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ty>=0.0.29; extra == 'dev'
Description-Content-Type: text/markdown

# velotype

**Role in Velarium:** **IR → `.pyi`** — render Velarium (ModelSpec) IR as minimal stub text, and expose the **`velotype`** CLI for quick IR export and stub generation from live classes.

| | |
|---|---|
| **PyPI** | `velotype` |
| **Depends on** | [**velarium**](../velarium/README.md) (required) |
| **CLI** | `velotype ir`, `velotype stub` (also `python -m velotype`) |

The IR types and builders live in **`velarium`**. **`velotype`** re-exports most public IR symbols (same layout as **`velarium`**) for convenience; prefer `from velarium import …` in new code when you only need IR.

**Stub output:** `generate_pyi` / `render_typespec` aim for valid, checker-friendly `.pyi` text. Advanced `TypeKind` values (`protocol`, `nominal`, `paramspec`, `typevartuple`, and bare `typevar` in fields) are rendered as **`typing.Any`** in stubs so generated files do not invent `TypeVar`/`ParamSpec` declarations; the JSON IR still carries `name` / `qualname` / `module` for tooling. See [docs/supported-annotations.md](../../docs/supported-annotations.md) § Stub generation.

## Install

```bash
pip install velotype
```

From the monorepo root:

```bash
uv sync --group dev
# or
pip install -e packages/velarium -e "packages/velotype[dev]"
```

## CLI

```bash
velotype ir myapp.models:User
velotype ir myapp.models:User -o user.ir.json
velotype stub myapp.models:User -o user.pyi
```

## Library

```python
from velarium import modelspec_from_dataclass, dumps_model_spec
from velotype import generate_pyi

spec = modelspec_from_dataclass(MyModel)
print(generate_pyi(spec))
```

## Version

`__version__` is in `velotype/__init__.py` (Hatch dynamic metadata in this package’s `pyproject.toml`).

## See also

- [docs/modelspec-ir.md](../../docs/modelspec-ir.md) — IR schema  
- [docs/valarium.md](../../docs/valarium.md) — ecosystem and backends  
- [Documentation index](../../docs/README.md)
