diff --git a/src/paperspec/jsontypes.py b/src/paperspec/jsontypes.py new file mode 100644 index 0000000..bd1d918 --- /dev/null +++ b/src/paperspec/jsontypes.py @@ -0,0 +1,16 @@ +"""Type aliases shared by the package's modules. + +The formats are JSON, and the oracle reads a record as the plain `dict` the standard +library's `json` module returns, so these aliases name what such a value is used as +rather than describing every key. +""" + +import os +from typing import Any + +# One parsed JSON object: a node, a receipt, a correction, a manifest. +type Record = dict[str, Any] + +# A path given as text or as a path object; functions that take one return text unless +# their docstring says otherwise. +type StrPath = str | os.PathLike[str]