cottax.consumers.json.interface module¶
JSON interface asks of a place type:
1.Spelling of places (PlaceCodec) and of node names (LabelCodec)
Of a feature type:
Spelling of node kinds
- class Spelling[T: NodeDefinition][source]¶
Bases:
Answer,Generic[T]NodeDefinition <-> JSON.
- about¶
alias of
NodeDefinition
- kind: AbstractClassVar[str]¶
How it is referred to in the file.
- checks_answer: PerLevel[tuple[Callable[[Any, tuple[Any, ...]], Iterable[Violation]], ...]] = (<function one_per_kind>,)¶
why answer is refused beside the answers already registered for its interface (a word two would share).
- Type:
check(answer, registered)
- class PlaceCodec[V: Place][source]¶
Bases:
Answer,Generic[V]Place <-> JSON, for the place classes it answers for. tag names it in the file header.
- tag: AbstractClassVar[str]¶
abstract to ABC until a subclass binds the name, and absent on a class that declares it as a field.
- Type:
What the level binds in place of the annotation
- checks_answer: PerLevel[tuple[Callable[[Any, tuple[Any, ...]], Iterable[Violation]], ...]] = (<function one_per_tag>,)¶
why answer is refused beside the answers already registered for its interface (a word two would share).
- Type:
check(answer, registered)
- class LabelCodec[N: Label][source]¶
Bases:
Answer,Generic[N]Node name <-> JSON, for the label classes it answers for. tag names it in the file header.
- about: AbstractClassVar[Any] = Label¶
a class, a type alias of one, a protocol, or a tuple of those. @answers refuses a class that is none; a protocol is met by shape, which a class cannot be asked.
- Type:
What the interface is answered per, bound by the interface
- tag: AbstractClassVar[str]¶
abstract to ABC until a subclass binds the name, and absent on a class that declares it as a field.
- Type:
What the level binds in place of the annotation
- checks_answer: PerLevel[tuple[Callable[[Any, tuple[Any, ...]], Iterable[Violation]], ...]] = (<function one_per_tag>,)¶
why answer is refused beside the answers already registered for its interface (a word two would share).
- Type:
check(answer, registered)