dcat-ap-plus-compound
Compounds in DCAT-AP-PLUS and Chem-DCAT-AP, from identity to substructure and similarity search, computed rather than inferred by a reasoner and answered with verdicts.
Status: first slice built. The Rust core reads SMILES, kekulizes aromatic systems, assigns implicit hydrogens, and computes the exact properties of specification part 08 and the invariants of ladders. Every value agrees with RDKit on the reference cases. Identity keys (InChI, InChIKey), substructure search and similarity are specified and not yet built. The specification, the blueprint for this package and its adapters, is in docs/specification.
Installation
From PyPI, for Python 3.13. The wheels for Linux, macOS and Windows carry the Rust core.
pip install dcat-ap-plus-compound
Installing from the source distribution, or from the repository, compiles the Rust core and needs a Rust toolchain.
Layout
The heavy computing runs in Rust. Python is the prototype, built on RDKit, the reference the Rust code is tested against, and the language of the notebooks. TypeScript carries the web interface. Each language keeps its own build tool, and they share one version.
| Path | Language | What | Tool |
|---|---|---|---|
crates/compound-core/ |
Rust | SMILES reading, kekulization, implicit hydrogens, exact properties, ladders; the tool protocol as JSON in and out; no I/O | cargo |
crates/compound-tool/ |
Rust | the compound tool <name> command the artefact runtime runs: properties, closed-ladder, linear-ladder |
cargo |
crates/compound-wasm/ |
Rust | the core for browsers, through the same protocol | wasm-pack |
packages/compound/ |
TypeScript | @dcat-ap-plus/compound: typed calls of the tools for web interfaces |
npm |
crates/compound-py/ |
Rust | the extension module dcat_ap_plus_compound._core, built by maturin into every wheel |
maturin |
src/dcat_ap_plus_compound/, tests/ |
Python 3.13 | rust.py asks the extension module; the tests compare it with RDKit |
uv |
docs/notebooks/ |
Python | demonstrations: 01 the Rust core against RDKit; 02 RepoRT's stated structures checked and written as Chem-DCAT-AP chemical entities in a SciDatS file | uv |
scripts/ |
Python | generate_elements.py writes the element table from RDKit; generate_core_fixtures.py writes the reference values |
uv |
tests/fixtures/core/ |
JSON | values RDKit computed, which the Rust, Python and TypeScript tests must reproduce |
Usage
The command answers the tool protocol of the artefact runtime: one request on standard input, one answer per record.
A record it cannot answer is refused, with a reason in the shared grammar (<label>: <blocker>; needs <remedy>).
$ cargo build --release -p compound-tool
$ echo '{"records": [{"record": "r1", "inputs": {"smiles": "CC(=O)[O-]"}}]}' | target/release/compound tool properties
{"answers":[{"record":"r1","values":{"formula":"C2H3O2-","monoisotopic_mass":59.01385291591,...}}]}
Conventions reach the command as a conventions.json that the program names in the tool's files, so their digest
enters the stage key. Without one the defaults hold: parse:strict@1 refuses a SMILES with surrounding whitespace,
and parse:trim-whitespace@1 reads it.
From Python, with the core compiled into the package:
from dcat_ap_plus_compound import rust
rust.ask("properties", smiles="c1ccsc1") # {'formula': 'C4H4S', ...}
rust.ask("properties", smiles=" CCO") # Refusal(label='unparsable', ...)
rust.ask("properties", conventions={"parse:trim-whitespace@1": {}}, smiles=" CCO")
Data
Notebook 02 reads an extract of RepoRT (Kretschmer et al., Nature Methods 21, 153–155, 2024) in docs/notebooks/data/report. The extract is licensed CC BY-SA 4.0, as RepoRT is; the rest of the repository is under the MIT licence.
Development
Requires uv, the Rust toolchain pinned in rust-toolchain.toml (installed by rustup on
first use), wasm-pack and Node 20 or later.
# Python
uv sync # compiles the extension module from crates/compound-py with maturin
uv run ruff check .
uv run ruff format --check .
uv run zuban check
uv run pytest
uv run --group notebooks python docs/notebooks/build.py
uv run --group docs sphinx-build -W -b html docs docs/_build
# Rust
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
# WebAssembly and TypeScript (the build runs wasm-pack first)
npm ci
npm run build
npm run typecheck
npm test
After an RDKit upgrade, regenerate the element table and the fixtures with
uv run --group notebooks python scripts/generate_elements.py and scripts/generate_core_fixtures.py; a test fails
while the fixtures are out of date.
Commit messages follow Conventional Commits. The project follows the copier-python template; see CONTRIBUTING.md.
Authors and acknowledgment
Kundai Farai Sachikonye, University of Greifswald. Developed within NFDI4Cat, the National Research Data Infrastructure for Catalysis-Related Sciences.
Licence
MIT. See LICENSE. The RepoRT extract in docs/notebooks/data/report is CC BY-SA 4.0.
Metadata
Release files for dcat-ap-plus-compound 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dcat_ap_plus_compound-0.1.0.tar.gz | 33.7 kB | Without provenance | Details for dcat_ap_plus_compound-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dcat_ap_plus_compound-0.1.0-cp313-abi3-win_amd64.whl | CPython 3.13 | abi3 | Windows x86-64 | Details for dcat_ap_plus_compound-0.1.0-cp313-abi3-win_amd64.whl |
Total release size: 256.5 kB
Release files / dcat_ap_plus_compound-0.1.0.tar.gz
| Download URL | dcat_ap_plus_compound-0.1.0.tar.gz |
|---|---|
| Size | 33.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a49f10e1d67f4c18726f536e7466fbcf83412fde83184183f84cb0e6b4ccccec
|
|
BLAKE2b-256 checksum How to use checksums |
4e34a4698af5bbd7d8712befd1e39f8eb462d820389a7d64cd761305c070739e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / dcat_ap_plus_compound-0.1.0-cp313-abi3-win_amd64.whl
| Download URL | dcat_ap_plus_compound-0.1.0-cp313-abi3-win_amd64.whl |
|---|---|
| Size | 222.9 kB |
| Tags | CPython 3.13 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
666dd29a343d25bc33d515b8f2305b4abd09ac3aa79647f3e0d8638e7615c790
|
|
BLAKE2b-256 checksum How to use checksums |
80a3ceb8e4c0afdd1d828423d0f1293af7e62eb7d8267396c0dd97939be05294
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for dcat-ap-plus-compound 0.1.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.
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.