Skip to main content

aseview

Molecular structure viewer for ASE (Atomic Simulation Environment).

PyPI  ·  Docs  ·  Playground  ·  DeepWiki

Features

  • Interactive structure, trajectory, overlay, normal-mode, and fragment-selection viewers
  • Optional cube-backed SurfaceViewer for 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, or POSCAR
  • 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:

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

aseview-0.0.26.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aseview-0.0.26-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file aseview-0.0.26.tar.gz.

File metadata

  • Download URL: aseview-0.0.26.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

Hashes for aseview-0.0.26.tar.gz
Algorithm Hash digest
SHA256 e7e7cbb8f9fbdddb062bf6aeb3f2ee912c26ed178a647b0086e838725a981f8e
MD5 85ddee7458185614a7651c9bb9a33da9
BLAKE2b-256 2342dfc914ca2b581a4718e0d10718a58da058ad02066d2d7f1e57cdcac1520d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aseview-0.0.26.tar.gz:

Publisher: publish.yml on kangmg/aseview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aseview-0.0.26-py3-none-any.whl.

File metadata

  • Download URL: aseview-0.0.26-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

Hashes for aseview-0.0.26-py3-none-any.whl
Algorithm Hash digest
SHA256 9c815efaf4d5fa2336f2e22307d64e73de16b0137e99ae54c8f2ad54ca3cf5a8
MD5 83745fd6eb6977cc1297a48f9dbfb7e3
BLAKE2b-256 1c39e0715da17eae1fcc33728a6a0895ce788024ee9653e21b050523ac9bfb8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aseview-0.0.26-py3-none-any.whl:

Publisher: publish.yml on kangmg/aseview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.0.27

2 files

This release

0.0.26 This release

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page