* Add RDLog::CaptureLog for capturing log messages Adds an RAII `CaptureLog` class to `namespace RDLog` (alongside the existing `LogStateSetter`) that redirects an RDKit logger's output to an internal `std::stringstream` for the duration of its lifetime. On destruction the original stream destination and enabled state are fully restored. Nesting is supported: an inner capture shadows the outer one and each collects its own messages independently. The default constructor captures `rdErrorLog`; an explicit constructor accepts any `RDLogger`. Both enable the logger if it was previously disabled and restore that state on destruction. Python bindings expose `rdBase.CaptureLog` as a context manager with a `messages` read-only property, mirroring the existing `rdBase.BlockLogs` pattern. Messages remain accessible after the `with` block exits. C++ tests are added to `catch_logs.cpp` (6 Catch2 sections covering basic capture, empty state, enable/restore, stream restore, explicit logger, and nested captures). Python tests are added to `UnitTestLogging.py` (6 unittest cases covering the same scenarios). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * CaptureLog: add per-level properties (error_messages, warning_messages, etc.) The Python CaptureLog wrapper now captures all four log levels simultaneously. Per-level properties (error_messages, warning_messages, info_messages, debug_messages) give access to messages from each logger independently; the existing messages property returns them all combined. The C++ RDLog::CaptureLog class is unchanged — it remains a clean single-logger RAII type. The Python wrapper composes four instances of it, one per log level. Suggested by bp-kelley in PR review. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Refactor CaptureLog: add named per-level subclasses Add CaptureErrorLog, CaptureWarningLog, CaptureInfoLog, and CaptureDebugLog as named convenience subclasses of CaptureLog, each capturing a specific logger. Update Python bindings to expose the four named classes directly (dropping the combined multi-capture approach), and update tests accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Simplify CaptureLog: no argument, captures rdErrorLog only Remove the RDLogger argument overload, the four named subclasses, and the PyCaptureLog template in favor of a single no-argument CaptureLog that mirrors the Schrödinger CaptureRDErrorLog from which it was inspired. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * CaptureLog tests: add dp_dest restoration and LogStateSetter interaction Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Rename CaptureLog to CaptureErrorLog The name CaptureLog was ambiguous; CaptureErrorLog is explicit about which logger it captures and avoids redundancy within namespace RDLog. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Generalize CaptureErrorLog into CaptureLog with logger parameter Replace CaptureErrorLog with CaptureLog, which accepts any RDLogger in its constructor (e.g. rdErrorLog, rdWarningLog). Add CaptureErrorLog as a convenience subclass that pre-fills rdErrorLog, preserving backward compatibility for existing callers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
RDKit
What is it?
The RDKit is a collection of cheminformatics and machine-learning software written in C++ and Python.
- BSD license - a business friendly license for open source
- Core data structures and algorithms in C++
- Python 3.x wrapper generated using Boost.Python
- Java and C# wrappers generated with SWIG
- JavaScript (generated with emscripten) and CFFI wrappers around important functionality
- 2D and 3D molecular operations
- Descriptor and Fingerprint generation for machine learning
- Molecular database cartridge for PostgreSQL supporting substructure and similarity searches as well as many descriptor calculators
- Cheminformatics nodes for KNIME
- Contrib folder with useful community-contributed software harnessing the power of the RDKit
Installation and getting started
If you are working in Python and using conda (our recommendation), installation is super easy:
$ conda install -c conda-forge rdkit
You can then take a look at our Getting Started in Python guide.
More detailed installation instructions are available in Docs/Book/Install.md.
Documentation
Available on the RDKit page and in the Docs folder on GitHub
The RDKit blog often has useful tips and tricks.
Support and Community
If you have questions, comments, or suggestions, the best places for those are:
If you've found a bug or would like to request a feature, please create an issue
We also have a LinkedIn group
We have a yearly user group meeting (the UGM) where members of the community do presentations and lightning talks on things they've done with the RDKit. Materials from past UGMs, which can quite useful, are also online:
- 2012 UGM, London
- 2013 UGM, Hinxton
- 2014 UGM, Darmstadt
- 2015 UGM, Zurich
- 2016 UGM, Basel
- 2017 UGM, Berlin
- 2018 UGM, Cambridge
- 2019 UGM, Hamburg
- 2020 UGM, virtual
- 2021 UGM, virtual
- 2022 UGM, Berlin
- 2023 UGM, Mainz
- 2024 UGM, Zurich
License
Code released under the BSD license.