Skip to content

AsciiChem

ASCII in, chemistry out — in your language.

One model · Three implementations · One contract

Type once. The same bytes come out, whichever you ship.

Every implementation passes theshared corpus byte-for-byte — proof the model, not the notation, is the canonical form.

Ruby
asciichem
gem install asciichemReference implementation.
TypeScript
asciichem-ts
npm install asciichemPowers this page.
Python
asciichem-py
pip install asciichem-pyZero runtime deps.

AsciiChem is an ASCII syntax for representing chemistry — atoms, molecules, bonds, reactions, electron configurations, and the embedded mathematics that chemistry publications rely on. It is to chemistry what AsciiMath is to mathematics, but with a semantic model underneath: every parse produces the same tree, regardless of which front door you came in by.

Three independent packages — asciichem (Ruby), asciichem-ts (TypeScript), and asciichem-py (Python) — implement the same model and pass the same shared corpus byte-for-byte. Pick whichever ships in your stack:

Implementationparse / rejectL0L1L2SMILESmolfileCMLlinter
Rubyasciichem gem · referenceclaimedclaimedclaimedclaimedclaimedclaimedclaimedclaimed
TypeScriptasciichem · npmclaimedclaimedclaimedclaimedclaimedclaimednot yet claimednot yet claimed
Pythonasciichem-pyclaimedclaimedclaimedclaimedclaimedclaimednot yet claimednot yet claimed

Filled cells are claimed at 100% of the asciichem-tests corpus, verified in each implementation's CI. The Ruby gem is the reference; a claim is only as good as the shared corpus behind it.

A molecule has one structure regardless of the notation you write it in: InChI, SMILES, molfile, or AsciiChem. Likewise, the AsciiChem model has one shape regardless of the language you run it in. Three implementations keep the contract honest — no single implementation’s shortcuts become the specification.

Ruby (reference)

gem install asciichem — the reference implementation. MathML, structural SVG, citations, InChI identity. See Ruby.

TypeScript

npm install asciichem — runs in the browser or Node. Powers this page’s live renderer. See TypeScript.

Python

pip install asciichem-py — plain dataclasses, zero runtime dependencies. See Python.

Play