Metadata-Version: 2.4
Name: smiles-fp
Version: 0.2.1.2024.9.6
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Classifier: Programming Language :: Rust
Requires-Dist: joblib
Requires-Dist: numpy
Requires-Dist: rdkit==2024.9.6
Requires-Dist: scipy
Requires-Dist: tqdm
License-File: LICENSE
Summary: Rust-accelerated Tanimoto similarity search over RDKit Morgan fingerprints.
Keywords: 
Author-email: Tim Hörmann <pypi@audivir.de>
License-Expression: MIT
Requires-Python: >=3.10, <=3.13
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/audivir/smiles-fp
Project-URL: Issues, https://github.com/audivir/smiles-fp/issues
Project-URL: Repository, https://github.com/audivir/smiles-fp

# smiles-fp

Rust-accelerated Tanimoto similarity search over RDKit Morgan fingerprints.

## Prerequisites

- Python 3.10 to 3.14.
- RDKit, pinned to the version a given wheel was built against.
- To build from source: a Rust toolchain and [`uv`](https://docs.astral.sh/uv/) (RDKit/Boost headers
  are fetched automatically from PyPI, no conda required).

## Installation

A wheel is published to PyPI per supported RDKit release, pin the RDKit version during installation:

```bash
uv pip install smiles-fp~=0.2.1 rdkit~=2024.0 # installs smiles-fp==0.2.1.2024.9.6 and rdkit==2024.9.6
```

To build locally instead, `build_wheels.py` builds wheels per RDKit release into a local index:

```bash
python smiles-fp-pypi/build_wheels.py 2024.9.6 2025.9.3 2025.9.6 2026.3.2
mv ./target/wheels ./target/smiles-fp
python -m http.server --directory ./target/
uv pip install smiles-fp --extra-index-url http://localhost:8000
```

## Usage

```python
from smiles_fp import get_mols, get_morgan_fps, save_fingerprints
from smiles_fp.search import similarity_search

query_ids = ["aspirin", "ethanol"]
mols = get_mols(["CC(=O)OC1=CC=CC=C1C(=O)O", "CCO"])
fps = get_morgan_fps(mols)
save_fingerprints(fps, "query.fp")

db_ids = ["ethylamine", "acetylsalicylic acid"]
db_mols = get_mols(["CCN", "CC(=O)OC1=CC=CC=C1C(=O)O"])
db_fps = get_morgan_fps(db_mols)
save_fingerprints(db_fps, "db.fp")

results = similarity_search(query_ids, "query.fp", db_ids, "db.fp", k=5)
```

## License

MIT, see `LICENSE`.

