common – Base classes and common functions¶
This module provides base classes and common functions used in other productmd modules.
Classes¶
-
class
productmd.common.
MetadataBase
¶ -
validate
()¶ Validate attributes by running all self._validate_*() methods.
Raises: - TypeError – if an attribute has invalid type
- ValueError – if an attribute contains invalid value
-
load
(f)¶ Load data from a file.
Parameters: f (file or str) – file-like object or path to file
-
loads
(s)¶ Load data from a string.
Parameters: s (str) – input data
-
dump
(f)¶ Dump data to a file.
Parameters: f (file or str) – file-like object or path to file
-
dumps
()¶ Dump data to a string.
Return type: str
-
-
class
productmd.common.
Header
(parent)¶