Metadata-Version: 2.4
Name: msw-plugin-api
Version: 0.2.2
Summary: Minimal structural interfaces for MSW plugin packages
Project-URL: Homepage, https://github.com/MurineShiftWork/msw-plugin-api
Project-URL: Issue Tracker, https://github.com/MurineShiftWork/msw-plugin-api/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
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: Free for non-commercial use
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: commitizen; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# msw-plugin-api

Minimal structural interfaces for [MurineShiftWork](https://github.com/MurineShiftWork/murineshiftwork) plugin packages.

Zero dependencies (stdlib `typing` and `dataclasses` only). Provides:

- `HostSessionInfo` — concrete dataclass plugins return after attaching
- `HostSessionInfoProtocol` — `runtime_checkable` Protocol for structural typing
- `HostSessionProtocol` — `runtime_checkable` Protocol for host session plugins

## Usage

```python
from msw_plugin_api import HostSessionInfo, HostSessionProtocol

class MyHostSession:
    def attach(self, **kwargs) -> HostSessionInfo:
        return HostSessionInfo(
            backend="myplugin",
            acquisition_name="subject__20260609_143022__ext",
            subject="subject",
            parent_directory="/data/recordings",
        )

    def start(self) -> None: ...
    def stop(self) -> None: ...
```

Declare the plugin entry point in `pyproject.toml`:

```toml
[project.entry-points."msw.host"]
myplugin = "my_package.session:MyHostSession"
```

## Plugin contract

MSW core checks `isinstance(session, HostSessionProtocol)` at dispatch time.
Plugins may implement the interface structurally (without importing this package)
or depend on `msw-plugin-api` explicitly for IDE support and test conformance checks.
