vibesketch.document.formats¶
Import and export: SMILES, MOL, SDF, RXN, CDXML, InChI, names, KET and XYZ.
Import turns a file into molecules (and a reaction, when the format carries one), writes them onto the canvas as KET and derives the document from it, so an imported structure is drawn exactly like a drawn one. An XYZ file, as vibe-view exports one, keeps its coordinates as each species’ 3D structure. Export reads the document: structures keep the coordinates they have on the canvas.
Formats a document cannot be expressed in are refused with the reason, never approximated: an RXN file needs a reaction, PNG of a reaction scheme needs a renderer this version does not have.
Module Attributes
the format of every file in the vibe family. |
|
|
Formats that carry a whole document, not just structures. |
Functions
|
|
|
The import format a file name implies; raises |
|
Read |
|
Read structures in |
|
An RDKit molecule per species: with canvas coordinates when drawn. |
Classes
Exceptions
The document cannot be expressed in the requested format. |
|
The data could not be read in the stated format. |
- vibesketch.document.formats.EXPORT_FORMATS: tuple[str, ...] = ('qvf', 'vsk', 'ket', 'mol', 'sdf', 'rxn', 'smiles', 'inchi', 'svg', 'png')¶
the format of every file in the vibe family.
- Type:
QVF first
- exception vibesketch.document.formats.ExportRefused¶
Bases:
ValueErrorThe document cannot be expressed in the requested format.
- exception vibesketch.document.formats.ImportFailed¶
Bases:
ValueErrorThe data could not be read in the stated format.
- class vibesketch.document.formats.Imported(molecules: 'list[Any]' = <factory>, reaction: 'tuple[list[Any], list[Any], list[Any]] | None' = None, conditions: 'list[str]' = <factory>, ket: 'dict[str, Any] | None' = None)¶
Bases:
object- Parameters:
- class vibesketch.document.formats.Payload(content: 'bytes', media_type: 'str', extension: 'str')¶
Bases:
object
- vibesketch.document.formats.export(document, fmt, *, style=None)¶
documentinfmt; raisesExportRefused.
- vibesketch.document.formats.format_for_path(path)¶
The import format a file name implies; raises
ImportFailed.
- vibesketch.document.formats.import_into(document, data, fmt, *, mode='append')¶
Read
dataand draw it ondocument’s canvas (a new document ifNone).
- vibesketch.document.formats.read_structures(data, fmt)¶
Read structures in
fmt; raisesImportFailed.