You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: migrate from Pydantic v1 .dict() to v2 .model_dump() for iscc-schema compatibility
Replace deprecated skip_defaults parameter with exclude_none and by_alias
in model_dump() calls. Update test expectations for new iscc-schema 0.5.0
versioned URLs. Includes formatting fixes from linter.
Metadata intended to be embedded into the media asset.
86
77
"""
87
78
88
-
name: Optional[constr(max_length=128)]=Field(
79
+
name: constr(max_length=128)|None=Field(
89
80
None,
90
-
description=(
91
-
"The title or name of the intangible creation manifested by the identified *digital"
92
-
" content*. **Used as input for ISCC Meta-Code generation**."
93
-
),
81
+
description="The title or name of the intangible creation manifested by the identified *digital content*. **Used as input for ISCC Meta-Code generation**.",
"Description of the *digital content* identified by the **ISCC**. **Used as input for"
100
-
" ISCC Meta-Code generation**. Any user presentable text string (including Markdown"
101
-
" text) indicative of the identity of the referent may be used."
102
-
),
86
+
description="Description of the *digital content* identified by the **ISCC**. **Used as input for ISCC Meta-Code generation**. Any user presentable text string (including Markdown text) indicative of the identity of the referent may be used.",
103
87
examples=["a 1984 fantasy film co-written and directed by *Wolfgang Petersen*"],
104
88
)
105
-
meta: Optional[constr(max_length=16384)]=Field(
89
+
meta: constr(max_length=16384)|None=Field(
106
90
None,
107
91
description="Subject, industry, or use-case specific metadata encoded as Data-URL.",
"Other identifier(s) referencing the work, product or other abstraction of which the"
114
-
" referenced **digital content** is a full or partial manifestation."
115
-
),
96
+
description="Other identifier(s) referencing the work, product or other abstraction of which the referenced **digital content** is a full or partial manifestation.",
116
97
)
117
-
creator: Optional[str]=Field(
98
+
creator: str|None=Field(
118
99
None,
119
100
description="An entity primarily responsible for making the resource.",
120
101
examples=["Joanne K. Rowling"],
121
102
)
122
-
license: Optional[str]=Field(
103
+
license: str|None=Field(
123
104
None,
124
105
description="URI of license for the identified *digital content*.",
"This field must contain a valid URL referring to a page showing information about how"
131
-
" one can acquire a license for the item. This may be a page of a web shop or NFT"
132
-
" marketplace ready for providing a license."
133
-
),
110
+
description="This field must contain a valid URL referring to a page showing information about how one can acquire a license for the item. This may be a page of a web shop or NFT marketplace ready for providing a license.",
"A line of text that you expect users of the image (such as Google Images) to display"
140
-
" alongside the image."
141
-
),
115
+
description="A line of text that you expect users of the image (such as Google Images) to display alongside the image.",
142
116
examples=["Frank Farian - Getty Images"],
143
117
)
144
-
rights: Optional[str]=Field(
118
+
rights: str|None=Field(
145
119
None,
146
-
description=(
147
-
"Contains any necessary copyright notice and should identify the current owner of the"
148
-
" copyright of this work with associated intellectual property rights."
149
-
),
120
+
description="Contains any necessary copyright notice and should identify the current owner of the copyright of this work with associated intellectual property rights.",
150
121
examples=["Copyright 2022 ISCC Foundation - www.iscc.codes"],
151
122
)
152
-
keywords: Optional[Union[str, List[str]]]=Field(
123
+
keywords: str|list[str]|None=Field(
153
124
None,
154
-
description=(
155
-
"Keywords or tags used to describe this content. Multiple entries in a keywords list"
156
-
" are typically delimited by commas."
157
-
),
125
+
description="Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.",
158
126
)
159
127
160
128
161
-
classMode(Enum):
129
+
classMode(StrEnum):
162
130
"""
163
131
The perceptual mode used to create the ISCC.
164
132
"""
@@ -175,53 +143,45 @@ class TechnicalMetadata(BaseModel):
175
143
Technical ISCC Metadata automaticaly inferred from the media file by the ISCC processor
176
144
"""
177
145
178
-
mode: Optional[Mode]=Field(
146
+
mode: Mode|None=Field(
179
147
None, description="The perceptual mode used to create the ISCC.", examples=["image"]
180
148
)
181
-
filename: Optional[str]=Field(
149
+
filename: str|None=Field(
182
150
None,
183
151
description="Filename of the referenced **digital content**",
184
152
examples=["your-media-file.jpg"],
185
153
)
186
-
filesize: Optional[int] =Field(
187
-
None, description="File size of media asset in number of bytes."
188
-
)
189
-
mediatype: Optional[str] =Field(
154
+
filesize: int|None=Field(None, description="File size of media asset in number of bytes.")
155
+
mediatype: str|None=Field(
190
156
None,
191
-
description=(
192
-
"An [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)"
193
-
" (MIME type)"
194
-
),
157
+
description="An [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml) (MIME type)",
195
158
examples=["image/jpeg"],
196
159
)
197
-
duration: Optional[int]=Field(
160
+
duration: int|None=Field(
198
161
None, description="Duration of audio-visual media in seconds.", examples=[60]
199
162
)
200
-
fps: Optional[confloat(ge=1.0)]=Field(
163
+
fps: confloat(ge=1.0)|None=Field(
201
164
None, description="Frames per second of video assets.", examples=[24]
202
165
)
203
-
width: Optional[int]=Field(
166
+
width: int|None=Field(
204
167
None, description="Width of visual media in number of pixels.", examples=[640]
205
168
)
206
-
height: Optional[conint(ge=1)]=Field(
169
+
height: conint(ge=1)|None=Field(
207
170
None, description="Height of visual media in number of pixels.", examples=[480]
208
171
)
209
-
characters: Optional[int]=Field(
172
+
characters: int|None=Field(
210
173
None,
211
174
description="Number of text characters (code points after Unicode normalization)",
212
175
examples=[55689],
213
176
)
214
-
language: Optional[str]=Field(
177
+
language: str|None=Field(
215
178
None,
216
179
description="Primary language of content [BCP 47](https://tools.ietf.org/search/bcp47).",
217
180
examples=["en-US"],
218
181
)
219
-
thumbnail: Optional[AnyUrl]=Field(
182
+
thumbnail: AnyUrl|None=Field(
220
183
None,
221
-
description=(
222
-
"URI an autogenerated user-presentable thumbnail-image that serves as a preview of the"
223
-
" digital content. The URI may be a Data-URL RFC2397."
224
-
),
184
+
description="URI an autogenerated user-presentable thumbnail-image that serves as a preview of the digital content. The URI may be a Data-URL RFC2397.",
225
185
examples=["https://picsum.photos/200/300.jpg"],
226
186
)
227
187
@@ -231,25 +191,25 @@ class Unit(BaseModel):
231
191
An ISCC-UNIT in different representations
232
192
"""
233
193
234
-
iscc_unit: Optional[str]=Field(
194
+
iscc_unit: str|None=Field(
235
195
None,
236
196
description="Canonical representation of ISCC-UNIT",
237
197
examples=["ISCC:AAA4RJYGHHVRCZ5T"],
238
198
)
239
-
readable: Optional[str]=Field(
199
+
readable: str|None=Field(
240
200
None,
241
201
description="Human readable version of ISCC-UNIT",
242
202
examples=["META-NONE-V0-64-c8a70639eb1167b3"],
243
203
)
244
-
hash_hex: Optional[str]=Field(
204
+
hash_hex: str|None=Field(
245
205
None, description="Hex representation of ISCC-BODY", examples=["e1fb7dc4e3dbb4be"]
246
206
)
247
-
hash_uint: Optional[str]=Field(
207
+
hash_uint: str|None=Field(
248
208
None,
249
209
description="Unsigned integer representation of ISCC-BODY",
0 commit comments