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.tar.gz (517.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: napari-listener-0.1.0b1.tar.gz
  • Upload date:
  • Size: 517.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for napari-listener-0.1.0b1.tar.gz
Algorithm Hash digest
SHA256 d8ba44859d2212a5901151710dd7512135fdb62e6d40619f763f2d1c56d3de9b
MD5 17fac643ce5e0638c890942b8294791f
BLAKE2b-256 28d505d928826a97d8d81f9c813ee0fc595ebd4204310cfe23996e3d9a7e87d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for napari_listener-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9df988535b0f2ffebdf3ccdf60f33db371c5aceae7d046baa34d368f91e97be
MD5 037349e455dedadb56cdda599f760d9e
BLAKE2b-256 0952a9fe0904236a9ce88da6ac9f8bee20ae396e1f4195170a560f990a2738e1

See more details on using hashes here.

Supported by

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