Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

vmol: v – python binding

This package allows to

  • run v from python scripts and receive its output without calling subprocesses and
  • facilitate installation (especially if it is a dependency).

Inspired by @aligfellow's xyzrender.

Requirements

  • X11
  • numpy
  • cclib (optional, to read formats without native support)

Installation

PyPI has the wheels for CPython 10 through 14 @ manylinux. See install-other.md for other ways to build and install.

pip install vmol[all]       #  install cclib to parse unsupported file formats and open them with vmol2

pip install vmol            #  base version

pip install --no-deps vmol  #  vmol script and "capture the output" will work, 
                            #  but "pass a structure" feature won't work without numpy

For macOS, an X11 server like XQuartz is required:

brew install --cask xquartz

Usage

Scripts

The package provides two scripts to run from the command line

  • vmol, a simple wrapper around v
  • vmol2, a wrapper aroung v to view the file formats that are not supported natively (needs cclib (i.e., vmol[all] or vmol[cclib]))

Both have the same CLI interface as the original v (see the reference).

Native formats (xyz / Priroda):

vmol ../mol/MOL_3525.xyz cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10
python -m vmol../mol/periodic.in bonds:0

Unsupported quantum-chemical outputs, e.g., Orca:

vmol2 ../mol/CEHZOF_1_SPE.out
python -m vmol.vmol2 ../mol/AJALIH_5_SPE.out

or Gaussian:

vmol2 mol/Cat1_TSOA_CfA_Cf0.log vib:0  #  geometry optimization
vmol2 mol/Cat1_TSOA_CfA_Cf0.log        #  normal modes (default for files containing both)

Library

Import the wrapper instance:

>>> from vmol import vmol

It provides the two wrapper functions capture and run along with the path to the shared library so, loaded library lib, and function namespace f.

>>> [*filter(lambda x: not str.startswith(x, '_'), dir(vmol))]
['capture', 'f', 'lib', 'run', 'so']

The shared library is automatically searched for in the current and installation directories:

>>> vmol.so
/home/xe/soft/miniconda3/lib/python3.13/site-packages/vmol/v.cpython-313-x86_64-linux-gnu.so

One can use a custom .so file by setting the attribute

>>> vmol.so = '../v.so'

or the VMOL_SO_PATH environment variable:

export VMOL_SO_PATH=`readlink -m ../v.so`

1. Simple wrapper

Analogous to running vmol script:

from vmol import vmol
vmol.run(['../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10'])

The arguments are the same as the CLI ones and should be an array of strings.

2. Capture the output

See example 1.

from vmol import vmol
out = vmol.capture(args=['../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10'])
# look at the molecule, press `x`/`z`/`p` to produce an output, close with `q`/`esc`
print(out)

The arguments args are the same as the CLI ones and should be an array of strings.

The return code can be captured as well:

ret, out = vmol.capture(args=['../mol/MOL_3525.xyz', 'cell:8.93,0.0,0.0,4.2,8.9,0.0,0.48,2.32,10'], return_code=True)

Headless mode also works:

>>> vmol.capture(args=['../mol/S8.qm.out', 'gui:0', 'com:.'])
'D8h'
>>> vmol.capture(args=['../mol/S8.qm.out', 'gui:0', 'com:.', 'frame:-1'])
'D4d'

Tell the viewer to automatically print the coordinates before exit:

>>> out = vmol.capture(args=['../mol/rotation1.in', 'exitcom:z'])
>>> print(out)

3. Pass a structure

One can pass a structure (or several structures) as an argument. See example 2.

from vmol import vmol
name = 'HF molecule'
q = [1, 'F']
r = [[0,0,0],[0.9,0,0]]
out = vmol.capture(mols={'q': q, 'r': r, 'name': name}, args=['shell:0.6,0.7'])
# look at the molecule, press `x`/`z`/`p` to produce an output, close with `q`/`esc`
print(out)

Without capturing the output:

vmol.run(args=['shell:0.6,0.7'], mols={'q': [1, 'F'], 'r': [[0,0,0],[0.9,0,0]], 'name': 'hydrogen fluoride'})

ASE Atoms (or anything with .numbers and .positions) are also supported:

import ase.io
mols = ase.io.read('../mol/mol0002.xyz', index=':')
out = vmol.capture(mols=mols)

File formats which are not supported natively can be read with cclib and passed (see example and vmol2 source).

One can also pass normal modes data with

from vmol import vmol
CO2 = {'q': [8, 6, 8], 'r': [(x,0,0) for x in [-1.16, 0, 1.16]], name='CO2'}
sym_stretch  = {'freq': [1480], 'ints': [0], 'mass': [16], 'disp': [[(dx,0,0) for dx in [-1, 0, 1]]]}
vmol.run(mols=CO2, vib=sym_stretch)

Press insert to play the animation. (See example and vmol2 source for more details.)

Metadata

Release files for vmol 3.0rc7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vmol 3.0rc7
File Size Uploaded Provenance Actions
vmol-3.0rc7.tar.gz 14.7 kB Without provenance Details for vmol-3.0rc7.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for vmol 3.0rc7
File Actions
vmol-3.0rc7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for vmol-3.0rc7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
vmol-3.0rc7-cp314-cp314t-macosx_15_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 15.0+ ARM64 Details for vmol-3.0rc7-cp314-cp314t-macosx_15_0_arm64.whl
vmol-3.0rc7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for vmol-3.0rc7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
vmol-3.0rc7-cp314-cp314-macosx_15_0_arm64.whl CPython 3.14 CPython 3.14 macOS 15.0+ ARM64 Details for vmol-3.0rc7-cp314-cp314-macosx_15_0_arm64.whl
vmol-3.0rc7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for vmol-3.0rc7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
vmol-3.0rc7-cp313-cp313-macosx_15_0_arm64.whl CPython 3.13 CPython 3.13 macOS 15.0+ ARM64 Details for vmol-3.0rc7-cp313-cp313-macosx_15_0_arm64.whl
vmol-3.0rc7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for vmol-3.0rc7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
vmol-3.0rc7-cp312-cp312-macosx_15_0_arm64.whl CPython 3.12 CPython 3.12 macOS 15.0+ ARM64 Details for vmol-3.0rc7-cp312-cp312-macosx_15_0_arm64.whl
vmol-3.0rc7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for vmol-3.0rc7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
vmol-3.0rc7-cp311-cp311-macosx_15_0_arm64.whl CPython 3.11 CPython 3.11 macOS 15.0+ ARM64 Details for vmol-3.0rc7-cp311-cp311-macosx_15_0_arm64.whl
vmol-3.0rc7-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for vmol-3.0rc7-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
vmol-3.0rc7-cp310-cp310-macosx_15_0_arm64.whl CPython 3.10 CPython 3.10 macOS 15.0+ ARM64 Details for vmol-3.0rc7-cp310-cp310-macosx_15_0_arm64.whl

Total release size: 6.2 MB

Release files / vmol-3.0rc7.tar.gz

Download URL vmol-3.0rc7.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ed4d7ee51261c7501071144419aaaac7c813f8e4ddda7a99f4e78121b6709339
BLAKE2b-256 checksum
How to use checksums
346b379cf34aa261a1e4112e83bfef9b9f4c93b0cb48c8a1a00fe124c1c1a0b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL vmol-3.0rc7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 215.3 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9d69abc976c917cfddec4569817482b47f5795be32e8e8e16eccb2fa8c9e12a6
BLAKE2b-256 checksum
How to use checksums
c074be9e8a7ad7c8c9fc6c48bdea45ea5d691711783f5bd041bce492678acb2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp314-cp314t-macosx_15_0_arm64.whl

Download URL vmol-3.0rc7-cp314-cp314t-macosx_15_0_arm64.whl
Size 818.2 kB
Tags CPython 3.14 CPython 3.14 free-threading macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
eef9139b632c3ca2f0d4c9c0d1a5403e10300efa89965644f1b36a703bcc9c74
BLAKE2b-256 checksum
How to use checksums
25bc943b395f31e5cf623f6fc45a97550fe5fa58190549862711a341697c315c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL vmol-3.0rc7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 215.3 kB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
cae7e754f318aa53ceae6ec0f4c73dc22e204d628dd9a9dfa1ed5347becdc964
BLAKE2b-256 checksum
How to use checksums
142992a510c689eea1ffbae47e9ee6c4aaaec248c69a3275dc61862524562ef1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp314-cp314-macosx_15_0_arm64.whl

Download URL vmol-3.0rc7-cp314-cp314-macosx_15_0_arm64.whl
Size 818.2 kB
Tags CPython 3.14 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
92a394effb99d7d254ae09a9d5959606919c2a796cb0b076766d9e2ba2decd62
BLAKE2b-256 checksum
How to use checksums
513a2153ffe425b876e4244b27896179bb68d9418c080d1cae57e267a2c11a26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL vmol-3.0rc7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 215.3 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
96af3785b9cd0ae1e7492c61d9cf3fed8e5edfbb4f01f065b79b1d2b1ba16373
BLAKE2b-256 checksum
How to use checksums
786ec08c82dd57dbb8e0a21a7e0ffeb6a992c69650c4e9821a2a310f143a47cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp313-cp313-macosx_15_0_arm64.whl

Download URL vmol-3.0rc7-cp313-cp313-macosx_15_0_arm64.whl
Size 818.2 kB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
73f0269d6aa90b8f22fb5a861967a0d67b1507e663edac4b8d841addfe2d34d4
BLAKE2b-256 checksum
How to use checksums
00f6d5e201413cf121257864bf9b382204b88fbbf129cb2546eb4af865b7c6df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL vmol-3.0rc7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 215.3 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f296b518955ce4633379d2108d16c88dd9e3abf26993af0576122e6a750af011
BLAKE2b-256 checksum
How to use checksums
6c29d39af8fc92bd9f5b52b916893473a17ddc1a13a7a49d467e98abbf36d6ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp312-cp312-macosx_15_0_arm64.whl

Download URL vmol-3.0rc7-cp312-cp312-macosx_15_0_arm64.whl
Size 818.2 kB
Tags CPython 3.12 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
65edd3f6ccc062e75598e67bc9c16b6ee29267bcda5cc4e4daf4c8b0aebece00
BLAKE2b-256 checksum
How to use checksums
61cbcfd9b5a515cd869e0f5b626282a783d64fa98f14cd343af7dffba0f79157
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL vmol-3.0rc7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 215.3 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
be9e9cc37fb1c0906004e5f1facb81f5abdec250063d9395752e84bde8b89311
BLAKE2b-256 checksum
How to use checksums
2f01e62a33fdbc55eca1d72e72d63fa21677026780b2852f48dc91178e58f774
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp311-cp311-macosx_15_0_arm64.whl

Download URL vmol-3.0rc7-cp311-cp311-macosx_15_0_arm64.whl
Size 818.2 kB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
213f166e44f8758cabe06a67f2b998034fd85ae17a86ff9e85bcdd6a5760aa46
BLAKE2b-256 checksum
How to use checksums
748bbe67e83d7450919f3b067c208c019a5a88fac6b807ed902e28f111feecd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL vmol-3.0rc7-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 215.3 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3dd07e2a65b8f1371d5daad66713a458d1028f49a0d110fada7b54ea52934343
BLAKE2b-256 checksum
How to use checksums
28eaea7a40b25a9062fb857f9443737ce1a5cfd85a012bc1addb85dc11ebbfe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / vmol-3.0rc7-cp310-cp310-macosx_15_0_arm64.whl

Download URL vmol-3.0rc7-cp310-cp310-macosx_15_0_arm64.whl
Size 818.2 kB
Tags CPython 3.10 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
c2b8f83d53a6e0cb448cc0a3ea1f5e675f519dfed13acf6463dbbed0b4427463
BLAKE2b-256 checksum
How to use checksums
830c59cbfc4a27b5d9f5f7e3779d6ce7a70d813c32609393d45d3710ee075f03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for vmol 3.0rc7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page