ipymolstar
Live Demos
Give ipymolstar a spin without even installing python!
- Try it in jupyter lab via JupyterLite 🌍🚀
- Explore the solara ☀️ demo application on Ploomber-cloud ⛅
- Grab a cup and play with the solara, pyshiny or panel live demo's on PyCafé ☕
- Upload your Alphafold3 .zip result and view plddt or chain colors in the
solarafoldresult viewer on huggingface 🤗
Preview
You can run a quick preview of ipymolstar in a notebook with juv:
juv run example.ipynb
Installation
pip install ipymolstar
[!WARNING]
Make sure you install ipymolstar in an environment that contains your installation of Jupyter. If you have installed Jupyter in a different environment from your project (requiring you to use a named, non-default kernel), you will have to install ipymolstar (or only anywidget) in your Jupyter environment as well.
Use
from ipymolstar import PDBeMolstar
view = PDBeMolstar(molecule_id='1qyn', theme='light', hide_water=True)
view
Loading local data, hiding the buttons:
from pathlib import Path
fpth = Path().resolve() / 'assets' / '6vsb.bcif'
custom_data = {
'data': fpth.read_bytes(),
'format': 'cif',
'binary': True,
}
view = PDBeMolstar(
custom_data=custom_data,
hide_controls_icon=True,
hide_expand_icon=True,
hide_settings_icon=True,
hide_selection_icon=True,
hide_animation_icon=True,
hide_water=True,
hide_carbs=True,
)
view
See the example notebook for more advanced usage. Solara example code can be found here
Citing
ipymolstar uses anywidget to create a widgets based on Mol*
To cite Mol*:
David Sehnal, Sebastian Bittrich, Mandar Deshpande, Radka Svobodová, Karel Berka, Václav Bazgier, Sameer Velankar, Stephen K Burley, Jaroslav Koča, Alexander S Rose: Mol* Viewer: modern web app for 3D visualization and analysis of large biomolecular structures, Nucleic Acids Research, 2021; 10.1093/nar/gkab31.
PDBeMolstar
The PDBeMolstar widget is based on the PDBe integration of Mol*.
MolViewSpec
The MolViewSpec widget is based on MolViewSpec. To cite MolViewSpec:
Sebastian Bittrich, Adam Midlik, Mihaly Varadi, Sameer Velankar, Stephen K. Burley, Jasmine Y. Young, David Sehnal, Brinda Vallat: Describing and Sharing Molecular Visualizations Using the MolViewSpec Toolkit, Current Protocols, 2024; 10.1002/cpz1.1099
See also the RCSB citation policies for additional citation information.
Development
The molviewspec widget front-end code bundles it's JavaScript dependencies. After setting up Python, make sure to install these dependencies locally:
npm install
While developing, you can run the following in a separate terminal to automatically rebuild JavaScript as you make changes:
npm run dev
Creating a new release
- update
__version__in__init__.py - create a new release on GitHub, choose as tag 'v' +
__version__; ie 'v0.0.3' - GitHub actions should automatically deploy to PyPi
Hot reloading
To enable anywidget hot reloading, you need to set the env var ANYWIDGET_HMR to 1.
Windows:
set ANYWIDGET_HMR=1
jupyter lab
Metadata
Release files for ipymolstar 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ipymolstar-0.1.0.tar.gz | 1.5 MB | With provenance | Details for ipymolstar-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ipymolstar-0.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for ipymolstar-0.1.0-py2.py3-none-any.whl |
Total release size: 3.0 MB
Release files / ipymolstar-0.1.0.tar.gz
| Download URL | ipymolstar-0.1.0.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39abe60c3a53d484c06b960871e9f9077201cd771f149c9f71ab138fb5fd6e71
|
|
BLAKE2b-256 checksum How to use checksums |
7b26fad1d05042580e84eb26315d14cd0501887c7e6d77cb1da5f126c44d74c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 10, 2025.
Transparency logRelease files / ipymolstar-0.1.0-py2.py3-none-any.whl
| Download URL | ipymolstar-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
1361541cd25927a0daa41de9647c6116266a4f1f7d31888bee02a308cb97f1d8
|
|
BLAKE2b-256 checksum How to use checksums |
b2725907058da13cb4dbecb58e0d1035a5e1ca16cb69fed64f797b0cf205d1bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 10, 2025.
Transparency logSecurity for ipymolstar 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for ipymolstar-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 10, 2025.
Transparency logA 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.