The media-type-version Python API
media_type_version
Extract the format version from a media type string.
VERSION = '0.1.1'
module-attribute
The media-type-version library version, semver-like.
Config
dataclass
Runtime configuration for the media-type-version library.
Source code in python/src/media_type_version/defs.py
log
instance-attribute
The logger to send diagnostic, informational, and error messages to.
prefix
instance-attribute
The prefix to expect in the media type string.
suffix
instance-attribute
The optional suffix in the media type string.
MTVError
dataclass
Bases: Exception
An error that occurred while parsing the media type string.
Source code in python/src/media_type_version/defs.py
extract(cfg, value)
Extract the media type format version as a (major, minor) tuple.