madam.vector
module
- class madam.vector.SVGMetadataProcessor(config: Optional[Mapping[str, Any]] = None)[source]
Bases:
MetadataProcessor
Represents a metadata processor that handles Scalable Vector Graphics (SVG) data.
It is assumed that the SVG XML uses UTF-8 encoding.
- __init__(config: Optional[Mapping[str, Any]] = None) None [source]
Initializes a new SVGMetadataProcessor.
- Parameters
config – Mapping with settings.
- combine(file: IO, metadata: Mapping[str, Mapping]) IO [source]
Returns a byte stream whose contents represent the specified file where the specified metadata was added.
- Parameters
metadata (Mapping) – Mapping of the metadata format to the metadata dict
file (IO) – Container file
- Returns
file-like object with combined content
- Return type
IO
- read(file: IO) Mapping[str, Mapping] [source]
Reads the file and returns the metadata.
The metadata that is returned is grouped by type. The keys are specified by
format
.- Parameters
file (IO) – File-like object to be read
- Returns
Metadata contained in the file
- Return type
Mapping
- Raises
UnsupportedFormatError – if the data is corrupt or its format is not supported
- class madam.vector.SVGProcessor(config: Optional[Mapping[str, Any]] = None)[source]
Bases:
Processor
Represents a processor that handles Scalable Vector Graphics (SVG) data.
- __init__(config: Optional[Mapping[str, Any]] = None) None [source]
Initializes a new SVGProcessor.
- Parameters
config – Mapping with settings.
- can_read(file: IO) bool [source]
Returns whether the specified MIME type is supported by this processor.
- Parameters
file (IO) – file-like object to be tested
- Returns
whether the data format of the specified file is supported or not
- Return type