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.

Related Libraries

  • 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sgn-0.12.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sgn-0.12.0-py3-none-any.whl (135.9 kB view details)

Uploaded Python 3

File details

Details for the file sgn-0.12.0.tar.gz.

File metadata

  • Download URL: sgn-0.12.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1

File hashes

Hashes for sgn-0.12.0.tar.gz
Algorithm Hash digest
SHA256 be39d53174cf19e4bf4c34c99218f0a860b95b5cf5c7052c0643a5db37fd7c62
MD5 41b513281d1dccace8211ada83059861
BLAKE2b-256 13d856dc2c751cec926c98a70f62a6a48842fdde667533ac9e43c8246e546dc8

See more details on using hashes here.

File details

Details for the file sgn-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: sgn-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 135.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1

File hashes

Hashes for sgn-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c5cc4164f9baec04a58b3d973cb612ee9bfb9f80f2b5a7ed6a5147582d2e882
MD5 9eb852f4097d5af9b9703b9082abf737
BLAKE2b-256 fee686e7376557f6121bef7400d71badcefa9b5c1df59d3f7c1eb588a41738bc

See more details on using hashes here.

Release history Release notifications | RSS feed

0.12.2

2 files

0.12.1

2 files

This release

0.12.0 This release

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 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