Skip to main content

SGN

ci ci documentation pypi version

SGN is a lightweight Python library for building streaming data pipelines. Connect sources, transforms, and sinks into clear workflows while SGN handles asynchronous execution under the hood. Zero external dependencies.

Installation

pip install sgn

Example

import functools
from sgn import Pipeline, IterSource, CallableTransform, CollectSink

def scale(frame, factor: float):
    return None if frame.data is None else frame.data * factor

src = IterSource(name="src", source_pad_names=["H1"], iters={"H1": [1, 2, 3]})

transform = CallableTransform.from_callable(
    name="t1",
    sink_pad_names=["H1"],
    callable=functools.partial(scale, factor=10),
    output_pad_name="H1",
)

sink = CollectSink(name="snk", sink_pad_names=["H1"])

p = Pipeline()
p.connect(src, transform)
p.connect(transform, sink)
p.run()

assert list(sink.collects["H1"]) == [10, 20, 30]

Documentation

  • Tutorial — New to SGN? Build your first pipeline step by step.
  • User Guide — Solve specific problems: connecting elements, grouping, parallelism, and more.
  • Background — Understand how SGN works: execution model, core concepts, and design decisions.
  • Reference — Elements and auto-generated API documentation.
  • sgn-ts: TimeSeries utilities for SGN
  • sgn-ligo: LSC specific utilities for SGN

Instructions for reviewers

  • We will use glreview for this project. Please familiarize yourself with it.

Unreviewed modules

  • A librarian or designated person will generate issues using glreview for all modules
    • The issue will contain an AI review with Claude
    • An AI generated merge request will be made to address issues. The librarian/designee may take liberties to guide that process so that it is high quality
    • The librarian/designee will seek out a human to be assigned to each issue at this point
  • The assigned human will:
    • Verify the pre-review checklist in the git issue (and check boxes if appropriate)
    • Post independent findings as well as notes on the AI review in findings
    • Fill out the overall summary table
    • update the MR (if required) and work with the code authors to approve and merge the MR
    • The issue will be closed when the MR is merged
    • run glreview signoff after the issue is closed

Reviewed modules - updating when code changes

  • FIXME. More to say on this later

Metadata

Release files for sgn 0.13.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 sgn 0.13.0
File Size Uploaded Provenance Actions
sgn-0.13.0.tar.gz 1.9 MB Without provenance Details for sgn-0.13.0.tar.gz

Built distribution (wheel)

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

Total release size: 2.0 MB

Release files / sgn-0.13.0.tar.gz

Download URL sgn-0.13.0.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
97760e69990c5cf0c9e813291538eb0cb22373e916bed32431561cb796cb4045
BLAKE2b-256 checksum
How to use checksums
b059bada19b8b63533e5c0827c7d376eb6b8c45d0f7207e1e2db0eee5ec147fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / sgn-0.13.0-py3-none-any.whl

Download URL sgn-0.13.0-py3-none-any.whl
Size 150.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fde7fae412a537c14b2ecc922d18fee4efa48540b751595272524583dcaef8a8
BLAKE2b-256 checksum
How to use checksums
da9565cd3526ae38e83fa2d9cd3794bdd64acc6479211428b0f3b9fc97ac8664
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Security for sgn 0.13.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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