Skip to main content

Control napari via local socket.

Project description

napari-listener

License MIT PyPI tests napari hub

Opens a socket to listen for commands to control napari from other processes. This can be useful for controlling napari programmatically from other applications, or for improving general OS integration (e.g. opening data from a file or UrL in a running instance of napari).


This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.

Installation

You can install napari-listener via pip:

pip install napari-listener

Usage

Once installed, napari-listener can be started from the napari > Plugins > Start Listening menu. You will see a new docked widget that displays the address and port for the listener.

The listener is a TCP server that expects app-model command IDs. It will execute any valid app-model command, but napari-listener registers its own additional commands for demonstration purposes in https://github.com/aganders3/napari-listener/blob/main/src/napari_listener/_actions.py.

You can test napari-listener using a TCP client such as netcat or curl to send an app-model command (and optional args). For example:

% nc 127.0.0.1 40256 <<< "napari:open-file /path/to/local/file"
quick demo of napari-listener

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, "napari-listener" is free and open source software

Issues

If you encounter any problems, please [file an issue] along with a detailed description.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari-listener-0.1.0b1.post1.tar.gz (518.0 kB view details)

Uploaded Source

Built Distribution

napari_listener-0.1.0b1.post1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file napari-listener-0.1.0b1.post1.tar.gz.

File metadata

File hashes

Hashes for napari-listener-0.1.0b1.post1.tar.gz
Algorithm Hash digest
SHA256 4a97878e25ae9862fef8acf90072eb2046035fa110845e5e8f904d76621f50cf
MD5 64c2e60991d6ce7d727de3f39ffb55d0
BLAKE2b-256 55226528b01b40bec1f2b0f7e658f9148bea3b22b2f8f8720ae17b2bcf180b39

See more details on using hashes here.

File details

Details for the file napari_listener-0.1.0b1.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_listener-0.1.0b1.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 603f5827b478586103e3b3c60dee91c344ac78214585219107906d2ae95726f8
MD5 3143f7af036e80ece7c39f04411e4ad7
BLAKE2b-256 18c7660fc4906e3eaebbac8fc2c8730694aa5ad40a99a713cd738b180a3d5637

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page