LCMD-DB
Python client for the LCMD molecular database.
Installation
uv add lcmd-db
# or
pip install lcmd-db
Quick start
from lcmd_db import load_dataset, load_molecules
# Load a subset (molecules included by default)
data = load_dataset("qm9")
data.molecules # polars DataFrame
# Include multiple entity types
data = load_dataset("qm9", include=["molecules", "reactions", "fragments"])
# Include XYZ structure files
data = load_dataset("qm9", include_structures=True)
# Select specific properties
data = load_dataset("qm9", molecule_properties=["smiles", "energy"])
# Filter molecules server-side with SMARTS
data = load_dataset("formed", include=["molecules"], smarts="[OX2H]")
# Search molecules directly across the database
molecules = load_molecules(smarts="[OX2H]", smiles="CO")
# Choose output format
data = load_dataset("qm9", data_format="csv")
# Force re-download (bypass cache)
data = load_dataset("qm9", force_download=True)
Dataset API
load_dataset returns a SubsetData object containing polars DataFrames for each entity type. Convert it to a typed Dataset for lazy loading, filtering, and indexing:
data = load_dataset("qm9")
# Get a typed, iterable Dataset
molecules = data.as_dataset("molecules")
# Index and iterate
mol = molecules[0] # Molecule(id=..., properties={...})
batch = molecules[10:20] # Dataset slice
# Filter with polars expressions
import polars as pl
heavy = molecules.filter(pl.col("molecular_weight") > 100)
# Select specific columns
subset = molecules.select("smiles", "energy")
# Train/test split
train, test = molecules.train_test_split(test_size=0.2, seed=42)
# Export
df = molecules.to_polars()
pdf = molecules.to_pandas()
atoms = molecules.to_ase() # requires ase
CLI
# Download a dataset
lcmd-db download qm9
lcmd-db download qm9 --include molecules --include structures
lcmd-db download formed --include molecules --smarts "[OX2H]"
lcmd-db download qm9 -f csv --force
# Browse available schemas
lcmd-db schema list
lcmd-db schema show qm9
# Manage cache
lcmd-db cache clear
lcmd-db cache clear qm9
# Sync type stubs for autocomplete
lcmd-db stubs sync
Configuration
Settings are controlled via environment variables (prefix LCMD_DB_) or programmatically:
| Variable | Description | Default |
|---|---|---|
LCMD_DB_BASE_URL |
API base URL | https://lcmd-app.epfl.ch |
LCMD_DB_CACHE_DIR |
Cache directory | OS-dependent |
LCMD_DB_TIMEOUT |
Download timeout (seconds) | 300 |
LCMD_DB_AUTO_SYNC_STUBS |
Auto-sync type stubs on import | true |
LCMD_DB_MAX_MOLECULES |
Safety ceiling for an unbounded load_molecules (0 disables) |
100000 |
from lcmd_db import settings
settings.base_url = "https://custom-instance.example.com"
Metadata
Release files for lcmd-db 0.4.1
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 |
|---|---|---|---|---|
| lcmd_db-0.4.1.tar.gz | 244.5 kB | Without provenance | Details for lcmd_db-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lcmd_db-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for lcmd_db-0.4.1-py3-none-any.whl |
Total release size: 284.1 kB
Release files / lcmd_db-0.4.1.tar.gz
| Download URL | lcmd_db-0.4.1.tar.gz |
|---|---|
| Size | 244.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
360321f2b91712cb12d0d46c60db25d609258cca0b060826b95c31349200b33d
|
|
BLAKE2b-256 checksum How to use checksums |
e1993b98d3faabf31e23373ce7385706727a2e39fbfb32bac1344da0b9d52030
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / lcmd_db-0.4.1-py3-none-any.whl
| Download URL | lcmd_db-0.4.1-py3-none-any.whl |
|---|---|
| Size | 39.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3efaa35e95843f593167a9884d19158f3463381346d2bbcdb6be6bcdc1d429db
|
|
BLAKE2b-256 checksum How to use checksums |
61353991a661d45385aac5b1fe1aee943052f53670e58aff601e97d282b12250
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for lcmd-db 0.4.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.