Skip to main content

An IPython interface for embedding 3Dmol.js views

Project description

A simple [IPython/Jupyter](http://jupyter.org/) widget to embed an interactive [3Dmol.js](http://3dmol.csb.pitt.edu) viewer in a notebook.

The widget is completely static, which means the viewer doesn’t need a running IPython kernel to be useful and web pages and presentations generated from the notebook will work as expected. However, this also means there is only one-way communication between the notebook and the viewer.

If you experience problems, please file an [issue](https://github.com/3dmol/3Dmol.js/issues).

[An example notebook](http://nbviewer.jupyter.org/github/3dmol/3Dmol.js/blob/master/py3Dmol/examples.ipynb)

Installation

From PyPI:

pip install py3Dmol

Important: In order to use with JupyterLab you must install the JupyterLab extension:

jupyter labextension install jupyterlab_3dmol

Usage

Open a notebook

jupyter notebook

and issue

`Python import py3Dmol view = py3Dmol.view(query='pdb:1ubq') view.setStyle({'cartoon':{'color':'spectrum'}}) view `

API

The returned view object has the exact same API as [$3Dmol.GLViewer](http://3dmol.csb.pitt.edu/doc/$3Dmol.GLViewer.html) with the exception that functions return None.

License

MIT

Project details


Download files

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

Source Distribution

py3Dmol-1.8.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

py3Dmol-1.8.1-py2.py3-none-any.whl (6.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file py3Dmol-1.8.1.tar.gz.

File metadata

  • Download URL: py3Dmol-1.8.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for py3Dmol-1.8.1.tar.gz
Algorithm Hash digest
SHA256 10bb3022c5db3e5e6d66f51d7d4118afaf939726d655f08761709ddf032cb31d
MD5 6c2d167c891e91c28b1e46425dc85e27
BLAKE2b-256 1934d7f3a830c679ddbdbe01df52305053df4da11c6e24bd77d1196aff8f8da1

See more details on using hashes here.

Provenance

File details

Details for the file py3Dmol-1.8.1-py2.py3-none-any.whl.

File metadata

  • Download URL: py3Dmol-1.8.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for py3Dmol-1.8.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c4741f1bc2e219024b165e36c3e5c172c0550a3a36b81825d2a9d0eff06cd714
MD5 38bf6e45e2305d0a3720aea65229b164
BLAKE2b-256 c9c34cabc0b0b32d90e4862a9f77f3e712b21821fcf77facf3422dbd7f2bc438

See more details on using hashes here.

Provenance

Supported by

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