Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D Documentation
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • anywave
  • Documentation
  • Wiki
  • Write Python Plugin

Write Python Plugin · Changes

Page history
Update Write Python Plugin authored Jul 23, 2025 by Bruno Colombet's avatar Bruno Colombet
Hide whitespace changes
Inline Side-by-side
Showing with 56 additions and 40 deletions
+56 -40
  • Write-Python-Plugin.md Write-Python-Plugin.md +56 -40
  • No files found.
Write-Python-Plugin.md
View page @ 53b8a850
[[_TOC_]] * [Requirements](#requirements)
* [anywave package](#anywave-package)
* [Use the Plugin Creation Assistant](#use-the-plugin-creation-assistant)
* [What is a Plugin?](#what-is-a-plugin)
* [desc.txt](#desctxt)
* [optional lines](#optional-lines)
* [main.py](#mainpy)
* [DEBUG Python plugin](#debug-python-plugin)
* [Python API package](#python-api-package)
A Python plugin is a folder located in the user home dir. A Python plugin is a folder located in the user home dir.\
Documents\AnyWave\Plugins\Python on Windows. Documents\\AnyWave\\Plugins\\Python on Windows.\
/home/username/AnyWave/Plugins/Python on Linux. /home/username/AnyWave/Plugins/Python on Linux.\
/users/username/AnyWave/Plugins/Python on macOS. /users/username/AnyWave/Plugins/Python on macOS.
# Requirements # Requirements
A python local installation or a virtual environment located in the AnyWave/Plugins/Python/venv folder.
The Plugins/Python/venv folder is created the first time AnyWave is launched. A python local installation or a virtual environment located in the AnyWave/Plugins/Python/venv folder.\
A good practice is to create it using the classic python -m venv command The Plugins/Python/venv folder is created the first time AnyWave is launched.\
Place the venv in the folder mentioned earlier and AnyWave will detect it when starting. A good practice is to create it using the classic python -m venv command\
Place the venv in the folder mentioned earlier and AnyWave will detect it when starting.
## anywave package ## anywave package
The virtual environment must have the anywave-plugin-api package.
````python The virtual environment must have the anywave-plugin-api package.
```python
pip install anywave-plugin-api pip install anywave-plugin-api
```` ```
# Use the Plugin Creation Assistant # Use the Plugin Creation Assistant
![image](uploads/12aad30a7717996badcb3010e0298f72/image.png)
![image](uploads/23e581415d4eb9424cb054041ccf3fce/image.png) ![image](/anywave/documentation/-/wikis/uploads/12aad30a7717996badcb3010e0298f72/image.png)
![image](/anywave/documentation/-/wikis/uploads/23e581415d4eb9424cb054041ccf3fce/image.png)
Change MATLAB option to Python! Change MATLAB option to Python!
# What is a Plugin? # What is a Plugin?
It's a folder placed on Plugins/Python subfolders of AnyWave.
When AnyWave starts the first time it creates a folder named AnyWave in the user's home directory. It's a folder placed on Plugins/Python subfolders of AnyWave.\
In the AnyWave folder you will find a Plugins\MATLAB folder. When AnyWave starts the first time it creates a folder named AnyWave in the user's home directory.\
Create a directory for you plugin in that location or use the Plugin Creation Assistant (see previous section). In the AnyWave folder you will find a Plugins\\MATLAB folder.\
Create a directory for you plugin in that location or use the Plugin Creation Assistant (see previous section).
## desc.txt ## desc.txt
A file called desct.txt must be put in your Plugin.
This file is a simple text file that must contain the following lines: A file called desct.txt must be put in your Plugin.\
*name = My Plugin* This file is a simple text file that must contain the following lines:\
*description = Do something on data* _name = My Plugin_\
When using the Plugin Creation Assistant, the file is created for you. _description = Do something on data_\
When using the Plugin Creation Assistant, the file is created for you.
### optional lines ### optional lines
To tune up the behavior of your plugin you may add some flags to tell AnyWave what you plugin can do:
*flags=nodatarequired* -> this line will inform anywave that your plugin can run even if no data file is open. To tune up the behavior of your plugin you may add some flags to tell AnyWave what you plugin can do:\
*flags=canrunfromcommandline* -> this flag indicates that your plugin can be run from the command line. _flags=nodatarequired_ -> this line will inform anywave that your plugin can run even if no data file is open.\
You can combine flags by separating them with a colon (:) _flags=canrunfromcommandline_ -> this flag indicates that your plugin can be run from the command line.\
You can combine flags by separating them with a colon (:)\
flags=nodatarequired:canrunfromcommandline flags=nodatarequired:canrunfromcommandline
Put your plugin in a submenu, by adding the following line: Put your plugin in a submenu, by adding the following line:\
*category=Process:MyCategory:My plugin* _category=Process:MyCategory:My plugin_\
This line will create a sub menu called MyCategory in the Processes Menu of AnyWave and a link to launch the plugin. This line will create a sub menu called MyCategory in the Processes Menu of AnyWave and a link to launch the plugin.
## **__main__**.py
## ____main____.py A filed called __**main__**.py must also be put in your Plugin.\
A filed called ____main____.py must also be put in your Plugin. This file along with desc.txt file will make your folder an AnyWave Python plugin.\
This file along with desc.txt file will make your folder an AnyWave Python plugin. When using the Plugin Creation Assistant, the file is created for you.\
When using the Plugin Creation Assistant, the file is created for you.
The file must look like: The file must look like:
````python
```python
import sys import sys
import anywave as aw import anywave as aw
aw.init(sys.argv) aw.init(sys.argv)
args = aw.get_props() args = aw.get_props()
```` ```
args is a dict containing all the properties related to AnyWave current data file and the plugin context.
args is a dict containing all the properties related to AnyWave current data file and the plugin context.
## [DEBUG Python plugin](/anywave/documentation/-/wikis/Python_debug) ## [DEBUG Python plugin](/anywave/documentation/-/wikis/Python_debug)
......
Clone repository
  • Build_AnyWave
  • CLI
  • CLI_List
  • Changes
  • ExportData
  • ICA
  • Imaginary Coherence
  • MATLAB anywave function
  • MATLAB_BIDS
  • MATLAB_change_sig_prop
  • MATLAB_debug
  • MATLAB_get_data
  • MATLAB_get_markers
  • MATLAB_get_props
  • MATLAB_init
View All Pages