types
Useful types and validators for use in pydantic models.
SemVerTuple
module-attribute
¶
SemVerTuple: TypeAlias = Tuple[
NonNegativeInt, NonNegativeInt, NonNegativeInt
]
Type to be used for SemVer triples.
NonEmptyStr ¶
Bases: FullMatch
Non-empty string (contains non-whitespace characters).
Source code in src/metador_core/schema/types.py
35 36 |
|
MimeTypeStr ¶
Bases: NonEmptyStr
String that looks like a mime-type.
Source code in src/metador_core/schema/types.py
39 40 |
|
HashsumStr ¶
Bases: NonEmptyStr
String that looks like a hashsum.
Source code in src/metador_core/schema/types.py
43 44 |
|
QualHashsumStr ¶
Bases: HashsumStr
Hashsum string, prepended by the used algorithm.
Source code in src/metador_core/schema/types.py
50 51 |
|
Duration ¶
Bases: ParserMixin
, Duration
ISO 8601 Duration.
Source code in src/metador_core/schema/types.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
StringParser ¶
Bases: BaseParser
Parser from string into some target class.
Source code in src/metador_core/schema/types.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
PintParser ¶
Bases: StringParser
Shared base for PintUnit
and PintQuantity
, taking care of exceptions.
Source code in src/metador_core/schema/types.py
98 99 100 101 102 103 104 105 106 107 108 109 |
|
PintUnit ¶
Bases: ParserMixin
, Unit
pydantic-compatible pint.Unit.
Source code in src/metador_core/schema/types.py
112 113 114 115 116 117 118 119 120 121 |
|
PintQuantity ¶
Bases: ParserMixin
, Quantity
pydantic-compatible pint.Quantity.
Source code in src/metador_core/schema/types.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|