Skip to main content

dcat-ap-plus-compound

PyPI Python Licence

The chemistry layer of the DCAT-AP-PLUS extensions: exact molecular properties of Chem-DCAT-AP chemical entities, computed from SMILES by a Rust core that is checked against RDKit.

Status: pre-alpha. The first slice is built; the rest is specified.

Overview

DCAT-AP-PLUS is the Data Catalog Vocabulary application profile extended by NFDI4Chem and NFDI4Cat. A catalogue in it and its chemistry extension, Chem-DCAT-AP, names the chemical entities a dataset is about, usually by a stated structure, formula or name. This package completes those entities by computation: what follows from a stated structure and published constants alone is derived, never inferred by a reasoner, and every answer is a verdict with its basis. An input that cannot be answered is refused with a reason in a shared grammar (<label>: <blocker>; needs <remedy>), never silently dropped.

Notebook 20 of dcat-ap-plus-chromatography uses it for the analytes its runs measure.

What it computes

Tool From Gives
properties a Simplified Molecular Input Line Entry System (SMILES) string Hill formula with its charge, element counts, formal charge, heavy-atom count, ring count (smallest set of smallest rings), component count, monoisotopic mass, molar mass with its interval
closed-ladder, linear-ladder a profile of rung values the invariants of the ladder: circulation, circulation per rung, uniformity

The Rust core reads SMILES, kekulizes aromatic systems and assigns implicit hydrogens itself. Every value agrees with RDKit on the reference cases, which the Rust, Python and TypeScript tests all reproduce.

Specified and not yet built: identity keys (InChI, InChIKey), protonation at a medium, substructure search, similarity and model estimates.

Installation

Python 3.13. Wheels for Linux, macOS and Windows carry the compiled Rust core; the package has no other dependency.

pip install dcat-ap-plus-compound

Installing from the source distribution compiles the Rust core and needs a Rust toolchain.

Usage

from dcat_ap_plus_compound import rust

rust.ask("properties", smiles="CC(=O)[O-]")
# {'formula': 'C2H3O2-', 'formal_charge': -1, 'monoisotopic_mass': 59.0138..., 'molar_mass': 59.044, ...}

rust.ask("properties", smiles=" CCO")
# Refusal(label='unparsable', blocker='SMILES at position 0: leading whitespace',
#         needs='a `parse` convention that trims it, such as parse:trim-whitespace@1')

rust.ask("properties", conventions={"parse:trim-whitespace@1": {}}, smiles=" CCO")
# {'formula': 'C2H6O', ...}: read under the named convention

Many records in one call, each answered or refused on its own:

answers = rust.tool("properties", [{"record": key, "inputs": {"smiles": s}} for key, s in structures.items()])

The same core builds as a command for the artefact runtime, one JSON request on standard input and one answer per record:

$ 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,...}}]}

Results on public data

The 445 analytes of RepoRT datasets 0187–0196 are computed from their stated SMILES in 0.15 s. Against the formula RepoRT states, 420 agree, 21 are the neutral parent of a charged structure, and 4 differ, one of them a wrong structure in RepoRT. The entities are then written as Chem-DCAT-AP ChemicalEntity records in a SciDatS file (notebook 02).

Documentation

The source repository holds the specification (17 parts, the blueprint for the package and its adapters), the notebooks (the Rust core against RDKit; RepoRT's stated structures checked) and the changelog.

Data

Notebook 02 reads an extract of RepoRT (Kretschmer et al., Nature Methods 21, 153–155, 2024) in docs/notebooks/data/report, licensed Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0) as RepoRT is.

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. The three 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 cargo
crates/compound-wasm/ Rust the core for browsers, through the same protocol wasm-pack
crates/compound-py/ Rust the extension module dcat_ap_plus_compound._core, built by maturin into every wheel maturin
packages/compound/ TypeScript @dcat-ap-plus/compound: typed calls of the tools for web interfaces npm
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 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

Development

Requires uv, the Rust toolchain pinned in rust-toolchain.toml, 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; see CONTRIBUTING.md.

Citation

Sachikonye, K. F. (2026). dcat-ap-plus-compound (version 0.1.1) [Software]. https://pypi.org/project/dcat-ap-plus-compound/

Acknowledgement

Kundai Farai Sachikonye, University of Greifswald. Developed within NFDI4Cat, the National Research Data Infrastructure for Catalysis-Related Sciences, funded by the German Research Foundation (DFG), project number 441926934.

Licence

MIT. The RepoRT extract in docs/notebooks/data/report is CC BY-SA 4.0.

Metadata

Release files for dcat-ap-plus-compound 0.1.1

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

Source distribution (sdist)

Source distribution for dcat-ap-plus-compound 0.1.1
File Size Uploaded Provenance Actions
dcat_ap_plus_compound-0.1.1.tar.gz 34.7 kB Without provenance Details for dcat_ap_plus_compound-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dcat-ap-plus-compound 0.1.1
File Interpreter ABI Platform Actions
dcat_ap_plus_compound-0.1.1-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details for dcat_ap_plus_compound-0.1.1-cp313-abi3-win_amd64.whl

Total release size: 258.5 kB

Release files / dcat_ap_plus_compound-0.1.1.tar.gz

Download URL dcat_ap_plus_compound-0.1.1.tar.gz
Size 34.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a6df74b527e4a08b3d8f22ce921f7f5d3443cfa962e442a72bc6bff9f252efe7
BLAKE2b-256 checksum
How to use checksums
ddf2fd26acab03448fd101d83f1e9a7b4190ab1ce47f3ed91158e5fcf12bb673
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.1-cp313-abi3-win_amd64.whl

Download URL dcat_ap_plus_compound-0.1.1-cp313-abi3-win_amd64.whl
Size 223.8 kB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f41eb38af519df5074b5476611a15497f575a35d9772a73b5980182ee1f765a6
BLAKE2b-256 checksum
How to use checksums
d74904e826ee25105e7484798f664112c742e2fc4dcfabe0a93da9b0a6f39c33
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.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No 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