Metadata-Version: 2.4
Name: streamlit-chem
Version: 0.1.0
Summary: Native, RDKit-powered chemistry for Streamlit
Author-email: Rishi Gurnani <rgurnani96@gmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/rishigurnani/streamlit-chem
Project-URL: Source Code, https://github.com/rishigurnani/streamlit-chem
Project-URL: Bug Tracker, https://github.com/rishigurnani/streamlit-chem/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
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: Topic :: Database :: Front-Ends
Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Widget Sets
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: altair!=5.4.0,!=5.4.1,<7,>=5.0.0
Requires-Dist: blinker<2,>=1.5.0
Requires-Dist: click<9,>=7.0
Requires-Dist: numpy<3,>=1.23
Requires-Dist: packaging>=20
Requires-Dist: pandas<4,>=1.4.0
Requires-Dist: pillow<13,>=7.1.0
Requires-Dist: pydeck<1,>=0.8.0b4
Requires-Dist: protobuf<8,>=5.26.1
Requires-Dist: pyarrow<25,>=7.0
Requires-Dist: rdkit>=2023.3
Requires-Dist: requests<3,>=2.27
Requires-Dist: tenacity<10,>=8.1.0
Requires-Dist: toml<2,>=0.10.1
Requires-Dist: typing-extensions<5,>=4.10.0
Requires-Dist: starlette<2,>=0.46.0
Requires-Dist: uvicorn<1,>=0.30.0
Requires-Dist: httptools<1,>=0.6.3
Requires-Dist: anyio<5,>=4.0.0
Requires-Dist: python-multipart<1,>=0.0.10
Requires-Dist: websockets<17,>=12.0.0
Requires-Dist: itsdangerous<3,>=2.1.2
Requires-Dist: watchdog<7,>=2.1.5; platform_system != "Darwin"
Provides-Extra: snowflake
Requires-Dist: snowflake-snowpark-python[modin]>=1.17.0; extra == "snowflake"
Requires-Dist: snowflake-connector-python>=3.3.0; extra == "snowflake"
Provides-Extra: pdf
Requires-Dist: streamlit-pdf>=1.0.0; extra == "pdf"
Provides-Extra: auth
Requires-Dist: Authlib>=1.3.2; extra == "auth"
Requires-Dist: httpx>=0.24.1; extra == "auth"
Provides-Extra: charts
Requires-Dist: matplotlib>=3.0.0; extra == "charts"
Requires-Dist: graphviz>=0.19.0; extra == "charts"
Requires-Dist: plotly>=4.0.0; extra == "charts"
Requires-Dist: orjson>=3.5.0; extra == "charts"
Provides-Extra: sql
Requires-Dist: SQLAlchemy>=2.0.0; extra == "sql"
Provides-Extra: performance
Requires-Dist: orjson>=3.5.0; extra == "performance"
Requires-Dist: uvloop>=0.15.2; (sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy") and extra == "performance"
Provides-Extra: all
Requires-Dist: streamlit-chem[auth,charts,pdf,performance,snowflake,sql]; extra == "all"
Requires-Dist: rich>=11.0.0; extra == "all"

# 🧪 streamlit-chem

[![GitHub][github_badge]][github_link] [![PyPI][pypi_badge]][pypi_link]

> Native, RDKit-powered chemistry for Streamlit. Render, edit, and analyze molecules with first-class `st.*` commands — no iframes, no custom components, and no pickling foot-guns.

It leverages [RDKit](https://www.rdkit.org/) as its cheminformatics engine. Structures are rendered server-side to sanitized SVG, so molecules travel straight from Python to the browser — there is no browser-side RDKit to ship.

## Installation

```shell
pip install streamlit-chem
```

`streamlit-chem` is import-compatible with Streamlit: install it and every chemical command below is available on the `st.*` namespace alongside the full Streamlit API.

## Getting started

```python
import streamlit as st

st.molecule(
    "CC(=O)Oc1ccccc1C(=O)O",
    caption="Aspirin",
    highlight_substructure="c1ccccc1",
)
```

Pass a SMILES string or an `rdkit.Chem.Mol` — both just work.

## Chemical elements

| Command | Description |
| --- | --- |
| `st.molecule` | Render a molecule as a native 2D structure, with optional substructure highlighting. |
| `st.chem_dataframe` | A chemistry-aware `st.dataframe`: a molecule column renders as 2D structures, everything else behaves like a normal dataframe. |
| `st.smarts_input` | A `st.text_input` that validates a SMARTS/SMILES substructure query with RDKit as you type. |
| `st.mol_card` | A compact summary card: structure + physicochemical metrics + a Lipinski rule-of-five badge. |
| `st.chem_draw` | An interactive 2D editor (Ketcher) that returns the drawn structure as an `rdkit.Chem.Mol`. |
| `st.mol_viewer` | An interactive 3D viewer (3Dmol.js) from a server-side RDKit conformer, returning atom/bond clicks. |
| `st.chem_space` | Project a molecule library to a 2D map (fingerprints → PCA/t-SNE/UMAP) and lasso-select points. |
| `st.r_group_decomposition` | Decompose a series around a shared core into a table of rendered core and R-group structures. |

Molecules are also safe to cache — `@st.cache_data` serializes `rdkit.Chem.Mol` objects transparently.

## Demo

A gallery showcasing every element lives in [`demo_molecule.py`](demo_molecule.py):

```shell
streamlit run demo_molecule.py
```

[github_badge]: https://badgen.net/badge/icon/GitHub?icon=github&color=black&label
[github_link]: https://github.com/rishigurnani/ChemLit
[pypi_badge]: https://badgen.net/pypi/v/streamlit-chem?icon=pypi&color=black&label
[pypi_link]: https://pypi.org/project/streamlit-chem
