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

install with

pip install cosmol-viewer==0.1.1.dev4

Usage

python:

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.create_viewer()
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.dev4.tar.gz (48.2 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.dev4-cp37-abi3-musllinux_1_2_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ x86-64

cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_i686.whl (8.0 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ i686

cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_armv7l.whl (8.1 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARMv7l

cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_aarch64.whl (8.0 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

cosmol_viewer-0.1.1.dev4-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.dev4-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (7.8 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ s390x

cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (7.9 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ppc64le

cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (7.8 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ i686

cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (7.8 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARMv7l

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

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

File details

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

File metadata

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

File hashes

Hashes for cosmol_viewer-0.1.1.dev4.tar.gz
Algorithm Hash digest
SHA256 136f26819fe30bd6d7d185831591fad52e03d16026b68bce6c58813ff20d9b8b
MD5 397aa0f1eca4cf091cdc8f8349ce8394
BLAKE2b-256 399ff50eaf070f01d915e21fa8efb8375aaea1baf203f1c616bc9bfb0b166d32

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 70cb6859363207cd031cd592d8d53e3bf627567c7bfb4bbf1390954b724119d9
MD5 461795f3faee1d8608145310df3c3195
BLAKE2b-256 4deb6a549788a41d104d891951a501f7d84fbe02322ee8e05bc2821b887ba6b3

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 3ef8dba047d39c75b5f4f0833d8e7fcbbc8799629b9fa1eb70bf67f5758c424a
MD5 090a46d87b26ae66c00bc7ccac5a4861
BLAKE2b-256 51243732384d1f92397d7de71d5d43063ea6035eb701d4d289aa8daafae334c0

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 818d4c85fbea7051360352c7ac38e97cb049843f7edaf870d9fa763df9286a3c
MD5 570492fd8d2c3860f930b2f695f48088
BLAKE2b-256 2166aeca91c3eea627ab1894bbfd3851cf51c872d3e65b625befb0c309434160

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4213005e2f87ef0bf2c56c7bbc139b0ef00299c79b755a5a6ced88957fd77470
MD5 92336bdbe298b9393ca0baa2bc1d8f21
BLAKE2b-256 8858a0bcbce8bfaee7f10c64af67bab112a002a1ba310ccc4e214d7fcaba860e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d22455add10ec9372eb79bdd9a2de6e522e72754bab71f2c63a94eefe00acc22
MD5 43b16f83d46ea90e1b43a25214eabf15
BLAKE2b-256 5df6c9909c22c5db201d7b6e438c4e6f65ab1126d7a7716b16a2165a91a5b23f

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 c054419ad1bb30c30c89855c13bfd8c3e6772c807a683c1b6c671096ee7324b4
MD5 ffa519b2e4acfc21f7994d951efe2076
BLAKE2b-256 456413b4b00fac2b6060b3e93e30019ecb93b6d828d5e1786a50c414122cf20f

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 be332b19872fca4762d608f4e06d14ee5ba09e03a73e7df6d3cd814d5d8e83a5
MD5 994785f6b2cab5543455b41a75d0f25b
BLAKE2b-256 7c6e62eb7e79a5433567a5c9fc5d26dc2d0f2c1ca5d29c66f97ecc744e637546

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 de3b698477c9bc5bc2b86b00847fcd71c8192f9b8b4bf163787680bd4952884b
MD5 8bed1f30dba13564a4b5f48199143d2e
BLAKE2b-256 8cb4c664476a9b316d2d92cea1226151ace8d6151298c1fb9f2997aa5ebd81b8

See more details on using hashes here.

File details

Details for the file cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 75b7cc6c7ae3a37ed116afa85dd90c87c6935e51c971d8782d8b37bee7bfce72
MD5 ae47b8051fa8f35e12c424ebe5d8a05e
BLAKE2b-256 bc580a341278ebcd3294591e43408507c40c63be738a88d47ffaf24132972a07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5cda568271f520d52a10c5a5a2362a3d6016f88b6ff6f377392eb429f1c08afc
MD5 e25a1ecfeff439df5fceb1e7fe5bf0e9
BLAKE2b-256 c59e426c0e04d2921a1c4b0b89b34318a88dd1c4b397777d65ee9e61716e6bb2

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