Syd

Syd: A package for making interactive data visualizations in python - Published in JOSS (2025)

https://github.com/landoskape/syd

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

data-science data-visualization flask gui interactive-visualizations matplotlib python
Last synced: 4 months ago · JSON representation

Repository

A package to help you share your data by making GUIs the easiest thing in the world!

Basic Info
Statistics
  • Stars: 26
  • Watchers: 2
  • Forks: 0
  • Open Issues: 1
  • Releases: 22
Topics
data-science data-visualization flask gui interactive-visualizations matplotlib python
Created 12 months ago · Last pushed 4 months ago
Metadata Files
Readme Changelog License

README.md

Syd

PyPI version Tests Documentation Status codecov Code style: black DOI

Syd

A package to help you share your data!

Have you ever wanted to look through all your data really quickly interactively? Of course you have. Mo data mo problems, but only if you don't know what to do with it. And that's why Syd stands for show your data!

Syd is a system for creating a data viewing GUI that you can view in a jupyter notebook or in a web browser. And guess what? Since it can open in a web browser, you can even open it on any other computer on your local network! For example, your PI's computer. Gone are the days of single random examples that they make infinitely stubborn conclusions about. Now, you can look at all the examples, quickly and easily, on their computer. And that's why Syd stands for share your data!

Okay, so what is it? Syd is an automated system to convert some basic python plotting code into an interactive GUI. This means you only have to think about what you want to plot and which parameters you want to be interactive. Syd handles all the behind-the-scenes action required to make an interface. And guess what? That means you get to spend your time thinking about your data, rather than writing code to look at it. And that's why Syd stands for Science, Yes! Dayummmm!

Installation

It's easy, just use pip install. The dependencies are light so it should work in most environments. bash pip install syd

Documentation

The full documentation is available here. It includes a quick start guide, a comprehensive tutorial, and an API reference for the different elements of Syd. If you have any questions or want to suggest improvements to the docs, please let us know on the github issues page!

Quick Start

This is an example of a sine wave viewer which is about as simple as it gets. You can choose where you want to display the viewer. If you use viewer.show() then the GUI will deploy as the output of a jupyter cell (this only works in jupyter or colab!). If you use viewer.share() then the GUI will open a page in your default web browser and you can interact with the data there (works in jupyter notebooks and also from python scripts!).

```python import numpy as np import matplotlib.pyplot as plt from syd import make_viewer def plot(state): # Here's a simple plot function that plots a sine wave fig = plt.figure() t = np.linspace(0, 2 * np.pi, 1000) ax = plt.gca() ax.plot(t, state["amplitude"] * np.sin(state["frequency"] * t), color=state["color"]) return fig

viewer = makeviewer(plot) viewer.addfloat("amplitude", value=1.0, min=0.1, max=2.0) viewer.addfloat("frequency", value=1.0, min=0.1, max=5.0) viewer.addselection("color", value="red", options=["red", "blue", "green", "black"])

viewer.show() # for viewing in a jupyter notebook

viewer.share() # for viewing in a web browser

```

Quick Start Viewer

More Examples

We have several examples of more complex viewers with detailed explanations in the comments. Here are the links and descriptions to each of them:

| Example | Description | Try It! | |---------|-------------|---------------| | Basic Tutorial | A good starting point with detailed explanations of how to use the core elements of Syd. | Open In Colab | | Comprehensive | Showcases just about everything you can do with Syd. | Open In Colab | | Making a Viewer Class | Rewrites the comprehensive example as a class, which is useful when you have complex data processing or callbacks. | Open In Colab | | Data Loading | Showcases different ways to get your data into a Syd viewer. | Open In Colab | | Hierarchical Callbacks | Demonstrates how to handle complicated callback situations. | Open In Colab | | Interactive plots with Seaborn | Showcases how to use Syd with Seaborn. | Open In Colab | | Histology Viewer | Showcases how to use Syd to create a histology viewer for viewing histology slides on the fly. | Open In Colab | | Image Labeler | Showcases how to use Syd to create an image labeler for annotating images (like ROIs). | Open In Colab |

Data loading

Thinking about how to get data into a Syd viewer can be non-intuitive. For some examples that showcase different ways to get your data into a Syd viewer, check out the data loading example. Or, if you just want a quick and fast example, check this one out: ```python import numpy as np from matplotlib import pyplot as plt from syd import make_viewer

Suppose you computed some data somewhere (in a script or in a jupyter notebook)

data = np.random.randn(100, 1000)

When you write a plot function like this, it'll be able to access the data variable

def plot(state): fig = plt.figure() ax = fig.add_subplot(111)

# plot indexes to the data that you created outside the plot function
ax.imshow(data[state["index"]])
return fig

Since plot "knows" about the data variable, all you need to do is pass the plot

function to the syd viewer and it'll be able to access the data once deployed!

viewer = make_viewer(plot) viewer.show() ```

Handling Hierarchical Callbacks

Syd dramatically reduces the amount of work you need to do to build a GUI for viewing your data. However, it can still be a bit complicated to think about callbacks. Below is a quick demonstration. To try it yourself, check out the full example here or open it in colab Open In Colab.

For example, suppose your dataset is composed of electrophysiology recordings from 3 mice, where each mouse has a different number of sesssions, and each session has a different number of neurons. You want to build a viewer to view a particular neuron from a particular session from a particular mouse. But the viewer will break if you try to index to session 5 for mouse 2 when mouse 2 has less than 5 sessions!

This is where hierarchical callbacks come in. There's a straightforward pattern to handling this kind of situation that you can follow. You can write a callback for each level of the hierarchy. Then, each callback can update the state and call the next callback in the hierarchy once it's finished. It looks like this: ```python import numpy as np from syd import Viewer # Much easier to build a Viewer class for hierarchical callbacks

class MouseViewer(Viewer): def init(self, micenames): self.micenames = mice_names

    self.add_selection("mouse", options=list(mice_names))

    # We don't know how many sessions or neurons to pick from yet,
    # so just set the max to 1 for now.
    self.add_integer("session", min=0, max=1)
    self.add_integer("neuron", min=0, max=1)

    # Any time the mouse changes, update the sessions to pick from!
    self.on_change("mouse", self.update_mouse)

    # Any time the session changes, update the neurons to pick from!
    self.on_change("session", self.update_session)

    # Since we built callbacks for setting the range of the session
    # and neuron parameters, we can use them here so the viewer is
    # fully ready and up to date.

    # To get the state, use self.state, which is the current
    # state of the viewer (in the init function, it'll just be the
    # default value for each parameter you've added already).
    self.update_mouse(self.state)

def update_mouse(self, state):
    # Pseudo code for getting the number of sessions for a given mouse
    num_sessions = get_num_sessions(state["mouse"])

    # Now we update the number of sessions to pick from
    self.update_integer("session", max=num_sessions - 1)

    # Now we need to update the neurons to choose from ....

    # But! Updating the session parameter's max value might trigger a change
    # to the current session value. This ~won't be reflected~ in the state 
    # dictionary that was passed to this function.

    # So, we need to load the ~NEW~ state dictionary, which is always 
    # accessible as self.state (or viewer.state if you're not using a class).
    new_state = self.state

    # Then perform the session update callback!
    self.update_session(new_state)

def update_session(self, state):
    # Pseudo code for getting the number of neurons for a given mouse and session
    num_neurons = get_num_neurons(state["mouse"], state["session"])

    # Now we update the number of neurons to pick from
    self.update_integer("neuron", max=num_neurons - 1)

def plot(self, state):
    # Pseudo code for plotting the data
    data = get_data(state["mouse"], state["session"], state["neuron"])
    fig = plot_the_data(data)
    return fig

Now we can create a viewer and deploy it

viewer = MouseViewer(["Mouse 1", "Mouse 2", "Mouse 3"]) viewer.show() ```

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! If you have an idea for an improvement or a bug report, please let us know by opening an issue on the github issues page. You can also contribute code by submitting a pull request. Here are some guidelines for contributing:

1. Reporting Bugs

If you find a bug, (e.g. any error or strange behavior that is not expected), please let us know by opening an issue on the github issues page.

2. Suggesting Features

If you have an idea for a feature or improvement, please let tell us. Opening an issue on the github issues page.

3. Improvements to the Documentation

A package is only as good as its documentation. If you think the documentation is missing something, confusing, or could be improved in any way, please let us know by opening an issue on the github issues page.

4. Contributing Code

If you want to contribute code (good for you!), here's how you can do it:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run the tests (pytest)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request online

Please make sure to update tests as appropriate and adhere to the existing coding style (black, line-length=88, other style guidelines not capture by black, generally following pep8 guidelines). Try to make the code coverage report improve or stay the same rather than decrease (right now the deployment system isn't covered by tests). There aren't any precommit hooks or anything so you're responsible for checking this yourself. You can process the code with black as follows: bash pip install black black . # from the root directory of the repo

Citing this package

If you use this package, let us know! It's made to help the community so we're happy to hear about how this has helped (or any suggestions!). If you publish anything that depended on Syd, we'd appreciate if you cite the JOSS paper:

Landau, A., (2025). Syd: A package for making interactive data visualizations in python. Journal of Open Source Software, 10(112), 8447, https://doi.org/10.21105/joss.08447

Owner

  • Name: Andrew Landau
  • Login: landoskape
  • Kind: user
  • Location: London, UK
  • Company: University College London

I do neuroscience research

JOSS Publication

Syd: A package for making interactive data visualizations in python
Published
August 28, 2025
Volume 10, Issue 112, Page 8447
Authors
Andrew T. Landau ORCID
UCL Queen Square Institute of Neurology, University College London, London, United Kingdom
Editor
Andrew Stewart ORCID
Tags
neuroscience data-science data-visualization interactive

GitHub Events

Total
  • Create event: 17
  • Issues event: 4
  • Release event: 15
  • Watch event: 19
  • Delete event: 7
  • Issue comment event: 10
  • Public event: 1
  • Push event: 148
  • Pull request event: 14
Last Year
  • Create event: 17
  • Issues event: 4
  • Release event: 15
  • Watch event: 19
  • Delete event: 7
  • Issue comment event: 10
  • Public event: 1
  • Push event: 148
  • Pull request event: 14

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 102
  • Total Committers: 1
  • Avg Commits per committer: 102.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 102
  • Committers: 1
  • Avg Commits per committer: 102.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Andrew Landau a****u@g****m 102

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 3
  • Total pull requests: 19
  • Average time to close issues: 22 days
  • Average time to close pull requests: 1 minute
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 1.67
  • Average comments per pull request: 0.32
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 19
  • Average time to close issues: 22 days
  • Average time to close pull requests: 1 minute
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 1.67
  • Average comments per pull request: 0.32
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • landoskape (2)
  • ZeitgeberH (1)
Pull Request Authors
  • landoskape (19)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 80 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 21
  • Total maintainers: 1
pypi.org: syd

A Python package for making GUIs for data science easy.

  • Versions: 21
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 80 Last month
Rankings
Dependent packages count: 10.0%
Average: 15.9%
Dependent repos count: 21.7%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/release.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
.github/workflows/tests.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v5 composite
docs/requirements.txt pypi
  • sphinx >=4.0.0
  • sphinx-autodoc-typehints >=1.12.0
  • sphinx-rtd-theme >=1.0.0
pyproject.toml pypi
  • ipywidgets *
  • matplotlib *