Metadata-Version: 2.4
Name: molfeat
Version: 1.0.0
Summary: molfeat - the hub for all your molecular featurizers
Author-email: Emmanuel Noutahi <emmanuel.noutahi@hotmail.ca>
License-Expression: Apache-2.0 AND MIT
Project-URL: Website, https://molfeat.datamol.io
Project-URL: Source Code, https://github.com/datamol-io/molfeat
Project-URL: Bug Tracker, https://github.com/datamol-io/molfeat/issues
Project-URL: Documentation, https://molfeat-docs.datamol.io/
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: molfeat/data/CHEMPROP_NOTICE
Requires-Dist: tqdm>=4.66
Requires-Dist: loguru>=0.7
Requires-Dist: joblib>=1.3
Requires-Dist: filelock>=3.13
Requires-Dist: fsspec[http]>=2024.3
Requires-Dist: pandas>=2.2
Requires-Dist: numpy<2,>=1.26; platform_system == "Darwin" and platform_machine == "x86_64"
Requires-Dist: numpy>=1.26; platform_system != "Darwin" or platform_machine != "x86_64"
Requires-Dist: scipy>=1.11
Requires-Dist: torch<2.3,>=2.2.2; platform_system == "Darwin" and platform_machine == "x86_64"
Requires-Dist: torch>=2.5; platform_system != "Darwin" or platform_machine != "x86_64"
Requires-Dist: datamol>=0.13.0
Requires-Dist: pyyaml>=6
Requires-Dist: platformdirs>=4
Requires-Dist: pydantic>=2.7
Requires-Dist: scikit-learn>=1.6
Requires-Dist: packaging>=23.2
Requires-Dist: pmapper>=1.1
Requires-Dist: rdkit>=2024.9.1
Provides-Extra: transformer
Requires-Dist: transformers<5,>=4.57; (platform_system == "Darwin" and platform_machine == "x86_64") and extra == "transformer"
Requires-Dist: transformers<6,>=4.57; (platform_system != "Darwin" or platform_machine != "x86_64") and extra == "transformer"
Requires-Dist: huggingface-hub>=0.34; extra == "transformer"
Requires-Dist: safetensors>=0.6; extra == "transformer"
Requires-Dist: sentencepiece>=0.2; extra == "transformer"
Requires-Dist: selfies>=2.1; extra == "transformer"
Provides-Extra: selfies
Requires-Dist: selfies>=2.1; extra == "selfies"
Provides-Extra: fcd
Requires-Dist: fcd_torch>=1.0.7; extra == "fcd"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.8; extra == "viz"
Requires-Dist: nglview>=3.1; extra == "viz"
Requires-Dist: ipywidgets>=8.1; extra == "viz"
Provides-Extra: cache
Requires-Dist: h5py>=3.10; extra == "cache"
Requires-Dist: pyarrow>=15; extra == "cache"
Provides-Extra: cloud
Requires-Dist: s3fs>=2024.3; extra == "cloud"
Requires-Dist: gcsfs>=2024.3; extra == "cloud"
Provides-Extra: mordred
Requires-Dist: mordredcommunity>=2.0.7; extra == "mordred"
Provides-Extra: pyg
Requires-Dist: torch_geometric>=2.6; extra == "pyg"
Provides-Extra: all
Requires-Dist: transformers<5,>=4.57; (platform_system == "Darwin" and platform_machine == "x86_64") and extra == "all"
Requires-Dist: transformers<6,>=4.57; (platform_system != "Darwin" or platform_machine != "x86_64") and extra == "all"
Requires-Dist: huggingface-hub>=0.34; extra == "all"
Requires-Dist: safetensors>=0.6; extra == "all"
Requires-Dist: sentencepiece>=0.2; extra == "all"
Requires-Dist: selfies>=2.1; extra == "all"
Requires-Dist: fcd_torch>=1.0.7; extra == "all"
Requires-Dist: h5py>=3.10; extra == "all"
Requires-Dist: pyarrow>=15; extra == "all"
Requires-Dist: s3fs>=2024.3; extra == "all"
Requires-Dist: gcsfs>=2024.3; extra == "all"
Requires-Dist: mordredcommunity>=2.0.7; extra == "all"
Requires-Dist: matplotlib>=3.8; extra == "all"
Requires-Dist: nglview>=3.1; extra == "all"
Requires-Dist: ipywidgets>=8.1; extra == "all"
Requires-Dist: torch_geometric>=2.6; extra == "all"
Provides-Extra: test
Requires-Dist: selfies>=2.1; extra == "test"
Requires-Dist: pytest>=8; extra == "test"
Requires-Dist: pytest-cov>=6; extra == "test"
Requires-Dist: pytest-timeout>=2.3; extra == "test"
Requires-Dist: pytest-xdist>=3.6; extra == "test"
Requires-Dist: h5py>=3.10; extra == "test"
Requires-Dist: pyarrow>=15; extra == "test"
Requires-Dist: mordredcommunity>=2.0.7; extra == "test"
Requires-Dist: matplotlib>=3.8; extra == "test"
Provides-Extra: docs
Requires-Dist: markdown-include>=0.8.1; extra == "docs"
Requires-Dist: mdx-truly-sane-lists>=1.3; extra == "docs"
Requires-Dist: mike>=2; extra == "docs"
Requires-Dist: mkdocs>=1.6; extra == "docs"
Requires-Dist: mkdocs-jupyter>=0.25; extra == "docs"
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Requires-Dist: mkdocs-material-extensions>=1.3; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.30; extra == "docs"
Provides-Extra: dev
Requires-Dist: black[jupyter]>=25; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pre-commit>=4; extra == "dev"
Requires-Dist: ruff>=0.11; extra == "dev"
Requires-Dist: twine>=6; extra == "dev"
Dynamic: license-file

<div align="center">
    <img src="docs/images/logo-title.svg" width="100%">
</div>

<p align="center">
    <b>molfeat - the hub for all your molecular featurizers </b> <br />
</p>
<p align="center">
  <a href="https://molfeat-docs.datamol.io/" target="_blank">
      Docs
  </a> |
  <a href="https://molfeat.datamol.io/" target="_blank">
      Homepage
  </a>
</p>

---

[![DOI](https://zenodo.org/badge/613548667.svg)](https://zenodo.org/badge/latestdoi/613548667)
[![PyPI](https://img.shields.io/pypi/v/molfeat)](https://pypi.org/project/molfeat/)
[![Conda](https://img.shields.io/conda/v/conda-forge/molfeat?label=conda&color=success)](https://anaconda.org/conda-forge/molfeat)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/molfeat)](https://pypi.org/project/molfeat/)
[![Conda](https://img.shields.io/conda/dn/conda-forge/molfeat)](https://anaconda.org/conda-forge/molfeat)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/molfeat)](https://pypi.org/project/molfeat/)
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![GitHub Repo stars](https://img.shields.io/github/stars/datamol-io/molfeat)](https://github.com/datamol-io/molfeat/stargazers)
[![GitHub Repo stars](https://img.shields.io/github/forks/datamol-io/molfeat)](https://github.com/datamol-io/molfeat/network/members)
[![test](https://github.com/datamol-io/molfeat/actions/workflows/test.yml/badge.svg)](https://github.com/datamol-io/molfeat/actions/workflows/test.yml)
[![code-check](https://github.com/datamol-io/molfeat/actions/workflows/code-check.yml/badge.svg)](https://github.com/datamol-io/molfeat/actions/workflows/code-check.yml)
[![doc](https://github.com/datamol-io/molfeat/actions/workflows/doc.yml/badge.svg)](https://github.com/datamol-io/molfeat/actions/workflows/doc.yml)
[![release](https://github.com/datamol-io/molfeat/actions/workflows/release.yml/badge.svg)](https://github.com/datamol-io/molfeat/actions/workflows/release.yml)

Molfeat is a hub of molecular featurizers. It supports a wide variety of out-of-the-box molecular featurizers and can be easily extended to include your own custom featurizers.

- 🚀 Fast, with a simple and efficient API.
- 🔄 Unify pre-trained molecular embeddings and hand-crafted featurizers in a single package.
- ➕ Easily add your own featurizers through plugins.
- 📈 Benefit from increased performance through a trouble-free caching system.

Visit our website at <https://molfeat.datamol.io>.

## Updates

Molfeat 1.x narrows the project to small-molecule featurization and a modern,
maintainable stack. It removes the legacy DGL, DGLLife, Graphormer and protein
adapters, keeps PyTorch Geometric as the graph backend, and adds maintained
foundation-model integrations including CheMeleon and Mol-JEPA. Model loading
is lazy, external checkpoint licences are explicit, and official
representations are covered by integration tests.

HTTP model downloads use the required Datamol 0.13 series; they no longer require
an unreleased dependency. SELFIES support is explicit, and InChI decoding now
returns SMILES instead of silently failing.

See the [complete changelog](CHANGELOG.md) and the
[1.x migration guide](docs/migration.md) for the complete 1.0 transition.

Release maintainers: see the [manual release guide](docs/releasing.md).

## Installation

### Installing Molfeat

Add Molfeat to a uv-managed project:

```bash
uv add molfeat
```

Pip and conda-forge remain supported: `python -m pip install molfeat` or
`mamba install -c conda-forge molfeat`.

The next major release requires Python 3.11 or newer and RDKit 2024.09 or
newer. PyTorch 2.5 or newer is used on maintained platforms; macOS Intel uses
the final available 2.2 wheel series with NumPy 1.26 and is tested on Python 3.12.
On Mac Intel, the `transformer` extra selects Transformers 4.57 rather than 5.
Use safetensors checkpoints there: current Transformers blocks pickle-based
weight loading with PyTorch below 2.6. SAFE's notation core can share this
environment, but its Transformers 5 model/training extras cannot.

### Optional dependencies

Not all featurizers in the Molfeat core package are supported by default. Some featurizers require additional dependencies. If you try to use a featurizer that requires additional dependencies, Molfeat will raise an error and tell you which dependencies are missing and how to install them.

- To install Hugging Face Transformers support: `python -m pip install "molfeat[transformer]"`.
- To convert SELFIES without Transformers: `python -m pip install "molfeat[selfies]"`.
- To install PyTorch Geometric support: `python -m pip install "molfeat[pyg]"`.
- To install FCD support: `python -m pip install "molfeat[fcd]"`.
- To install HDF5 and Parquet cache support: `python -m pip install "molfeat[cache]"`.
- To install S3 and Google Cloud model stores: `python -m pip install "molfeat[cloud]"`.
- To install Mordred descriptors: `python -m pip install "molfeat[mordred]"`.
- To install `map4`: see <https://github.com/reymond-group/map4>

`python -m pip install "molfeat[all]"` installs every maintained optional
dependency compatible with the current interpreter. DGL, DGLLife and the
legacy Graphormer adapter have been removed: their binary and build constraints
conflict with the supported modern stack. PyTorch Geometric is the maintained
graph backend. Protein featurizers have also been removed so Molfeat 1.x has a
precise small-molecule scope. See the [migration guide](docs/migration.md) for
details.

### Compatibility

| Molfeat | Python | RDKit | PyTorch |
| --- | --- | --- | --- |
| `1.x` (development) | `3.11–3.14` | `2024.09+` | `2.5+` (`2.2.x` on macOS Intel) |
| `0.x` | See the release metadata | See the release metadata | See the release metadata |

### Installing Plugins

The functionality of Molfeat can be extended through plugins. The use of a plugin system ensures that the core package remains easy to install and as light as possible, while making it easy to extend its functionality with plug-and-play components. Additionally, it ensures that plugins can be developed independently from the core package, removing the bottleneck of a central party that reviews and approves new plugins. Consult the molfeat documentation for more details on how to [create](docs/developers/create-plugin.md) your own plugins.

However, this does imply that the installation of a plugin is plugin-dependent: please consult the relevant documentation to learn more.

## API tour

```python
import datamol as dm
from molfeat.calc import FPCalculator
from molfeat.trans import MoleculeTransformer
from molfeat.store.modelstore import ModelStore

# Load some dummy data
data = dm.data.freesolv().sample(100).smiles.values

# Featurize a single molecule
calc = FPCalculator("ecfp")
calc(data[0])

# Define a parallelized featurization pipeline
mol_transf = MoleculeTransformer(calc, n_jobs=-1)
mol_transf(data)

# Easily save and load featurizers
mol_transf.to_state_yaml_file("state_dict.yml")
mol_transf = MoleculeTransformer.from_state_yaml_file("state_dict.yml")
mol_transf(data)

# List all available featurizers
store = ModelStore()
store.available_models

# Find a featurizer and learn how to use it
model_card = store.search(name="ChemBERTa-77M-MLM")[0]
model_card.usage()
```

## How to cite

Please cite Molfeat if you use it in your research: [![DOI](https://zenodo.org/badge/613548667.svg)](https://zenodo.org/badge/latestdoi/613548667).

## Contribute

See [developers](docs/developers/) for a comprehensive guide on how to contribute to `molfeat`. `molfeat` is a community-led
initiative and whether you're a first-time contributor or an open-source veteran, this project greatly benefits from your contributions.
To learn more about the community and [datamol.io](https://datamol.io/) ecosystem, please see [community](docs/community/).

## Maintainers

- @cwognum
- @maclandrol
- @hadim

## License

Molfeat's code is licensed under Apache-2.0. See [LICENSE](LICENSE).
The CheMeleon adapter retains the [Chemprop MIT notice](molfeat/data/CHEMPROP_NOTICE).
Distribution metadata records both as `Apache-2.0 AND MIT`; this is not a choice
of licence for Molfeat's own code.
Downloaded model weights and custom Hub code have their own terms; Mol-JEPA
requires explicit acceptance of its non-commercial licence. See the
[model licensing policy](docs/foundation_models.md#third-party-licensing-policy).
