blackfennec.document_system.mime_type package
Subpackages
- blackfennec.document_system.mime_type.in_memory package
- blackfennec.document_system.mime_type.json package
- Submodules
- blackfennec.document_system.mime_type.json.json_mime_type module
- blackfennec.document_system.mime_type.json.json_pointer_serializer module
JsonPointerSerializer
JsonPointerSerializer.ABSOLUTE_POINTER_PATTERN
JsonPointerSerializer.RELATIVE_POINTER_PATTERN
JsonPointerSerializer.deserialize_absolute_pointer()
JsonPointerSerializer.deserialize_relative_pointer()
JsonPointerSerializer.is_absolute_json_pointer()
JsonPointerSerializer.is_relative_json_pointer()
JsonPointerSerializer.serialize()
- blackfennec.document_system.mime_type.json.json_reference_serializer module
- Module contents
Submodules
blackfennec.document_system.mime_type.mime_type module
- class blackfennec.document_system.mime_type.mime_type.MimeType[source]
Bases:
object
- abstract export_structure(output: IO, structure: Structure)[source]
Export the structure to output IO
- Raises
NotImplementedError – if subclass did not implement this method
- abstract import_structure(data: IO) Structure [source]
Import the structure from IO data
- Returns
Structure contained in raw data
- Return type
- Raises
NotImplementedError – if subclass did not implement this method
- abstract property mime_type_id: str
Identification of mime type via ID
- Returns
mime type ID
- Return type
str
- Raises
NotImplementedError – if subclass did not implement this property
- static try_determine_mime_type(uri: str, resource_type: ResourceType) str [source]
Get mime_type through different approaches.
- Tries guessing the mime_type from the URI ending, then by retrieving
the content-type of the URI if the UriType is HOST_URI.
- Parameters
uri (str) – of which the mime_type should be searched
resource_type (ResourceType) – type of the passed uri
- Returns
mime_type
- Return type
str
- Raises
ValueError – if no mime_type could have been guessed automatically.
blackfennec.document_system.mime_type.mime_type_registry module
- class blackfennec.document_system.mime_type.mime_type_registry.MimeTypeRegistry[source]
Bases:
object
MimeType Registry Class
Is a register of all registered mime_types.
- _mime_types
stores internal mime_types
- deregister_mime_type(mime_type_id)[source]
- Function to deregister a mime_type from the registry if its class
matches the passed type
- Parameters
mime_type_id (str) – key in the mime_type dict
- property mime_types
mime_types getter
- Returns
of mime_type
- Return type
dict