pdchemchain is a framework for chainable pandas DataFrame manipulations, designed for interactive notebook use and command-line deployment. Built for chemistry via RDKit, but domain-agnostic at its core. All links are self-documenting, auto-configurable, and serializable to YAML/JSON.
from pdchemchain.links import MolFromSmiles, HeavyAtomCount, RDKitDescriptors
import pandas as pd
df = pd.DataFrame({"Smiles": ["c1ccccc1", "CCO", "CC(=O)O"]})
# Build a pipeline interactively
chain = MolFromSmiles() + HeavyAtomCount() + RDKitDescriptors(descriptors=["MolLogP", "TPSA"])
df_out = chain(df)
# Save for reuse from the command line
chain.to_config_file("pipeline.yaml")pdchemchain run pipeline.yaml --in_file molecules.csv --out_file results.csvFrom GitHub:
pip install git+https://github.com/EBjerrum/pdchemchain.gitDeveloper installation:
git clone git@github.com:EBjerrum/pdchemchain.git
cd pdchemchain
pip install -e .[dev]- Introduction — API concepts, code examples, and diagrams
- CLI Reference — full command-line usage
- Example Notebooks — end-to-end workflows
- Contribution Guide — how to create and contribute new links
Saved pipelines run directly from the command line with CSV and SDF support:
# Process CSV
pdchemchain run pipeline.yaml --in_file input.csv --out_file output.csv
# Process SDF (auto-detected from extension)
pdchemchain run pipeline.yaml --in_file molecules.sdf --out_file results.sdf
# With error file for failed rows
pdchemchain run pipeline.yaml --in_file input.sdf --out_file output.sdf --error_file errors.sdfSee the CLI Reference for format detection, SDF handling, advanced options, and full option reference.
See CONTRIBUTION.md for how to subclass Link/RowLink and create new links. The framework is designed for minimal boilerplate — a new link is typically 10-15 lines of code.