Base Classesο
These abstract base classes define the common interfaces that all SLOTH implementations must follow.
- class sloth.mmcif.common.BaseParser[source]ο
Bases:
ABCAbstract base class for mmCIF parsers.
All parser implementations (MMCIFParser, GemmiParser, etc.) must inherit from this class and implement the required abstract methods.
- class sloth.mmcif.common.BaseWriter[source]ο
Bases:
ABCAbstract base class for mmCIF writers.
All writer implementations (MMCIFWriter, GemmiWriter, etc.) must inherit from this class and implement the required abstract methods.
- abstract write(file_obj, mmcif)[source]ο
Write mmCIF data container to a file object.
- Parameters:
file_obj (IO) β The file object to write to
mmcif (MMCIFDataContainer) β The data container to write
- Return type:
- Returns:
None
- class sloth.mmcif.common.BaseImporter[source]ο
Bases:
ABCAbstract base class for all SLOTH importers.
- class sloth.mmcif.common.BaseExporter[source]ο
Bases:
ABCAbstract base class for all SLOTH exporters.
- abstract export_data(mmcif_data, file_path=None, nested=True, **kwargs)[source]ο
Export mmCIF data to target format.
- Parameters:
mmcif_data (
MMCIFDataContainer) β The mmCIF data container to exportfile_path (
Union[str,Path,None]) β Path to save the file (optional)nested (
bool) β Whether to use nested structure**kwargs β Additional format-specific options
- Return type:
- Returns:
String representation if no file_path provided, otherwise None