Skip to main content

protomol

License: MIT Pixi Badge Code style: ruff Typing: ty Copier

A draft of the graph API for AutoStorage and AutoEngine: graph types for molecules and reactions with local stereodescriptors.

It has four immutable graph types (MolGraph, StereoMolGraph, ReactionGraph, StereoReactionGraph), which are frozen pydantic models; their local stereodescriptors (Tetrahedral, PlanarBond, AtropBond, …, and StereoChange for a reaction); from_smiles; from_geometry and embed, to and from autogeom geometries; a deterministic JSON form; the transition-state graphs of a reaction (ts_graphs); drawings in Jupyter; and three test graphs in protomol.examples.

Installation

pip install protomol

or, in a pixi workspace, pixi add --pypi protomol. It is also on the avcopan/automech channel of prefix.dev.

Usage

import protomol as pm

# Every H is explicit, and atom i of the graph is atom i of the SMILES
gra = pm.from_smiles("CC(O)CC")
gra.symbols[:4]  # ('C', 'C', 'O', 'C')

# In Jupyter: C1 is marked "?", since the SMILES doesn't give its configuration
pm.display(gra)

# One compact, deterministic JSON string per graph
text = pm.to_json(gra)
assert pm.from_json(text) == gra

# The transition-state graphs of a reaction, in the reactants' atom order
(ts,) = pm.ts_graphs(pm.from_smiles("CC.[OH]"), pm.from_smiles("C[CH2].O"))
ts.breaking, ts.forming  # ((0, 3),), ((2, 3),)

protomol.examples has three test graphs, each with its golden JSON in tests/data/examples/:

function graph
species() (E)-pent-3-en-2-ol, one enantiomer (C[C@@H](O)/C=C/C)
abstraction_ts() C2H6 + OH → C2H5 + H2O, H abstraction
stereoisomerization_ts() (Z) → (E) but-2-en-1-yl radical, rotation about C2=C3

The pages in user_guide/ show protomol as AutoEngine and AutoStorage use it, one page per interface. Their >>> examples run as doctests; the planned examples show the API still to come.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Credits

This package was created with copier and the avcopan/copier-pixi-python project template.

Metadata

Release files for protomol 0.0.2

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

Source distribution (sdist)

Source distribution for protomol 0.0.2
File Size Uploaded Provenance Actions
protomol-0.0.2.tar.gz 97.8 kB Without provenance Details for protomol-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 213.4 kB

Release files / protomol-0.0.2.tar.gz

Download URL protomol-0.0.2.tar.gz
Size 97.8 kB
Tags Source
SHA-256 checksum
How to use checksums
005e52eae0124b97df6284a881dd0df36182e81f49b5a7e382f989038f0c794d
BLAKE2b-256 checksum
How to use checksums
4f97e53466792056b1f7420d3bb02684a11a2874eebe38ac36d171b2b7fe6258
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / protomol-0.0.2-py3-none-any.whl

Download URL protomol-0.0.2-py3-none-any.whl
Size 115.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bc01329a2610d332ff17dd4ff112b49210d322005477b209ee123c109fd70e1
BLAKE2b-256 checksum
How to use checksums
492b6039508f8abf74ff3492d5ef814c2d8163917de77e7477e6956a53d433d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for protomol 0.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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