Metadata-Version: 2.4
Name: x-chemviz-utils
Version: 0.1.3
Summary: Render MOL data as PDB and SVG fields.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: loguru>=0.6
Requires-Dist: numpy>=1.23
Requires-Dist: Pillow>=9.0
Requires-Dist: playwright==1.61.0
Requires-Dist: rdkit>=2022.9

# x-chemviz-utils

Render MOL data as PDB and SVG fields.

## Environment setup

Python 3.10 or newer is required. Create and activate a virtual environment before installing the package:

```bash
python -m venv .venv

# Windows PowerShell
.venv\Scripts\Activate.ps1

# macOS/Linux
source .venv/bin/activate
```

### Conda

```bash
conda create -n x-chemviz-utils python=3.12
conda activate x-chemviz-utils
```

## Install

```bash
python -m pip install --upgrade pip
pip install x-chemviz-utils

# Upgrade to the latest release
pip install --upgrade x-chemviz-utils
```

`x-chemviz-utils` runtime dependencies: `loguru`, `numpy`, `Pillow`, `playwright`, `rdkit`.

## Usage

```python
from chemviz_mol_renderer import render_mol

result = render_mol(mol_data)
# {"pdb": str | None, "svg": str | None}
```

`mol_data` accepts an RDKit `Chem.Mol`, MOL/SMILES text, a MOL/SDF file path, or a readable text/binary file object. Real non-coplanar 3D structures return PDB plus an SVG containing the Miew default-frame image. Other structures return `pdb=None` and the RDKit SVG rendering.

The package includes the Miew assets. Playwright and Chromium are prepared automatically for the first 3D render, so no Node.js, npm, or manual browser setup is required.
