Skip to main content

PyPI PyPI - Python Version PyPI - Status License CI codecov Documentation uv Ruff Checked with mypy Conventional Commits

redsun

A component-based, customizable application framework for scientific hardware orchestration, based on the Bluesky framework.

To learn redsun, start with the tutorials. They build one application step by step, and need no hardware.

Problem statement

In scientific research involving device control, one of the major problems is orchestrating different hardware units to achieve reusable, reliable and documentable workflows. On top of that, such hardware orchestration should provide a coherent and understandable user interface that less technical inclined users are able to understand and leverage accurately.

This proves challenging, because making experiments is a fluid endevour. It's hard (next to impossible) to predict what are the actual final requirements a software should encapsulate, especially if the final output is to face this to scientists with no engineering background.

Rather than trying to ship an entire software on its own, redsun follows the idea of component-based development: ship off-the-shelf components, assemble and wire them depending on the needs.

Component-based development (CBD)

In CBD, interfaces are key. Each component express what it requires to be built, as well as offering functionalities that can be leveraged by other components.

Components are put together in a session, which builds the application for you, so you can focus on what each component does.

from collections.abc import Iterator
from typing import Annotated

from mylab.devices import MyMotor
from mylab.presenters import MyController
from mylab.views import MyView

from redsun import AsDevice, AsPresenter, AsView, Declare, Link
from redsun.qt import QtSession


class MyApp(QtSession):
    stage: Annotated[AsDevice[MyMotor], Declare(axis=["X", "Y"], egu="mm")]
    ctrl: Annotated[AsPresenter[MyController], Declare(timeout=2.0)]
    panel: AsView[MyView]

    def wire(self) -> Iterator[Link]:
        yield self.ctrl.sig_position_changed, self.panel.update_position


MyApp({"session": "my-session"}).run()

Each component is declared once, with the arguments it needs. wire says which signal reaches which slot; the session builds everything in order and connects it.

redsun provides the common glue code that each component can use to ship entire applications or single, reusable components. Leveraging Python entry points, an application can also be shipped as a single YAML configuration file, provided that different contributing components expose a redsun.yaml manifest.

So the same application can be expressed as:

# session.yaml
schema_version: 1.0
frontend: qt
session: my-session

devices:
  stage:
    plugin_name: mylab
    plugin_id: my_motor
    axis: ["X", "Y"]
    egu: mm

presenters:
  ctrl:
    plugin_name: mylab
    plugin_id: my_controller
    timeout: 2.0

views:
  panel:
    plugin_name: mylab
    plugin_id: my_view

wiring:
  ctrl.sig_position_changed: panel.update_position

plugin_id is resolved through the manifest the contributing package ships:

# mylab/redsun.yaml
devices:
  my_motor: mylab.devices:MyMotor
presenters:
  my_controller: mylab.presenters:MyController
views:
  my_view: mylab.views:MyView

Launch it with:

from redsun import Session

Session.from_config("session.yaml").run()

Session architecture

Each redsun session is structured as a Device-View-Presenter (DVP) application. This resembles the Model-View-Presenter (MVP) architecture, with the difference that at the lower level of the application sits the Device layer, leveraging ophyd-async, to interact with hardware components.

This is to make a clear statement: redsun is primarely about device control, and tries to do it well.

Documentation

See the documentation for more informations.

License

redsun is released under license Apache 2.0.

See the license for further details.

Metadata

Release files for redsun 0.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redsun 0.14.0
File Size Uploaded
redsun-0.14.0.tar.gz 134.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for redsun 0.14.0
File Interpreter ABI Platform
redsun-0.14.0-py3-none-any.whl Python 3 none any Details

Total release size: 297.7 kB

Release files / redsun-0.14.0.tar.gz

Download URL redsun-0.14.0.tar.gz
Size 134.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1dc21805cb1c899b01ab73d961ac87ab949fb47ebeadf1951ba31ecd38db4513
BLAKE2b-256 checksum
How to use checksums
e66f2af2dcd144089526da4cc52fd20c845bdc397a43614d2d0b2b61a51fb4e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / redsun-0.14.0-py3-none-any.whl

Download URL redsun-0.14.0-py3-none-any.whl
Size 163.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abb82e2d1b9ae6abae3d3e695bba27e24fc9ee3c464c8960bda1f1062738223b
BLAKE2b-256 checksum
How to use checksums
fbfe05de763909229c5e737aa08afd027a74d476de18a34a8116d97f751d2d88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.14.2

2 release files

0.14.1

2 release files

This release

0.14.0 This release

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.3

2 release files

0.12.0

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page