Metadata-Version: 2.4
Name: patinae
Version: 0.5.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Dist: pytest>=7.0 ; extra == 'dev'
Requires-Dist: numpy>=1.20 ; extra == 'dev'
Requires-Dist: numpy>=1.20 ; extra == 'numpy'
Requires-Dist: anywidget>=0.9 ; extra == 'widget'
Requires-Dist: traitlets>=5.0 ; extra == 'widget'
Requires-Dist: jupyter-ui-poll>=1.1,<2 ; extra == 'widget'
Provides-Extra: dev
Provides-Extra: numpy
Provides-Extra: widget
License-File: LICENSE
Summary: Patinae: Modern molecular visualization in Rust with WebGPU rendering
Keywords: patinae,molecular,visualization,chemistry,biology
Author: Pavel Yakovlev
License: BSD-3-Clause
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/zmactep/patinae
Project-URL: Repository, https://github.com/zmactep/patinae

# Patinae Python Bindings

Python bindings for the Rust/WebGPU molecular visualization workspace.

## Installation

```bash
pip install patinae
```

## Background tasks

Command methods wait for accepted background work by default. Pass `wait=False`
to receive task IDs immediately, then observe or cancel them through `tasks`:

```python
from patinae import cmd, tasks

reply = cmd.fetch("1CRN", wait=False)
task_id = reply["task_ids"][0]
snapshot = tasks.get(task_id)
snapshot = tasks.wait(task_id, timeout=30)
```

`tasks.list(**filters)` lists retained tasks; `tasks.cancel(task_id)` requests
cancellation. A wait timeout does not cancel the task.

## Jupyter Widget

The package includes an [anywidget](https://anywidget.dev/)-based widget for interactive visualization in notebooks. Works in JupyterLab, Jupyter Notebook, VS Code, and Google Colab.

```bash
pip install patinae[widget]
```

```python
from patinae.widget import Viewer

view = Viewer()
view.show()
cmd = view.get_cmd()
cmd.fetch("1CRN")
cmd.show("cartoon")
cmd.color("green", "chain A")
```

Features:
- **Tracked commands** — wait by default; use `wait=False` and `view.tasks` to observe or cancel background work in this viewer
- **Synchronous queries** — request/response channel for commands that return data
- **Local file loading** — load structures from the local filesystem into the browser viewer
- **Picking support** — optional click-to-select atoms (`Viewer(picking=True)`)
- **Configurable layout** — `width` and `height` parameters with sensible defaults

## License

BSD-3-Clause

