schedr.types¶
Types for task outputs: ProcessResult, the Json alias, and size constants.
Json is the bound type checkers use for @task return types; the guarantee is the
parse-time check (see archive/PROJECT.md, Output serialization).
- schedr.types.KiB = 1024¶
One kibibyte, in bytes.
- schedr.types.MiB = 1048576¶
One mebibyte, in bytes.
- schedr.types.GiB = 1073741824¶
One gibibyte, in bytes.
- class schedr.types.DataclassInstance(*args, **kwargs)¶
Bases:
ProtocolAny dataclass instance (for type checkers).
- type schedr.types.Json = bool | int | float | str | datetime | date | timedelta | Sequence[Json] | Mapping[str, object] | DataclassInstance | None¶
What a
@taskmay return, for type checkers.SequenceandMapping(notlist/dict, which are invariant) accept e.g.list[int];Mapping[str, object]acceptsTypedDictclasses, whose values the type checker can’t check (the parse-time check does).
- class schedr.types.ProcessResult(stdout, stderr, exit_code, stdout_truncated=False, stderr_truncated=False)¶
Bases:
objectThe output of a
commandorscripttask.- Parameters:
stdout (str)
stderr (str)
exit_code (int)
stdout_truncated (bool)
stderr_truncated (bool)
- stdout¶
The standard output (its last part, if truncated).
- Type:
str
- stderr¶
The standard error (its last part, if truncated).
- Type:
str
- exit_code¶
The process’s exit code.
- Type:
int
- stdout_truncated¶
Whether
stdoutexceeded the output size limit.- Type:
bool
- stderr_truncated¶
Whether
stderrexceeded the output size limit.- Type:
bool