crv.core.typing
Experimental API
crv.core.typing
Lightweight typing aliases used across core schemas and tables.
Provides minimal NewTypes and aliases to improve readability and static checks. This module contains no runtime logic and is zero-IO.
Notes
- Intended for use in annotations across schemas and downstream modules.
- Keep the surface small and stable to avoid churn in dependents.
Examples:
Use aliases in annotations.
>>> from crv.core.typing import Tick, GroupId, RoomId, JsonDict
>>> def advance(t: Tick) -> Tick:
... return Tick(int(t) + 1)
>>> advance(Tick(10))
10
>>> def describe_room(room: RoomId) -> str:
... return f"room:{room}"
>>> describe_room(RoomId("market"))
'room:market'
>>> def payload() -> JsonDict:
... return {"a": 1, "b": 2}