Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

redsun

redsun is a Python toolkit for building your own modular software for scientific data acquisition. It builds on the Bluesky ecosystem and makes no assumptions about your hardware, so each lab can build the control software its experiments need.

To learn redsun, start with the tutorials, where you build one application step by step without any hardware.

Problem statement

When research depends on controlling hardware, one of the hardest problems is making different instruments work together in workflows that are reusable, reliable and documented. On top of that, the software needs an interface that people with less technical background can understand and use correctly.

That's hard because experiments keep changing. It's next to impossible to predict everything the software will finally need to do, especially when the people using it are scientists with no engineering background.

So rather than shipping one complete program, redsun follows the idea of component-based development: it ships ready-made components, and you assemble and wire them for what you need.

Component-based development (CBD)

In component-based development, what matters most is the interface of each component. A component says what it needs to be built, and offers features that other components can use.

You put components 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()

You declare each component once, with the arguments it needs, and wire says which signal reaches which slot. The session then builds everything in order and connects it.

redsun provides the shared code that connects components, so you can use it to ship a whole application or a single reusable component. Through Python entry points, you can also ship an application as a single YAML configuration file, as long as each package that contributes components includes a redsun.yaml manifest.

The same application then looks like this:

# 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

The session looks up each plugin_id in the manifest that 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 a Device-View-Presenter (DVP) application. DVP resembles the Model-View-Presenter (MVP) architecture, except that the bottom layer of the application is the Device layer, which uses ophyd-async to talk to the hardware.

This design makes a clear point: redsun is first of all about device control, and tries to do it well.

Documentation

The documentation covers everything else.

License

redsun is released under the Apache 2.0 license. See the license for the full text.

Metadata

Release files for redsun 0.15.0rc0

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.15.0rc0
File Size Uploaded
redsun-0.15.0rc0.tar.gz 266.5 kB Details

Built distribution (wheel)

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

Total release size: 624.3 kB

Release files / redsun-0.15.0rc0.tar.gz

Download URL redsun-0.15.0rc0.tar.gz
Size 266.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f0516bcf96646e6c3a20c1a641c00d7fa79b7a6464a8ae899fe35c078d461d82
BLAKE2b-256 checksum
How to use checksums
0421da5bfa0e92f67d9a27962c6406a35d511f2fd2e3c0876cac78bdd3f24d24
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 Oct 13, 2026.

Transparency log

Release files / redsun-0.15.0rc0-py3-none-any.whl

Download URL redsun-0.15.0rc0-py3-none-any.whl
Size 357.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07da891042763f0ba83d4258ac845f1d5b3b42138f8aa0d3994ad4f13ecea364
BLAKE2b-256 checksum
How to use checksums
cf479fcf92cdea804275a6f7b6da8e3a9d61dd9699e5fecb4bfd4b45a54164eb
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 Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.15.0rc0 This release

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.14.0

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