zimscraperlib.zim.metadata
Classes:
-
CreatorMetadata– -
CustomMetadata– -
CustomTextMetadata– -
DateBasedMetadata–Expects a Date (date | datetime) input. Will be UTF-8 encoded as YYYY-MM-DD
-
DateMetadata– -
DefaultIllustrationMetadata– -
DescriptionMetadata– -
FlavourMetadata– -
IllustrationBasedMetadata–Expects a Square PNG Illustration (bytes-like) input.
-
IllustrationMetadata– -
LanguageMetadata– -
LicenseMetadata– -
LongDescriptionMetadata– -
Metadata– -
MetadataBase–Base class for metadata
-
NameMetadata– -
PublisherMetadata– -
RelationMetadata– -
ScraperMetadata– -
SourceMetadata– -
StandardMetadataList– -
TagsMetadata– -
TextBasedMetadata–Expects a Text (str) input. Will be cleaned-up and UTF-8 encoded
-
TextListBasedMetadata–Expects a Text List (list[str]) input. Each item will be cleaned-up.
-
TitleMetadata– -
XCustomMetadata– -
XCustomTextMetadata–
Functions:
-
allow_duplicates–Whether list input can accept duplicate values
-
allow_empty–Whether input can be blank
-
clean_str–Clean a string value for unwanted control characters and strip white chars
-
deduplicate–Whether duplicates in list inputs should be reduced
-
mandatory–Marks a Metadata mandatory: must be set to please Creator and cannot be empty
-
nb_grapheme_for–Number of graphemes (visually perceived characters) in a given string
-
only_lang_codes–Whether list input should be checked to only accept ISO-639-1 codes
-
x_prefixed–Whether metadata names should be automatically X-Prefixed
-
x_protected–Whether metadata name should be checked for collision with reserved names
Attributes:
-
APPLY_RECOMMENDATIONS(bool) – -
AnyMetadata– -
DEFAULT_DEV_ZIM_METADATA– -
MANDATORY_ZIM_METADATA_KEYS(list[str]) – -
T– -
UNWANTED_CONTROL_CHARACTERS_REGEX–
DEFAULT_DEV_ZIM_METADATA
module-attribute
DEFAULT_DEV_ZIM_METADATA = StandardMetadataList(
Name=NameMetadata("Test Name"),
Title=TitleMetadata("Test Title"),
Creator=CreatorMetadata("Test Creator"),
Publisher=PublisherMetadata("Test Publisher"),
Date=DateMetadata(date(2023, 1, 1)),
Description=DescriptionMetadata("Test Description"),
Language=LanguageMetadata("fra"),
Illustration_48x48_at_1=DefaultIllustrationMetadata(
b64decode(
"iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAANQTFRFR3BMgvrS0gAAAAF0Uk5TAEDm2GYAAAANSURBVBjTY2AYBdQEAAFQAAGn4toWAAAAAElFTkSuQmCC"
)
),
)
MANDATORY_ZIM_METADATA_KEYS
module-attribute
MANDATORY_ZIM_METADATA_KEYS: list[str] = (
get_reserved_names()
)
UNWANTED_CONTROL_CHARACTERS_REGEX
module-attribute
UNWANTED_CONTROL_CHARACTERS_REGEX = compile(
"(?![\\n\\t\\r])\\p{C}"
)
CreatorMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
CustomMetadata
Bases: Metadata
Methods:
-
get_binary_from– -
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name– -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup(bool) – -
require_utf8_encoding(bool) – -
value(T) –
Source code in src/zimscraperlib/zim/metadata.py
501 502 503 | |
meta_name
instance-attribute
meta_name = name
value
instance-attribute
value: T = get_cleaned_value(value)
get_binary_from
get_binary_from(
value: bytes
| SupportsRead[bytes]
| SupportsSeekableRead[bytes]
| BytesIO,
) -> bytes
Source code in src/zimscraperlib/zim/metadata.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
246 247 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
249 250 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
CustomTextMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name– -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
508 509 510 | |
meta_name
instance-attribute
meta_name = name
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
DateBasedMetadata
Bases: MetadataBase[date]
Expects a Date (date | datetime) input. Will be UTF-8 encoded as YYYY-MM-DD
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(date) –
Source code in src/zimscraperlib/zim/metadata.py
327 328 329 330 | |
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
333 334 335 336 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
338 339 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
DateMetadata
Bases: DateBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(date) –
Source code in src/zimscraperlib/zim/metadata.py
327 328 329 330 | |
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
333 334 335 336 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
338 339 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
DefaultIllustrationMetadata
Bases: IllustrationBasedMetadata
Methods:
-
get_binary_from– -
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype– -
meta_name– -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup(bool) – -
require_utf8_encoding(bool) – -
value(bytes) –
Source code in src/zimscraperlib/zim/metadata.py
350 351 352 353 | |
illustration_scale
class-attribute
instance-attribute
illustration_scale: int = DEFAULT_ZIM_ILLLUSTRATION_SCALE
illustration_size
class-attribute
instance-attribute
illustration_size: int = DEFAULT_ZIM_ILLLUSTRATION_SIZE
meta_mimetype
class-attribute
instance-attribute
meta_mimetype = 'image/png'
meta_name
class-attribute
instance-attribute
meta_name = 'Illustration_48x48@1'
get_binary_from
get_binary_from(
value: bytes
| SupportsRead[bytes]
| SupportsSeekableRead[bytes]
| BytesIO,
) -> bytes
Source code in src/zimscraperlib/zim/metadata.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
356 357 358 359 360 361 362 363 364 365 366 367 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
369 370 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
DescriptionMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
oz_max_length
class-attribute
instance-attribute
oz_max_length: int = MAXIMUM_DESCRIPTION_METADATA_LENGTH
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
FlavourMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
IllustrationBasedMetadata
Bases: Metadata
Expects a Square PNG Illustration (bytes-like) input.
PNG format and squareness will be checked
Methods:
-
get_binary_from– -
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype– -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup(bool) – -
require_utf8_encoding(bool) – -
value(bytes) –
Source code in src/zimscraperlib/zim/metadata.py
350 351 352 353 | |
meta_mimetype
class-attribute
instance-attribute
meta_mimetype = 'image/png'
get_binary_from
get_binary_from(
value: bytes
| SupportsRead[bytes]
| SupportsSeekableRead[bytes]
| BytesIO,
) -> bytes
Source code in src/zimscraperlib/zim/metadata.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
356 357 358 359 360 361 362 363 364 365 366 367 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
369 370 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
IllustrationMetadata
Bases: IllustrationBasedMetadata
Methods:
-
get_binary_from– -
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype– -
meta_name– -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup(bool) – -
require_utf8_encoding(bool) – -
value(bytes) –
Source code in src/zimscraperlib/zim/metadata.py
411 412 413 414 415 416 | |
meta_mimetype
class-attribute
instance-attribute
meta_mimetype = 'image/png'
meta_name
class-attribute
instance-attribute
meta_name = 'Illustration_{size}x{size}@{scale}'
get_binary_from
get_binary_from(
value: bytes
| SupportsRead[bytes]
| SupportsSeekableRead[bytes]
| BytesIO,
) -> bytes
Source code in src/zimscraperlib/zim/metadata.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
356 357 358 359 360 361 362 363 364 365 366 367 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
369 370 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
LanguageMetadata
Bases: TextListBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup– -
require_utf8_encoding– -
value(list[str]) –
Source code in src/zimscraperlib/zim/metadata.py
292 293 | |
require_textlist_cleanup
class-attribute
instance-attribute
require_textlist_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
317 318 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
LicenseMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
LongDescriptionMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
oz_max_length
class-attribute
instance-attribute
oz_max_length: int = (
MAXIMUM_LONG_DESCRIPTION_METADATA_LENGTH
)
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
Metadata
Bases: MetadataBase[bytes]
Methods:
-
get_binary_from– -
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup(bool) – -
require_utf8_encoding(bool) – -
value(T) –
Source code in src/zimscraperlib/zim/metadata.py
86 87 88 89 90 91 92 93 94 95 96 | |
value
instance-attribute
value: T = get_cleaned_value(value)
get_binary_from
get_binary_from(
value: bytes
| SupportsRead[bytes]
| SupportsSeekableRead[bytes]
| BytesIO,
) -> bytes
Source code in src/zimscraperlib/zim/metadata.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
246 247 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
249 250 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
MetadataBase
Bases: ABC
Base class for metadata
Both generic (to accomodate any value type implemented in child classes) and abstract (because it has no idea how to compute the cleaned_value and libzim_value for any value type)
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup(bool) – -
require_utf8_encoding(bool) – -
value(T) –
Source code in src/zimscraperlib/zim/metadata.py
86 87 88 89 90 91 92 93 94 95 96 | |
value
instance-attribute
value: T = get_cleaned_value(value)
get_cleaned_value
abstractmethod
get_cleaned_value(value: Any) -> T
Source code in src/zimscraperlib/zim/metadata.py
152 153 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
abstractmethod
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
159 160 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
NameMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
PublisherMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
RelationMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
ScraperMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
SourceMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
StandardMetadataList
dataclass
StandardMetadataList(
Name: NameMetadata,
Language: LanguageMetadata,
Title: TitleMetadata,
Creator: CreatorMetadata,
Publisher: PublisherMetadata,
Date: DateMetadata,
Illustration_48x48_at_1: DefaultIllustrationMetadata,
Description: DescriptionMetadata,
LongDescription: LongDescriptionMetadata | None = None,
Tags: TagsMetadata | None = None,
Scraper: ScraperMetadata | None = None,
Flavour: FlavourMetadata | None = None,
Source: SourceMetadata | None = None,
License: LicenseMetadata | None = None,
Relation: RelationMetadata | None = None,
)
Methods:
-
get_reserved_names–list of mandatory metadata as per the spec.
-
values–
Attributes:
-
Creator(CreatorMetadata) – -
Date(DateMetadata) – -
Description(DescriptionMetadata) – -
Flavour(FlavourMetadata | None) – -
Illustration_48x48_at_1(DefaultIllustrationMetadata) – -
Language(LanguageMetadata) – -
License(LicenseMetadata | None) – -
LongDescription(LongDescriptionMetadata | None) – -
Name(NameMetadata) – -
Publisher(PublisherMetadata) – -
Relation(RelationMetadata | None) – -
Scraper(ScraperMetadata | None) – -
Source(SourceMetadata | None) – -
Tags(TagsMetadata | None) – -
Title(TitleMetadata) –
LongDescription
class-attribute
instance-attribute
LongDescription: LongDescriptionMetadata | None = None
get_reserved_names
classmethod
list of mandatory metadata as per the spec.
computed from metadata using @mandatory decorator
Source code in src/zimscraperlib/zim/metadata.py
484 485 486 487 488 489 490 491 492 493 494 495 496 | |
values
values() -> list[AnyMetadata]
Source code in src/zimscraperlib/zim/metadata.py
481 482 | |
TagsMetadata
Bases: TextListBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup– -
require_utf8_encoding– -
value(list[str]) –
Source code in src/zimscraperlib/zim/metadata.py
292 293 | |
require_textlist_cleanup
class-attribute
instance-attribute
require_textlist_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
317 318 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
TextBasedMetadata
Bases: MetadataBase[str]
Expects a Text (str) input. Will be cleaned-up and UTF-8 encoded
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
TextListBasedMetadata
Bases: MetadataBase[list[str]]
Expects a Text List (list[str]) input. Each item will be cleaned-up.
List will be joined (see join_list_with) and UTF-8 encoded
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup– -
require_utf8_encoding– -
value(list[str]) –
Source code in src/zimscraperlib/zim/metadata.py
292 293 | |
require_textlist_cleanup
class-attribute
instance-attribute
require_textlist_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
317 318 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
TitleMetadata
Bases: TextBasedMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name(str) – -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
260 261 | |
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
XCustomMetadata
Bases: CustomMetadata
Methods:
-
get_binary_from– -
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name– -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup(bool) – -
require_textlist_cleanup(bool) – -
require_utf8_encoding(bool) – -
value(T) –
Source code in src/zimscraperlib/zim/metadata.py
516 517 | |
meta_name
instance-attribute
meta_name = name
value
instance-attribute
value: T = get_cleaned_value(value)
get_binary_from
get_binary_from(
value: bytes
| SupportsRead[bytes]
| SupportsSeekableRead[bytes]
| BytesIO,
) -> bytes
Source code in src/zimscraperlib/zim/metadata.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
246 247 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
249 250 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
XCustomTextMetadata
Bases: CustomTextMetadata
Methods:
-
get_cleaned_value– -
get_encoded– -
get_libzim_value– -
get_mimetype– -
get_name– -
matches_reserved_name– -
validate–
Attributes:
-
duplicates_allowed(bool) – -
empty_allowed(bool) – -
illustration_scale(int) – -
illustration_size(int) – -
is_required(bool) – -
join_list_with(str) – -
libzim_value(bytes) – -
meta_mimetype(str) – -
meta_name– -
mimetype(str) – -
name(str) – -
oz_max_length(int) – -
oz_only_iso636_3_allowed(bool) – -
oz_x_prefixed(bool) – -
oz_x_protected(bool) – -
require_deduplication(bool) – -
require_text_cleanup– -
require_textlist_cleanup(bool) – -
require_utf8_encoding– -
value(str) –
Source code in src/zimscraperlib/zim/metadata.py
523 524 | |
meta_name
instance-attribute
meta_name = name
require_text_cleanup
class-attribute
instance-attribute
require_text_cleanup = True
require_utf8_encoding
class-attribute
instance-attribute
require_utf8_encoding = True
get_cleaned_value
Source code in src/zimscraperlib/zim/metadata.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
get_encoded
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
144 145 146 | |
get_libzim_value
get_libzim_value() -> bytes
Source code in src/zimscraperlib/zim/metadata.py
279 280 | |
get_mimetype
get_mimetype() -> str
Source code in src/zimscraperlib/zim/metadata.py
98 99 100 | |
get_name
get_name() -> str
Source code in src/zimscraperlib/zim/metadata.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
matches_reserved_name
staticmethod
Source code in src/zimscraperlib/zim/metadata.py
106 107 108 109 110 111 112 113 | |
validate
validate() -> None
Source code in src/zimscraperlib/zim/metadata.py
148 149 150 | |
allow_duplicates
allow_duplicates(cls: type[U])
Whether list input can accept duplicate values
Source code in src/zimscraperlib/zim/metadata.py
190 191 192 193 | |
allow_empty
allow_empty(cls: type[U])
Whether input can be blank
Source code in src/zimscraperlib/zim/metadata.py
184 185 186 187 | |
clean_str
Clean a string value for unwanted control characters and strip white chars
Source code in src/zimscraperlib/zim/metadata.py
167 168 169 | |
deduplicate
deduplicate(cls: type[U])
Whether duplicates in list inputs should be reduced
Source code in src/zimscraperlib/zim/metadata.py
196 197 198 199 200 | |
mandatory
mandatory(cls: type[U])
Marks a Metadata mandatory: must be set to please Creator and cannot be empty
Source code in src/zimscraperlib/zim/metadata.py
177 178 179 180 181 | |
nb_grapheme_for
Number of graphemes (visually perceived characters) in a given string
Source code in src/zimscraperlib/zim/metadata.py
172 173 174 | |
only_lang_codes
only_lang_codes(cls: type[U])
Whether list input should be checked to only accept ISO-639-1 codes
Source code in src/zimscraperlib/zim/metadata.py
203 204 205 206 | |
x_prefixed
x_prefixed(cls: type[U])
Whether metadata names should be automatically X-Prefixed
Source code in src/zimscraperlib/zim/metadata.py
217 218 219 220 221 | |
x_protected
x_protected(cls: type[U])
Whether metadata name should be checked for collision with reserved names
when applying recommendations
Source code in src/zimscraperlib/zim/metadata.py
209 210 211 212 213 214 | |