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. CDXML is read and written as a
whole drawing by vibesketch.document.cdxml; binary CDX is read through
it (vibesketch.document.cdx).
Module Attributes
Formats whose data is short text, which the CLI and the browser take as typed. |
|
|
atoms and coordinates, whose bonds are inferred (#86). |
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', 'pdf', 'eps', 'emf', 'cdxml', 'chemfig', 'helm', 'fasta')¶
the format of every file in the vibe family.
- Type:
QVF first
- vibesketch.document.formats.TEXT_FORMATS: tuple[str, ...] = ('smiles', 'inchi', 'name', 'peptide', 'dna', 'rna', 'helm')¶
Formats whose data is short text, which the CLI and the browser take as typed.
- exception vibesketch.document.formats.ExportRefused[source]¶
Bases:
ValueErrorThe document cannot be expressed in the requested format.
- exception vibesketch.document.formats.ImportFailed[source]¶
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, warnings: 'list[str]' = <factory>, sequenced: 'bool' = False, rgroups: 'list[Any]' = <factory>)[source]¶
Bases:
object- Parameters:
- class vibesketch.document.formats.Payload(content: 'bytes', media_type: 'str', extension: 'str')[source]¶
Bases:
object
- vibesketch.document.formats.export(document, fmt, *, style=None, dpi=300, stereo_labels=False, sequences=False)[source]¶
documentinfmt; raisesExportRefused.stereo_labelsprints CIP descriptors in SVG, PNG and PDF figures;sequencesprints a species built from a sequence as it (#98).
- vibesketch.document.formats.format_for_path(path)[source]¶
The import format a file name implies; raises
ImportFailed.
- vibesketch.document.formats.import_into(document, data, fmt, *, mode='append')[source]¶
Read
dataand draw it ondocument’s canvas (a new document ifNone).Input beyond
vibesketch.limitsis refused withImportFailed.
- vibesketch.document.formats.read_structures(data, fmt)[source]¶
Read structures in
fmt; raisesImportFailed.