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.dev5

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.dev5.tar.gz (48.9 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.dev5-cp37-abi3-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.7+Windows x86-64

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

Uploaded CPython 3.7+Windows x86

cosmol_viewer-0.1.1.dev5-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.dev5-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.dev5-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.dev5-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.dev5-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.dev5-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.dev5-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.dev5-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.dev5-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.dev5-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.dev5.tar.gz.

File metadata

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

File hashes

Hashes for cosmol_viewer-0.1.1.dev5.tar.gz
Algorithm Hash digest
SHA256 dc95b21e127e028c968cc281e4b475c220fadf2ffc8197e6a27c5e93c37f7ce9
MD5 2fb9486f238838a66b5b551ce1b08c8d
BLAKE2b-256 30b12544ec725d10f2be2eeea9cc23a1a0c1fdb5ba896a0ec3304e602cbbc289

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 25577fe42d9ddc586357990b57913a7df605f5912eb029f02c974465d56bf468
MD5 57bc9c4f3afb770d53f772b8e31c27ac
BLAKE2b-256 e5181a450a6d9f0965999c704764e1030ac5da098862e87779eb8df6697ef56d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 e097e15c8a363fb162aaa13357516d3d303c743b77dcff0ef9a474c9c6ad7943
MD5 ccedb8992de02a8bb35041cf32c8fd3a
BLAKE2b-256 7cce70bd13a286d6cf3f60e2dcfafd38103960e0e3e6c1a97aa42664e04655a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 84872583092ead211e7b12acf2d240aab53a8332e3fe2602c4f5975f5c62932f
MD5 189922dd0211a0915b6bba89f532e55c
BLAKE2b-256 ce0c33b4caff9f211813539e6d297d325662f5b044a6ba413e4ff6d46a3cc16f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 85a0f738ec696c060959a06b7d5c87555e8faba7d61bb3b98e1d30314d7dd66d
MD5 5041f83f88133dc4bf79cc5ca81de058
BLAKE2b-256 a928b780d8ac87dc44e8d2a8b9068400bf3f375e773c7b8277b3278a470e16f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 2cf28184802bd8304c33b1851ca5867e560188a0cffc9c0dedb434be3e3e3b30
MD5 fb8a912631e5843d84c0270e126de780
BLAKE2b-256 eb944f4497bf958f3769f8c6974393229ebd206401ec77cea7ff22f8a5c07711

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c709495466ac4b988f3f9530f085cfbb1cf4a2681e7900acc835465a7faea4f7
MD5 29768d8ec95e76febaaf16d5913a2c0c
BLAKE2b-256 d45d8faf109d67aa5210bef4939960162ad88dead8f35323ccdc74d54cc61e84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b5e4a27c4c984c4c06c46910a88c38047e2b33e32b38f288e589b30b6aaa5012
MD5 ed89994adb09fcc4a7cc16344b70cc1e
BLAKE2b-256 853f09b9fbadccf8416ed7c50032aeaf30ff4b760428517c9f3b585959395df6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 7660ca14bd210efefe078d6cb898dfd59b0a38ac8c20256c75c2d91bddbd66b1
MD5 3d57b63e4395000b062aff740131092b
BLAKE2b-256 28fd06e8fe82135dc5004810ca1e4796575956c771839d6fa9434ab255c5dc40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 c6cb8f7a22b3e06eb5d5f2b532bcafa42f00072e62a80e47f801f4d5902fe980
MD5 785c0b441c382168536a9e07334bb414
BLAKE2b-256 446d3f2677fad40fb68de5870feb6c81cf33a8ce6bb6e22b607c9265ba592563

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 eb66cd4a983839e8c476c010f8f39932e7c48da931a16a894dc0a26a043f66d2
MD5 8a84b464f6fcb42d12db0678dd3244d7
BLAKE2b-256 0036cb1277d046082528c0ac07e27565eccbb948eef344b04a7baa690dc0a32d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 3eb67c1174aecd196793a355b440d7592f93af5ac7f50b5efa23e23cf6bf32d2
MD5 41c905eff17b5b595cbc641c0fdd3d69
BLAKE2b-256 428b68c3829f2442bcc1f8eb74d0186359ed81af4425ece7ffbad45a803545ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cosmol_viewer-0.1.1.dev5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 eca69f005ce9093c11e4e1135c15dc591dbdeb0a63d1f6d7417009428f6984d7
MD5 2debf063d7320759267f00d39253e2d6
BLAKE2b-256 62abd6a061ad33b63cb39d4db5523aecfdf8a4c8405067174e11bc738fc4ff2d

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