Skip to main content

Molecular visualization tools

Project description

COSMol-viewer

A high-performance molecular visualization library built with Rust and WebGPU, designed for seamless integration into Python workflows.

  • ⚡ Fast: Native-speed rendering powered by Rust and GPU acceleration

  • 🧬 Flexible: Load molecules from .sdf, .pdb, and dynamically update 3D structures

  • 📓 Notebook-friendly: Fully supports Jupyter and Google Colab — ideal for education, research, and live demos

  • 🔁 Real-time updates: Update molecular coordinates on-the-fly for simulations or animations

  • 🎨 Customizable: Control styles, camera, and rendering settings programmatically

Installation

pip install cosmol-viewer==0.1.1

Usage

from cosmol_viewer import Scene, Viewer, parse_sdf, Molecules

# === Step 1: Load and render a molecule ===
with open("molecule.sdf", "r") as f:
    sdf = f.read()
    mol = Molecules(parse_sdf(sdf)).centered()

scene = Scene()
scene.scale(0.1)
scene.add_shape(mol, "mol")

viewer = Viewer.render(scene)  # Launch the viewer

# === Step 2: Update the same molecule dynamically ===
import time

for i in range(1, 10):  # Simulate multiple frames
    with open(f"frames/frame_{i}.sdf", "r") as f:
        sdf = f.read()
        updated_mol = Molecules(parse_sdf(sdf)).centered()

    scene.update_shape("mol", updated_mol)
    viewer.update(scene)

    time.sleep(0.033)  # ~30 FPS

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cosmol_viewer-0.1.1.tar.gz (48.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cosmol_viewer-0.1.1-cp37-abi3-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.7+Windows x86-64

cosmol_viewer-0.1.1-cp37-abi3-win32.whl (4.6 MB view details)

Uploaded CPython 3.7+Windows x86

cosmol_viewer-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

cosmol_viewer-0.1.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.8 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

cosmol_viewer-0.1.1-cp37-abi3-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

cosmol_viewer-0.1.1-cp37-abi3-macosx_10_12_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.7+macOS 10.12+ x86-64

File details

Details for the file cosmol_viewer-0.1.1.tar.gz.

File metadata

  • Download URL: cosmol_viewer-0.1.1.tar.gz
  • Upload date:
  • Size: 48.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.1

File hashes

Hashes for cosmol_viewer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 18aaa175e90a7efd25ae95e29e89a4f9dd219a154d15c660b0000a0f20be4aa3
MD5 563be0a619bb8c77e8a96c8dcbd15c09
BLAKE2b-256 45f3e18b95933fcd6515acbe5eea58720454a96bae014001ce51cd6764197ef7

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5927eff57b32ecee9b4abd4e254abc97896cbcc30351b371fb67a552bd51dd50
MD5 194f0909c770fe2524718ac8f02984aa
BLAKE2b-256 9ea39d05b3ee83db2f4e018263a408d7eae1c95ed76f2e798b3bcabab89c5c76

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1-cp37-abi3-win32.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 9ce029d005caca651d388f966b1a7a87188996b37cd412d6761fadbe46e918e5
MD5 5d60b6a4723e9afc559b01d20d438114
BLAKE2b-256 7855a679cc177a6d017ecd426db50ffc3b8c53b182175deb7a138a2eba760146

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d92d9fbac42ffe3fa406271a653b6683c7c929731695757eaaa0cc3f8aa4b89a
MD5 d06bd3fc1f2a76770d358a0bff2c3c9e
BLAKE2b-256 a05feb8d4d513979b338b01baa3e63872774efda4410394df2dc5d2a79d89982

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 79b9fd5a5e45dfa17fe52b50a32d4a3492c9810dcb6a3247bb6d5f5c101e4809
MD5 86042585aa5f7d058821c7e3a7179995
BLAKE2b-256 b521b45ea963b1007757daae80dccbd04dc2f1aceebd8fafbf3bc69ba75d8e4d

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b8ca481386d10eaf512caa114bb0d0ded628c07d4c20d7f423a17caa86063c50
MD5 da69fc46fbf2d3ae34fb4c3a7fe35df9
BLAKE2b-256 40efc0030ebb9fedb371381c3200fbeb72103b80ca978c7501f0debaa8fced35

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d7c1cf0306415f4cf0d51065286b26f983c574259190dda88b34e43a431cc0b3
MD5 42bf7d79360267e7352db59bd147a768
BLAKE2b-256 4a2d9bd4337c001797e3bc98c83d2014b0f5523a6a8ab9403fe78cbf1fc120d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page