Metadata-Version: 2.4
Name: anywave-plugin-api
Version: 1.2.0
Summary: AnyWave package to use with Python plugins.
Home-page: https://dynamap-gitlab.ins-amu.fr/anywave/python-api
Author: Bruno Colombet
Author-email: bruno.colombet@univ-amu.fr
License: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python

# AnyWave Package

This is the anywave package to use with Python plugins.

Add this package to your python environment to be able to develop Python plugins for AnyWave.

## Functions

| function | what it does |
|---|---|
| `init(argv)` | connects to AnyWave and returns the settings of the plugin (call it first) |
| `debug_connect(port)` | connects to an AnyWave started with `--plugin_debug --server_port <port>` |
| `get_data(args)` | requests data: channels, time selections, filters... |
| `get_markers(args)` / `send_markers(markers)` | reads / adds markers |
| `send_message(text)` | writes a text in the AnyWave log |
| `get_props()` | reads the settings of the plugin again |
| `change_sig_prop(cfg)` | changes the color and/or the filters (`hp`, `lp`, `notch`) of channels |
| `ica_command(cfg)` | rejects (`'reject'`, default) or restores (`'undo'`) independent components |
| `run(args)` | runs another plugin |

```python
import sys
import anywave

anywave.init(sys.argv)

# green trace and a 1-80 Hz filter for channels A1 and A4
anywave.change_sig_prop({'labels': ['A1', 'A4'], 'color': '#008800', 'hp': 1, 'lp': 80})

# reject two components of the ICA loaded in AnyWave, then restore one of them
anywave.ica_command({'labels': ['M_IC10', 'M_IC15'], 'command': 'reject'})
anywave.ica_command({'labels': ['M_IC15'], 'command': 'undo'})
```

An error of AnyWave (missing `labels`, unknown `command`...) is raised as an exception with the message of AnyWave.
