Skip to main content

Velarium IR to .pyi stub generation (velotype backend)

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

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 (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 § Stub generation.

Install

pip install velotype

From the monorepo root:

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

CLI

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

Library

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

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

velotype-0.2.0.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

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

velotype-0.2.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file velotype-0.2.0.tar.gz.

File metadata

  • Download URL: velotype-0.2.0.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for velotype-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d82d0eab27c497f20074b87bfc2a258e899147bc04483e7956a6c4d1cc4d9626
MD5 d02273778216f2f378fb61139df6e441
BLAKE2b-256 444a9aec4225c6273ca51943532cf78a74feee328049dee187b9e9dddcec724c

See more details on using hashes here.

File details

Details for the file velotype-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: velotype-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for velotype-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 592b3ca15e2c8e312c4716e1e0b4718d6084e305c6f2035c55a6b846c4a4ce13
MD5 5707cbf6efdb82565c2ed992faa14451
BLAKE2b-256 a1b87faf878de1ecc68f7f744e1b9044a2f9f398318d3faf149fbee384022b18

See more details on using hashes here.

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