Metadata-Version: 2.4
Name: cap-auto
Version: 0.1.1
Summary: Automation tools for Rigaku CrysAlisPro listen mode
Author-email: Robert Buecker <robert.buecker@rigaku.com>
License: BSD-3-Clause
Project-URL: Homepage, https://github.com/robertbuecker/cap-auto
Project-URL: Repository, https://github.com/robertbuecker/cap-auto
Project-URL: Issues, https://github.com/robertbuecker/cap-auto/issues
Keywords: crystallography,crysalispro,automation,rigaku,microed
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: Microsoft :: Windows
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 :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Chemistry
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pywin32>=300; platform_system == "Windows"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: flake8>=4.0.0; extra == "dev"
Dynamic: license-file

# CAP Automation for CrysAlisPro

`cap-auto` now contains only the CrysAlisPro automation tooling.

The native `.rodhypix` reader was split into a standalone package:

- Old import: `from cap_auto.rod_image_reader import ...`
- New import: `from rodhypix import ...`

## Scope

This package provides:

- `CAPInstance` for CAP listen mode control
- CAP command execution, batching, and macro helpers
- Log capture and error/warning parsing
- Native Windows directory monitoring via `pywin32`
- Optional socket server support for remote control

## Installation

```bash
pip install cap-auto
```

`cap-auto` is Windows-focused and expects a local CrysAlisPro installation.

## Quick Start

```python
from cap_auto.cap_control import CAPInstance

with CAPInstance() as cap:
    result = cap.execute("dc proffit")
    print(result.success)
    print(result.execution_time)
```

## Core Usage

### Execute one command

```python
cap = CAPInstance(start_now=True)
result = cap.execute("dc proffit")
cap.stop()
```

### Execute multiple commands

```python
cap = CAPInstance(start_now=True)

results = cap.execute_batch([
    "gt o 0",
    "gt k 90",
    "gt p 0",
])

macro_result = cap.execute_macro([
    "dc proffit",
    "dc rrp",
    "xx saveub",
])

cap.stop()
```

### Process several experiments

```python
cap = CAPInstance(start_now=True)

results = cap.execute_on_multiple_experiments(
    commands=["dc proffit", "dc rrp"],
    par_files=["exp1.par", "exp2.par", "exp3.par"],
    use_macro=True,
)

cap.stop()
```

## Examples

The root `examples/` directory now contains only CAP automation material.

- `examples/02_cap_automation.ipynb`
- `examples.py`
- `cap_server_gui.py`
- `cap_client_gui.py`

The reader notebook and benchmark moved into the standalone `rodhypix` tree in this workspace.

## Project Layout

- `cap_auto/cap_control.py`: CAP automation API
- `examples/02_cap_automation.ipynb`: CAP notebook
- `QUICKREF.md`: compact API cheatsheet

## Related Package

The extracted reader package lives under [rodhypix](./rodhypix) in this workspace and is intended to become its own repository and distribution.
