serialization

Serialization helpers for pydantic.BaseModel.model_dump() and pydantic.BaseModel.model_dump_json() .

jsonize_array(value: Any, info: SerializationInfo) list | dict[source]

Use an interface class to render an array as JSON

relative_path(self: Path, other: Path, walk_up: bool = True) Path[source]

“Backport” of pathlib.Path.relative_to() with walk_up=True that’s not available pre 3.12.

Return the relative path to another path identified by the passed arguments. If the operation is not possible (because this is not related to the other path), raise ValueError.

The walk_up parameter controls whether .. may be used to resolve the path.

References

https://github.com/python/cpython/blob/8a2baedc4bcb606da937e4e066b4b3a18961cace/Lib/pathlib/_abc.py#L244-L270