aseview
Molecular structure viewer for ASE (Atomic Simulation Environment).
Features
- Interactive structure, trajectory, overlay, normal-mode, and fragment-selection viewers
- Optional cube-backed
SurfaceViewerfor orbital, density, and delta-density isosurfaces - ASE-backed Python API and CLI, plus a browser-only JavaScript module
- Cell/PBC display, bonds, hydrogen bonds, charges, magnetic moments, forces, and fixed-atom constraint highlighting
- Energy and max-force (Fmax) trajectory plots with independent force-plot toggling
- Radius Contrast control for reducing or restoring element-radius size differences
- Visual styles including default, cartoon, glossy, metallic, cinematic, rowan, bubble, neon, grey, and 2D
- Hide hydrogens without deleting data, and apply optional render blur to saved images
- Clipboard export for current frame or full trajectory as
xyz,extxyz,cif, orPOSCAR - Cell-aware camera presets and browser PNG/GIF export for rendered viewers
Installation
aseview 0.0.14 and newer require Python 3.11 or newer. If you need Python 3.10 support, install the last compatible release, 0.0.13:
pip install "aseview<0.0.14"
Recommended:
uv venv -p 3.11
uv pip install aseview
aseview -h
pip install aseview
For development:
git clone https://github.com/kangmg/aseview.git
cd aseview
python3 scripts/run_locked_verification.py python -m pytest tests/test_imports.py -q
Contributor validation uses the committed hash-locked verification runner so docs, release artifacts, and CI checks exercise the declared dependency locks instead of an editable checkout install.
See Installation for optional PNG/GIF export setup and dependency details.
For Gaussian CUBE orbital or density surfaces, install the optional surface dependencies.
This uses the published cvve package for cube/CHGCAR grid parsing:
pip install "aseview[surface]"
CLI Usage
aseview molecule.xyz
aseview trajectory.xyz -i 0:10 --style neon
See the CLI Reference for the full option list — frame indexing, viewer/style/theme selection, overlay colormaps, normal-mode Hessian input, and server options. For SSH port forwarding to a remote server, see Quick Start.
Jupyter Notebook
from ase.io import read
from aseview import MolecularViewer
atoms = read('molecule.xyz')
viewer = MolecularViewer(atoms)
viewer.show()
# PyMOL-style quick render, no control panel
from aseview import view
view(atoms, styles='cinematic', hide_hs=True, center=True)
from aseview import SurfaceViewer
viewer = SurfaceViewer(
"HOMO.cube",
surface_kind="orbital",
isovalue="0.03:0.09:4",
positive_color="#ef4444",
negative_color="#2563eb",
opacity_ramp=[0.25, 0.45, 0.65, 0.8],
)
viewer.show()
Surface isovalues accept explicit lists, comma lists, start:stop:count, and
linspace(start,stop,count) specs. Density grids accept signed nonzero levels;
negative shells use negative_color. Orbital and delta-density values are
nonzero magnitudes and always generate both signed phases. Contour surfaces use
a denser default extraction grid for tighter line spacing.
Every viewer accepts extensive settings — styles, camera presets, energy/force plots, constraint and polyhedron highlighting, charge/magmom coloring, and more. See the Python API reference for each class:
- MolecularViewer — structures and trajectories
- SurfaceViewer — cube-backed orbital, density, and delta-density isosurfaces
- LiteViewer / view() — lightweight wrapper, no control panel
- OverlayViewer — compare multiple structures
- NormalViewer — vibrational modes from ASE, ORCA
.hess, or VASPOUTCAR - FragSelector — synchronized 2D/3D fragment picker
Viewer Types
| Viewer | Description |
|---|---|
| MolecularViewer | Single structure or trajectory animation |
| SurfaceViewer | CUBE orbital, density, and delta-density isosurfaces |
LiteViewer / view(...) |
Lightweight wrapper around MolecularViewer for quick renders — no control panel |
| NormalViewer | Normal mode vibration visualization |
| OverlayViewer | Compare multiple structures overlaid |
| FragSelector | Interactive 2D+3D atom selection with rect/lasso |
VS Code Extension
The vscode-extension/ package provides a native VS Code custom editor for structure files. It uses ase-ts for parsing and writing, so it does not require a Python runtime inside VS Code.
Supported default file patterns include *.xyz, *.extxyz, *.cif, *.pdb, *.vasp, POSCAR, and CONTCAR. See vscode-extension/README.md for the extension's settings (default viewer/style, read format/index) and commands.
cd vscode-extension
npm install
npm run compile
npm run package
Install the generated .vsix from VS Code with Extensions -> Install from VSIX....
On tag releases, the VS Code workflow builds the same verified package and
attaches aseview-vscode-<version>.vsix plus aseview-latest.vsix to the
GitHub Release assets.
Themes
aseview ships with multiple visual themes. Each theme is a complete HTML template set that controls the viewer's colour scheme, background, and UI style.
| Theme | Description |
|---|---|
dark |
Dark theme with deep grey background |
darkgreen |
Dark theme with green accent colours |
simple |
Minimal, low-distraction theme |
spring |
Spring theme (default) with bright, airy colours |
glass |
Frosted-glass aesthetic with translucent UI panels |
aseview molecule.xyz --theme spring
aseview molecule.xyz -t glass -o out.html
See the Theming guide for the Python/JavaScript theme API and instructions on creating custom themes.
Each full theme directory contains five runtime templates:
molecular_viewer.html, normal_viewer.html, overlay_viewer.html,
frag_selector.html, and surface_viewer.html. LiteViewer uses its own
fixed lightweight template and is not themed per instance.
JavaScript Module
Use aseview in any web page without Python:
<div id="viewer" style="width:100%; height:500px;"></div>
<script src="https://cdn.jsdelivr.net/gh/kangmg/aseview@main/aseview/static/js/aseview.js"></script>
<script>
const viewer = new ASEView.MolecularViewer('#viewer', { viewPreset: 'top-c' });
viewer.setData({
symbols: ['O', 'H', 'H'],
positions: [
[0.0, 0.0, 0.117],
[0.0, 0.757, -0.469],
[0.0, -0.757, -0.469]
]
});
viewer.setView({ preset: 'front' }).then(() => {
return viewer.savePNG({ returnDataUrl: true, download: false });
}).then((png) => {
console.log(png.filename, png.dataUrl.length);
});
</script>
See the JavaScript Module documentation for the full API reference — camera control, PNG/GIF export options and promise shapes — or try the live demo and playground.
Python viewers expose the equivalent headless save_png() and save_gif() methods when installed with the export extra (see Installation).
Supported Formats
Input files are handled through ASE in Python and ase-ts in the VS Code extension. Common formats include xyz, extxyz, cif, pdb, vasp, POSCAR, and CONTCAR — see File Formats for the full list and viewer clipboard export details.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aseview-0.0.21.tar.gz.
File metadata
- Download URL: aseview-0.0.21.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
506d9f22350d08de7f155c401b7545a6ecd1be5f97e9b8a0af473e65e2338aee
|
|
| MD5 |
19bdc77a8bda62a56eadf566a16a5785
|
|
| BLAKE2b-256 |
369bde57501848e4ab5ae602b6a35b1e793f4ab4beeea7e05b11f337431ac021
|
Provenance
The following attestation bundles were made for aseview-0.0.21.tar.gz:
Publisher:
publish.yml on kangmg/aseview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aseview-0.0.21.tar.gz -
Subject digest:
506d9f22350d08de7f155c401b7545a6ecd1be5f97e9b8a0af473e65e2338aee - Sigstore transparency entry: 2674532473
- Sigstore integration time:
-
Permalink:
kangmg/aseview@8eb414333b65767af2589c12981fd38f1e402412 -
Branch / Tag:
refs/tags/v0.0.21 - Owner: https://github.com/kangmg
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8eb414333b65767af2589c12981fd38f1e402412 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aseview-0.0.21-py3-none-any.whl.
File metadata
- Download URL: aseview-0.0.21-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d0702a70d8bcba724e39c08fb3e46fd3899fb08967849b7228c2161f9aef1e3
|
|
| MD5 |
a589e3fe4fadab48d952300fbe36a32b
|
|
| BLAKE2b-256 |
ca028c0ec4f429c11a9dd125cf3a3c0ba1bb4d2e8643271f736aeaad59cbea71
|
Provenance
The following attestation bundles were made for aseview-0.0.21-py3-none-any.whl:
Publisher:
publish.yml on kangmg/aseview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aseview-0.0.21-py3-none-any.whl -
Subject digest:
1d0702a70d8bcba724e39c08fb3e46fd3899fb08967849b7228c2161f9aef1e3 - Sigstore transparency entry: 2674532525
- Sigstore integration time:
-
Permalink:
kangmg/aseview@8eb414333b65767af2589c12981fd38f1e402412 -
Branch / Tag:
refs/tags/v0.0.21 - Owner: https://github.com/kangmg
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8eb414333b65767af2589c12981fd38f1e402412 -
Trigger Event:
push
-
Statement type: