asciichemImplementations
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.
asciichem-tsasciichem-pyAsciiChem is a contract, not a codebase. The contract has two halves: the wire form (asciichem-model — versioned JSON Schemas plus generated types) and the conformance corpus (asciichem-tests — the fixtures every implementation must pass in its own CI). Anything that passes both is AsciiChem.
This is the single-contract rule: there is no “the parser”. There is the reference implementation and its equals.
| Implementation | parse / reject | L0 | L1 | L2 | SMILES | molfile | CML | linter |
|---|---|---|---|---|---|---|---|---|
| Rubyasciichem gem · reference | claimed | claimed | claimed | claimed | claimed | claimed | claimed | claimed |
| TypeScriptasciichem · npm | claimed | claimed | claimed | claimed | claimed | claimed | not yet claimed | not yet claimed |
| Pythonasciichem-py | claimed | claimed | claimed | claimed | claimed | claimed | not yet claimed | not 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.
The three packages
Section titled “The three packages”Ruby — asciichem
gem install asciichem — the reference. Full formatter set,
citations, InChI identity, linter, CLI. Ruby →
TypeScript — asciichem-ts
npm install asciichem — runs in the browser and Node.
Powers this page. TypeScript →
Python — asciichem-py
pip install asciichem-py — zero runtime deps, plain
dataclasses. Python →
Picking an implementation
Section titled “Picking an implementation”- Documents and standards pipelines (Ruby) — the gem integrates with Metanorma-style publishing; CML round-trip for interchange; the CLI covers parsing, rendering, linting, resolving, validation.
- Web and interactive tools (TypeScript) — parse and draw chemistry client-side; the corpus guarantees the same acceptance as the reference, so your web previews match your build-time renders.
- Data and science workflows (Python) — zero-dependency parsing into plain dataclasses; wire JSON in and out for pipelines.
All three speak the same wire form, so structures move freely between ecosystems.
Behind the implementations
Section titled “Behind the implementations”asciichem-model
The contract repository: LUTAML definitions, v1 schemas, examples, generated TypeScript types. Not a package — implementations vendor from tags.
asciichem-tests
The shared corpus: parser acceptance, identifiers, CML round-trip, fuzz, linter expectations, structure fixtures. Never edited to make an implementation pass.
asciichem.github.io
This site — the specification, rendered examples, and the live playground.