Foxglove WebSocket server
Project description
Foxglove WebSocket server
This package provides a server implementation of the Foxglove WebSocket protocol with examples. The protocol enables Foxglove Studio to ingest arbitrary “live” streamed data.
Installation
$ pip install foxglove-websocket
Example servers
This package includes example servers demonstrating how to use JSON and Protobuf data. To install additional dependencies required for the examples, run:
$ pip install 'foxglove-websocket[examples]'
Run a simple example server that publishes messages on a single example_msg
topic:
-
JSON server – Uses JSON to encode message data and JSON Schema to describe the message layout.
python -m foxglove_websocket.examples.json_server
-
Protobuf server – Uses Protobuf to encode message data.
python -m foxglove_websocket.examples.protobuf_server
Note: You must exit each server (control + c) before starting up another.
To see data from any server, open Foxglove Studio with a Foxglove WebSocket connection to ws://localhost:8765/
:
To customize each server for your specifications, copy either server into a separate file like server.py
and make the desired adjustments to this template. Start up your server from the command line, using python3 server.py
.
Multi-threaded usage
The threaded_server
example demonstrates how to use the FoxgloveServer
class in a thread-safe way when interacting with a threaded middleware. Run the server using:
python -m foxglove_websocket.examples.threaded_server
When connected to the server in Foxglove Studio, use the Data Source Info panel to see channels appearing and disappearing, and a Plot panel to visualize data on each channel.
For a more detailed explanation, read the example's source code.
Development
When developing or maintaining the foxglove-websocket
package, it is recommended to use pipenv
to manage development dependencies and virtualenv
.
pipenv install --dev
– Create avirtualenv
and install development dependenciespipenv shell
– Enter thevirtualenv
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file foxglove-websocket-0.1.2.tar.gz
.
File metadata
- Download URL: foxglove-websocket-0.1.2.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26bc61e026d9f2b6f0fe34df6a798ce95e453cdce5565b730e0591ac1f52fdcb |
|
MD5 | 5baab6fabbfabdf6a849e268530087eb |
|
BLAKE2b-256 | 3663b747abdcaa1c97f725292920ebb5dc0da04f0e25472a3a3ec6f529093d7a |
File details
Details for the file foxglove_websocket-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: foxglove_websocket-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a231f90ee1ec08c2f6b302270bf45998cc125fb0b16e170a3ea6d1b8b559d1e |
|
MD5 | 994e2c4c63936e46c7f3acb342602346 |
|
BLAKE2b-256 | 0e892ee40e7d287dee8f0fd5f7b5b59b7ee5e663174cbe9ef568a1506dd7e7c5 |