wiki:AddOns

Version 10 (modified by mitar, 2 years ago) (diff)

Add-ons

Structure

Add-on is a  Python package. The structure of an add-ons repository is as follows, package name being a name of a directory of the add-on's Python package, often lowercased addonname:

orange-addonname/
    COPYING
    LICENSE
    setup.py
    docs/
        Makefile
        rst/
            conf.py
            index.rst
    _packagename/
        datasets/
        widgets/
            __init__.py
            ...
        __init__.py
        ...
    src/

docs contains reST documentation of the add-on. src possible contains C/C++ source code. datasets any additional datasets add-on might use.

Package name starts with _ to signify it is for internal use only. Add-ons register through setuptools hook into Orange namespace. Use relative imports to access other modules inside the package, if possible.

setup.py, Makefile, and conf.py as prepared in Biolab's add-ons can be used to get a good starting point for a new add-on.

Hooks

Distribution

Add-ons should be distributed through  PyPi. If done so (and keyword orange add-on is used for the package), they will be displayed among available add-ons on Orange webpage.

Care should be taken that add-ons work also as Python eggs.

Installation

Installation using pip is recommended and should be supported by an add-on. Other way of installing is simply by putting add-on's Python egg into user's add-ons dir (add-ons subdirectory of Orange homedir).