Skip to main content

Velarium IR (ModelSpec): normalization, JSON codec, Python→IR extraction

This project has been archived.

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

Project description

velarium

Role in Velarium: core ModelSpec IR — normalized types (TypeSpec, TypeKind, …), ModelSpec, JSON codec, union normalization, and builders that turn dataclasses and TypedDict into IR.

PyPI velarium
Import import velarium / from velarium.ir import ModelSpec, TypeSpec
Dependencies typing_extensions only

Downstream packages (e.g. velotype) consume this IR to emit .pyi stubs and other artifacts. The IR contract is specified in docs/modelspec-ir.md; how Python annotations map to the IR is in docs/supported-annotations.md. Ecosystem context is in docs/valarium.md and docs/design.md.

Public API (high level)

Area Modules / entry points
IR types velarium.irModelSpec, TypeSpec, TypeKind, …
JSON velarium.json_codecdumps_model_spec, loads_model_spec, dict helpers
Normalization velarium.normalizenormalize_typespec, unions, optional handling
Annotations velarium.annotationstype_to_typespec, annotation_to_typespec
Builders velarium.modelspec_buildmodelspec_from_dataclass, modelspec_from_typed_dict, typespec_from_object
Resolution velarium.typing_resolveget_resolved_hints, module_globals_for_class, evaluate_forward_ref (used by builders; re-export not required for typical use)

Install

pip install velarium

From the monorepo root (with uv):

uv sync --group dev

Version

__version__ lives in velarium/__init__.py (Hatch reads it from that 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

velarium-0.2.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

velarium-0.2.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for velarium-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a45c553582f2dbbd69212b003d12a4a4a2137b07fdf9703da87da48a14690df5
MD5 efc76a4293477ceba45e40fd90d0ff39
BLAKE2b-256 458e99d381b5672c7cfcfb76618ceb9d1af3f9342b1114c8126a199109fbc0df

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for velarium-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf107e879b3ee4765b04cae29c2fdd6433891e350a19a412c30ba6feb3243df7
MD5 2f5312725e4a6365b91bd1f4a86b5b4f
BLAKE2b-256 7d8b9bedd4cd16b15189269bc0417e91fda35b302b82a208de9fbcd49298cdf5

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