From 21e6d31de18c6a2e7e07e3c12382f4acaa9c4949 Mon Sep 17 00:00:00 2001 From: Alex Maldonado Date: Mon, 19 Oct 2026 03:58:48 -0400 Subject: [PATCH] Add jsontypes: the type aliases the package's annotations share Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01B8cL4zN4XpaQF5cBtASzfq --- src/paperspec/jsontypes.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/paperspec/jsontypes.py 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]