vibeview.api¶
High-level Python API for vibe-view — programmatic access to all QVF operations.
Import with from vibeview.api import * or use individual functions.
All functions accept QVFReader instances or file paths. They are the
programmatic equivalents of the vibe-view CLI commands.
Functions
|
Render the structure to a PNG file. |
|
Render a volume section to a PNG file. |
|
Compare two QVFs: return energy delta, section overlap, geometry RMSD. |
|
Return the structure as an XYZ string. |
|
Return structure data as a dict with atoms, pbc, and lattice_vectors. |
|
Extract tabular data (same as |
|
Return a JSON-serializable summary of a volume section's grid. |
|
Check if a section exists in the QVF. |
|
Return full metadata for a QVF file as a dict. |
|
Render a section as terminal text and return it. |
|
Return a list of |
|
Extract sections without discarding metadata. |
|
Validate QVF integrity: schema + all SHA-256 hashes. |
- vibeview.api.info(source)[source]¶
Return full metadata for a QVF file as a dict.
Equivalent to
vibe-view info --json.
- vibeview.api.get_structure(source)[source]¶
Return structure data as a dict with atoms, pbc, and lattice_vectors.
- vibeview.api.diff(source_a, source_b)[source]¶
Compare two QVFs: return energy delta, section overlap, geometry RMSD.
- vibeview.api.get_volume(source, section_id)[source]¶
Return a JSON-serializable summary of a volume section’s grid.
Gives the grid geometry (
origin,voxel_vectors,shape) plus the value range (data_shape,data_min,data_max) – not the voxels themselves, so the result stays serializable. For thendarrayusevibeview.QVFReader.read_volume_data().Returns
Noneif the section is absent or is not a volume.
- vibeview.api.get_table(source, kind)[source]¶
Extract tabular data (same as
vibe-view table --kind).
- vibeview.api.validate(source)[source]¶
Validate QVF integrity: schema + all SHA-256 hashes.
Returns
{"valid": True, "n_sections": N, "n_members": M}on success, or{"valid": False, "error": "..."}on failure.
- vibeview.api.capture_volume(source, section_id, path, **kwargs)[source]¶
Render a volume section to a PNG file.
- vibeview.api.render_terminal(source, section_id=None, *, size=(100, 30), plain=False, **kwargs)[source]¶
Render a section as terminal text and return it.
The text counterpart of
capture_structure()/capture_volume(): same renderers, same colours, but the output is a string of braille characters instead of a PNG — and unlike the capture functions it needs no OpenGL context, so it works on a headless compute node.section_iddefaults to the structure section.plain=Truedrops the ANSI colour for logs and pipes. Extra keyword arguments are passed tovibeview.tui.show.render_section()(mode,representation,color_mode,replication,isovalue,rotation,show_labels,frame,chart).Returns a human-readable explanation rather than raising when the section has no graphical form (a citations block, say), so a caller sweeping every section never has to pre-filter by kind.