Metadata-Version: 2.4
Name: msw-open-ephys
Version: 3.3.1
Summary: Remote control for Open Ephys GUI v1+ — session naming and recording management
Project-URL: Homepage, https://github.com/murineshiftwork/msw-open-ephys
Project-URL: Issue Tracker, https://github.com/murineshiftwork/msw-open-ephys/issues
Author-email: "Lars B. Rollik" <lars@rollik.me>
License: Copyright (c) 2024-present Lars B. Rollik. All rights reserved.
        
        Permission is granted, free of charge, to use, copy, modify, and distribute
        this software and associated documentation files (the "Software") for
        non-commercial research or academic purposes only, subject to the following
        conditions:
        
        1. This copyright notice and permission notice must be included in all copies
           or substantial portions of the Software.
        
        2. Any publication, presentation, or product that uses or builds upon the
           Software must give clear attribution to the original work and its authors.
        
        3. Commercial use is prohibited without a separate written commercial licence
           agreement with the copyright holder. Commercial use means incorporation of
           the Software into anything for which fees or other compensation are charged
           or received, including commercial products and commercial services.
        
        4. No patent licence, express or implied, is granted under these terms. Any
           use that would require a patent licence from the copyright holder requires
           a separate written agreement.
        
        5. Redistribution, in source or binary form, is permitted only for
           non-commercial purposes and must retain this notice unmodified.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
        DAMAGES, OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE
        SOFTWARE OR THE USE OR DEALINGS IN THE SOFTWARE.
        
        For commercial or patent licensing enquiries contact: lars@rollik.me
License-File: LICENSE
Keywords: electrophysiology,neuroscience,open-ephys,recording,remote-control
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: Free for non-commercial use
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.11
Requires-Dist: msw-io>=1.2.0
Requires-Dist: msw-plugin-api>=0.2.0
Requires-Dist: requests
Requires-Dist: rich
Provides-Extra: dev
Requires-Dist: commitizen; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs; extra == 'docs'
Requires-Dist: mkdocs-material; extra == 'docs'
Requires-Dist: mkdocstrings[python]; extra == 'docs'
Description-Content-Type: text/markdown

# msw-open-ephys

Remote control for [Open Ephys GUI](https://open-ephys.org/gui) v1+ — session naming, recording management, and metadata writing for MSW acquisition workflows.

## Install

```bash
pip install msw-open-ephys
```

Or editable from the repo:

```bash
pip install -e external/msw-open-ephys
```

## CLI

```
oe-remote status   --remote-ip 10.0.10.111
oe-remote preview  --remote-ip 10.0.10.111
oe-remote record   --remote-ip 10.0.10.111 --subject m1099 \
                   --acquisition-extension ephys_multi_behavior \
                   --session-extension pxi
oe-remote record   --remote-ip 10.0.10.111 --subject m1099 \
                   --session-extension intan_ttl --child @last
oe-remote stop     --remote-ip 10.0.10.111
```

### Session modes

| Mode | When | OE records to |
|---|---|---|
| Standalone | no `--acquisition-extension`, no `--child` | `remote/{subject}/{subject__dt__session}/` |
| Parent | `--acquisition-extension` set | `remote/{subject}/{subject__dt__acq}/{subject__dt__session}/` |
| Child | `--child ACQ_PATH` or `--child @last` | `remote/{acq_path}/{subject__dt__session}/` |

`--child @last` reuses the acquisition path cached by the most recent parent or record command.

## Python API

```python
from msw_open_ephys.controller import OEController
from msw_open_ephys.session import Session

oe = OEController(ip="10.0.10.111")
oe.preview()
oe.configure_recording(parent_directory=r"E:\OE_DATA", base_text="m1099/acq/session")
oe.record()
```

## Integration with MSW

`msw run --parent openephys` calls the OE REST API directly via `murineshiftwork.hardware.parent_session` (uses `open-ephys-python-tools`, not this package). This package provides the **`oe-remote` CLI** used to start the acquisition side before launching MSW tasks.

Set `open_ephys_url` in the setup YAML so MSW can attach automatically:

```yaml
# msw_configs/setups/setup-npxb.yaml
open_ephys_url: 10.0.10.111
```
