PHPackages                             ankane/rdkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ankane/rdkit

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ankane/rdkit
============

Cheminformatics for PHP, powered by RDKit

v0.2.0(7mo ago)328BSD-3-ClausePHPPHP &gt;= 8.1CI passing

Since Aug 9Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/ankane/rdkit-php)[ Packagist](https://packagist.org/packages/ankane/rdkit)[ RSS](/packages/ankane-rdkit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

RDKit PHP
=========

[](#rdkit-php)

Cheminformatics for PHP, powered by [RDKit](https://github.com/rdkit/rdkit)

[![Build Status](https://github.com/ankane/rdkit-php/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/rdkit-php/actions)

Installation
------------

[](#installation)

Run:

```
composer require ankane/rdkit
```

Add scripts to `composer.json` to download the shared library:

```
    "scripts": {
        "post-install-cmd": "RDKit\\Vendor::check",
        "post-update-cmd": "RDKit\\Vendor::check"
    }
```

And run:

```
composer install
```

Getting Started
---------------

[](#getting-started)

Create a molecule

```
use RDKit\Molecule;

$mol = Molecule::fromSmiles('c1ccccc1O');
```

Get the number of atoms

```
$mol->numAtoms();
```

Get substructure matches

```
$mol->match(Molecule::fromSmarts('ccO'));
```

Get fragments

```
$mol->fragments();
```

Generate an SVG

```
$mol->toSvg();
```

Fingerprints
------------

[](#fingerprints)

A number of [fingerprints](https://www.rdkit.org/docs/RDKit_Book.html#additional-information-about-the-fingerprints) are supported.

RDKit

```
$mol->rdkitFingerprint();
```

Morgan

```
$mol->morganFingerprint();
```

Pattern

```
$mol->patternFingerprint();
```

Atom pair

```
$mol->atomPairFingerprint();
```

Topological torsion

```
$mol->topologicalTorsionFingerprint();
```

MACCS

```
$mol->maccsFingerprint();
```

You can use a library like [pgvector-php](https://github.com/pgvector/pgvector-php) to find similar molecules. See an [example](https://github.com/pgvector/pgvector-php/blob/master/examples/rdkit/example.php).

Updates
-------

[](#updates)

Add or remove hydrogen atoms

```
$mol->addHs();
$mol->removeHs();
```

Standardize

```
$mol->cleanup();
$mol->normalize();
$mol->neutralize();
$mol->reionize();
$mol->canonicalTautomer();
$mol->chargeParent();
$mol->fragmentParent();
```

Conversion
----------

[](#conversion)

SMILES

```
$mol->toSmiles();
```

SMARTS

```
$mol->toSmarts();
```

CXSMILES

```
$mol->toCXSmiles();
```

CXSMARTS

```
$mol->toCXSmarts();
```

JSON

```
$mol->toJson();
```

Reactions
---------

[](#reactions)

Create a reaction

```
use RDKit\Reaction;

$rxn = Reaction::fromSmarts('[CH3:1][OH:2]>>[CH2:1]=[OH0:2]');
```

Generate an SVG

```
$rxn->toSvg();
```

History
-------

[](#history)

View the [changelog](https://github.com/ankane/rdkit-php/blob/master/CHANGELOG.md)

Contributing
------------

[](#contributing)

Everyone is encouraged to help improve this project. Here are a few ways you can help:

- [Report bugs](https://github.com/ankane/rdkit-php/issues)
- Fix bugs and [submit pull requests](https://github.com/ankane/rdkit-php/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features

To get started with development:

```
git clone https://github.com/ankane/rdkit-php.git
cd rdkit-php
composer install
composer test
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance74

Regular maintenance activity

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~139 days

Total

4

Last Release

229d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/220358?v=4)[Andrew Kane](/maintainers/ankane)[@ankane](https://github.com/ankane)

---

Top Contributors

[![ankane](https://avatars.githubusercontent.com/u/220358?v=4)](https://github.com/ankane "ankane (17 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ankane-rdkit/health.svg)

```
[![Health](https://phpackages.com/badges/ankane-rdkit/health.svg)](https://phpackages.com/packages/ankane-rdkit)
```

###  Alternatives

[roots/bedrock-autoloader

An autoloader that enables standard plugins to be required just like must-use plugins

405.6M51](/packages/roots-bedrock-autoloader)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
