topmark.registry.machine.serializers¶
topmark / registry / machine / serializers
Pure serializers for registry machine-readable output.
This module converts shaped registry machine-readable output objects into serialized wire representations.
Layers:
- payloads builds JSON-serializable payload structures.
- envelopes wraps payloads into canonical JSON envelopes / NDJSON record objects.
- This module serializes those objects:
- JSON: one pretty-printed JSON string (no trailing newline).
- NDJSON: an iterable of per-line JSON strings (no trailing newline per item).
Consumers (CLI commands) are responsible for emitting these strings to the active ConsoleLike (or stdout).
serialize_filetypes ¶
Serialize machine-readable output for topmark registry filetypes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmt
|
OutputFormat
|
Target output format (JSON or NDJSON). |
required |
meta
|
MetaPayload
|
Machine metadata payload. |
required |
show_details
|
bool
|
If True, include extended fields. |
required |
Returns:
| Type | Description |
|---|---|
str | Iterator[str]
|
|
str | Iterator[str]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/topmark/registry/machine/serializers.py
serialize_filetypes_json ¶
Serialize machine-readable output for topmark registry filetypes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meta
|
MetaPayload
|
Machine metadata payload. |
required |
show_details
|
bool
|
If True, include extended fields. |
required |
Returns:
| Type | Description |
|---|---|
str | Iterator[str]
|
|
str | Iterator[str]
|
|
Source code in src/topmark/registry/machine/serializers.py
serialize_filetypes_ndjson ¶
Serialize machine-readable output for topmark registry filetypes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meta
|
MetaPayload
|
Machine metadata payload. |
required |
show_details
|
bool
|
If True, include extended fields. |
required |
Returns:
| Type | Description |
|---|---|
Iterator[str]
|
Iterator of JSON strings (one per record; no trailing newline per item) |
Source code in src/topmark/registry/machine/serializers.py
serialize_processors ¶
Serialize machine-readable output for topmark registry processors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmt
|
OutputFormat
|
Target output format (JSON or NDJSON). |
required |
meta
|
MetaPayload
|
Machine metadata payload. |
required |
show_details
|
bool
|
If True, include extended fields. |
required |
Returns:
| Type | Description |
|---|---|
str | Iterator[str]
|
|
str | Iterator[str]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/topmark/registry/machine/serializers.py
serialize_processors_json ¶
Serialize machine-readable output for topmark registry processors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meta
|
MetaPayload
|
Machine metadata payload. |
required |
show_details
|
bool
|
If True, include extended fields. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Pretty-printed JSON string (no trailing newline) |
Source code in src/topmark/registry/machine/serializers.py
serialize_processors_ndjson ¶
Serialize machine-readable output for topmark registry processors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meta
|
MetaPayload
|
Machine metadata payload. |
required |
show_details
|
bool
|
If True, include extended fields. |
required |
Returns:
| Type | Description |
|---|---|
Iterator[str]
|
Iterator of JSON strings (one per record; no trailing newline per item) |
Source code in src/topmark/registry/machine/serializers.py
serialize_bindings ¶
Serialize machine-readable output for topmark registry bindings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmt
|
OutputFormat
|
Target output format (JSON or NDJSON). |
required |
meta
|
MetaPayload
|
Machine metadata payload. |
required |
show_details
|
bool
|
If True, include extended fields. |
required |
Returns:
| Type | Description |
|---|---|
str | Iterator[str]
|
|
str | Iterator[str]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/topmark/registry/machine/serializers.py
serialize_bindings_json ¶
Serialize machine-readable output for topmark registry bindings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meta
|
MetaPayload
|
Machine metadata payload. |
required |
show_details
|
bool
|
If True, include extended fields. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Pretty-printed JSON string (no trailing newline) |
Source code in src/topmark/registry/machine/serializers.py
serialize_bindings_ndjson ¶
Serialize machine-readable output for topmark registry bindings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meta
|
MetaPayload
|
Machine metadata payload. |
required |
show_details
|
bool
|
If True, include extended fields. |
required |
Returns:
| Type | Description |
|---|---|
Iterator[str]
|
Iterator of JSON strings (one per record; no trailing newline per item) |