Skip to main content

Chemvas — Draw interactively. Automate safely. Export exactly.

CI PyPI Python 3.12+ License: MIT

English · 한국어

Chemvas is an open-source drawing tool for reaction schemes that you can rebuild. Every figure comes from an editable .cdxml file and one command, so it can be re-rendered at a journal column width after any change. A script or an AI agent can edit the same file through checked patches instead of rewriting it.

Open supported single-page ChemDraw XML (.cdxml) files from File > Open, edit on the canvas, and use Save to write CDXML again. Import uses Chemvas drawing styles while retaining native fragments, reaction references and vector objects. Unsupported edits fail before replacing the file; see format limits.

What Chemvas is for

Reproducible publication schemes

  • render-document exports SVG, PDF, PNG and CDXML without opening a window, fitted to a column width such as 84 mm or 174 mm.
  • check-layout reports common label collisions and content outside the sheet before you export. It does not check every pair of objects.
  • The publication recipes build finished figures from a script with a fixed bond length and font size, so every scheme in a manuscript has the same scale.

Agent editing you can check

  • inspect-document lists every atom with a stable ID and every bond by its two atom IDs, and saved notes by their snapshot index, plus the SHA-256 of the file.
  • apply-patch takes a JSON patch of graph operations and note creation, movement, or content/style replacement. It refuses a patch written against different file bytes, can check a patch with --dry-run without writing anything, validates the whole document, and writes to a new file only. The input file is never modified.
  • Patches are checked for document structure, not for chemistry: element symbols and valence are not validated. Review the rendered figure before you use it.

Drawing by hand

  • The desktop app draws structures, reaction arrows and labels, and provides alignment tools, autosave and session recovery. Drawings saved in the app work with every command above, and the reverse.

Current limits

Chemvas does not replace ChemDraw for file exchange. Inputs that Chemvas cannot represent exactly are refused with an error rather than drawn incorrectly.

  • Opens: .cdxml; SVG files that Chemvas exported with Editable Chemvas SVG checked (other SVG files cannot be opened); 2D MOL V2000 files within the subset Chemvas writes (bond orders 1–3, wedge and hash bonds, charges, radicals).
  • Refused: binary CDX and multipage CDXML, SDF and RXN files; MOL files with 3D coordinates, isotopes, aromatic bond type 4 or V3000.

Install

Requires Python 3.12+.

pip install chemvas
chemvas

Drawing, figure export and the script quickstart use this install. Chemvas has no optional chemistry extra.

For local Windows packaging, see the Windows packaging guide.

Quickstart: from a script or agent

chemvas compose-document scheme.json --output scheme.cdxml
chemvas inspect-document scheme.cdxml > inspection.json
chemvas apply-patch scheme.cdxml patch.json --dry-run
chemvas apply-patch scheme.cdxml patch.json --output revised.cdxml
chemvas check-layout revised.cdxml
chemvas render-document revised.cdxml --output scheme.svg --width-mm 174

scheme.json describes atoms, bonds, arrows and notes. patch.json carries the source_sha256 from inspection.json and the operations to apply. Each command writes a new file and refuses to overwrite an existing one, and check-layout exits with status 1 when it finds warnings. The formats and a worked example with images are in the Agent CLI guide.

Quickstart: in the desktop app

Chemvas walkthrough: insert structures, label an arrow, align the scheme, and export SVG

  1. Choose the Ring tool (J) and click the left side of the canvas to place benzene. Choose Bond (X), drag one bond out from a ring atom to a new carbon, then drag a second bond from that carbon to a terminal atom. Hover the terminal atom, press o, then press Enter and set the label to OH.
  2. Place a second benzene to the right. Drag one bond out from a ring atom to a new carbon, then drag a second bond from that carbon to a terminal atom. Hover the second bond and press 2 so only that bond becomes a double bond, then hover the terminal atom and press o. Select the Arrow tool, drag between the structures, and double-click the arrow to add condition labels.
  3. Select both molecules (Edit ▸ Select All) and align them (Edit ▸ Align ▸ Middle).
  4. Save the document (.cdxml). Export via File ▸ Export Figure… → Plain SVG, Fit 2-column (174 mm).

For detailed instructions and example files, see the step-by-step guide.

Documentation

Feedback and bug reports: GitHub Issues.

How this was built

I'm a chemist, not a programmer. AI coding agents write the code in this repository. I decide what Chemvas should do, record structural decisions as architecture decision records, keep saved drawings under a written compatibility policy, and set the checks a change must pass before it merges.

I don't review the code line by line, so a change is accepted on evidence, not on an agent's report that it works:

  • make check runs lint, formatting and type checks, then runs each test file in its own process so Qt state cannot leak from one file into the next. CI runs the same per-file suite.
  • Chemvas does not write machine.json. The calculation handoff and its project-local observation snapshot were removed with the chemistry backend (ADR 0055). Another project's decision to adopt a provider is outside this repository.
  • High-impact changes, such as the document format, undo and rollback, and figure export, get an independent adversarial review from a separate agent.

Metadata

Release files for chemvas 0.26.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chemvas 0.26.0
File Size Uploaded Provenance
chemvas-0.26.0.tar.gz 745.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for chemvas 0.26.0
File Interpreter ABI Platform
chemvas-0.26.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.7 MB

Release files / chemvas-0.26.0.tar.gz

Download URL chemvas-0.26.0.tar.gz
Size 745.0 kB
Tags Source
SHA-256 checksum
How to use checksums
133251e8f0503b6c2f9dbfe4160c32f38feb835873f25d0242769edb1fddcbef
BLAKE2b-256 checksum
How to use checksums
f3182c562ffeb25546ce4a6550169010add314dcfa143da8c84255a02c3e3c49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 22, 2026.

Transparency log

Release files / chemvas-0.26.0-py3-none-any.whl

Download URL chemvas-0.26.0-py3-none-any.whl
Size 925.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3275a107da389d87163ceec92f0605e01c196f72ee59541c441d24a0d13b4cba
BLAKE2b-256 checksum
How to use checksums
32bc76a1ecba15fd7e4968d19ac2132b69f949648dace24a9e64146009d80d4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 22, 2026.

Transparency log

Security for chemvas 0.26.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.

Select from 2 files

Attestation for chemvas-0.26.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 Oct 22, 2026.

Transparency log

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

Release history Release notifications | RSS feed

This release

0.26.0 This release

2 release files Full provenance

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