solidipes.loaders.file module
- class solidipes.loaders.file.File(*args, **kwargs)[source]
Bases:
ROCrateMetadataAbstract container class for file metadata.
A File can be read from disk and may contain multiple DataContainer entries.
- class Viewer(data_container=None, add_kwargs={}, show_kwargs={}, **kwargs)
Bases:
ABCAbstract class for viewers.
If istanciated with data, it will directly display it.
- Parameters:
data – data to display
add_kwargs – kwargs to pass to the add method. Note: cannot be passed as a positional argument because of get_data_from_container decorator.
show_kwargs – kwargs to pass to the show method
**kwargs – kwargs to pass to the init method
- _abc_impl = <_abc._abc_data object>
- abstractmethod add(data, **kwargs) None
Add data to the viewer.
- check_data_compatibility(data) bool
Check if data is compatible with the viewer.
- class_path = 'solidipes.viewers.viewer.Viewer'
- compatible_data_types
List of data types (apart from DataContainers) that are compatible with the viewer DataContainers themselves already declare their compatible Viewers
- save(path, **kwargs) NoReturn
Save the view to a file.
- abstractmethod show(**kwargs)
Show the viewer.
- _compatible_viewers: list[Type[Viewer]] = []
List of compatible Viewer classes. Doesn’t need to include Viewer classes already listed in parent classes.
- _discussions: list[tuple[str, str]]
- _has_unresolved_comments
- _has_valid_extension
- _is_not_empty
- property archived_discussions
- property discussions
- property file_info
- property file_stats
- property modified_time
- other_allowed_mime_types = ['text/plain']
List of other allowed mime types (when automatic detection is inaccurate).
- property preferred_loader_name
- property preferred_viewer_name
Returns the default viewer name for this data container.
- supported_mime_types = {}
List of supported mime types and extensions. Override in subclasses. The key is the mime type and the value is one or more file extensions (string or list of strings)
- solidipes.loaders.file._supported_extensions = {}
List of supported extensions per class