httk.core.saving¶
Dispatch local file writers and format serializers.
Functions¶
|
Return whether |
|
Save |
Module Contents¶
- httk.core.saving.save(obj, destination, *, format=None, **kwargs)[source]¶
Save
objto a local destination selected by its name orformathint.The writer registry selects by extension first and exact basename second, case-insensitively after stripping one recognized compression suffix, unless
formatselects a registered writer directly. The format-serializer registry converts non-neutral objects before writing, and a recognized compression suffix wraps the destination transparently.- Parameters:
obj (Any) – Object or neutral payload to serialize and write.
destination (str | os.PathLike[str]) – Local filename or path to write.
format (str | None) – Optional registered format name that selects the writer.
**kwargs (Any) – Additional options passed to the selected writer.
- Raises:
ValueError – If the destination or format has no writer, no serializer exists, or the destination is a URL.