Skip to main content

noob

PyPI - Version Readthedocs Status PyPI - Python Version Coverage Status No AI - Organic Human Labor

Noob logo - It's noob! graph processing for noobs

noob - a streaming, event-driven, node-centric graph processing library that scales from a single function call to comically large distributed pipelines!


Introduction

See the documentation for all noob related information

Most programs are structured as graphs!1 But most programs end up rewriting their own graph execution systems, purposely or not.

Existing graph processing systems are specialized for "big data" on "managed systems," requiring a lot of custom framework-specific code and complex setups.

Noob is the glue package you've been looking for that lets you freely experiment with graph pipelines that can fit in your pocket - use it within your package, to write a background service, a web crawler, and yes even a data analytics pipeline - and then scale it up as needed.

Noob tubes require very little, if any noob-specific code, and its graph structure has a 1:1 mapping to python language features: every function is already a noob node, and every class is waiting to become one.

Say you have a function to yield frames from a webcam and another to display the frames

mypackage/video.py

from typing import Generator
import cv2
import numpy as np

def webcam(index: int = 0) -> Generator[np.ndarray, None, None]:
    cap = cv2.VideoCapture(index)
    while cap.isOpened():
        ret, frame = cap.read()
        yield frame

def display(frame: np.ndarray) -> None:
    cv2.imshow('default', frame)
    cv2.waitKey(1)

Then you can make the simplest graph you've ever seen (a line) like this:

mypackage/webcam.yaml

noob_id: webcam-display

nodes:
  webcam:
    type: mypackage.video.webcam
  display: 
    type: mypackage.video.display
    depends:
      - frame: webcam.value

And run it like this

from noob import Tube, SynchronousRunner

tube = Tube.from_specification("webcam-display")
with SynchronousRunner(tube) as runner:
    runner.run()

And then you can extend that tube as much as you want! Say you want to be able to access the frames from within python, you can use a return node:

mypackage/webcam-return.yaml

noob_id: webcam-display-and-return
extends: [webcam-display]

nodes:
  return:
    type: return
    depends: webcam.value

and then run it like this!

from noob import Tube, SynchronousRunner

tube = Tube.from_specification("webcam-display-and-return")
with SynchronousRunner(tube) as runner:
    frame = runner.process()
    # do whatever you want with your frame! it's your frame!
    # and if it's not your frame, leave it alone!

Keep adding nodes until you have something fun like a live streaming webcam server that rotates the hue based on your mouse position and send a discord message whenever your head touches the right side of the frame. You write your code as a set of normal python functions and classes, and noob serves as the glue between them: you get the best of both worlds - clean code that can be reused outside of noob in your script or package, and an extensible, declarative processing graph that handles scheduling and dependency injection for you.

For more examples see the examples

Installation

Install from pypi!

python -m pip install noob

The main package dependencies are extremely light, and additional functionality is provided through optional dependency groups

  • cli - cli functionality with click! run tubes as unix program, piping input and output with standard streams
  • zmq - network-based multiprocess runner using pyzmq!

Features

  • Streaming processing: designed for scientific applications and data acquisition, work with single events in streams as data is acquired or iterate over batches of data
  • Declarative and Serializable graph specification: simple yaml 1.1 pipeline specifications that can be easily distributed, extended, and interoperate across languages (noob in the browser coming soon....)
  • Decoupled Runners: Graph structure is decoupled from runner logic - use the same pipeline with multiple runners, test things out with a simple synchronous runner, and deploy using a distributed ZMQ cluster.
  • Extremely Lightweight: no external system services required! Running tubes is as easy as calling a function.
  • Compatible With Your Code: You don't need to rewrite your entire package to use noob, and using noob doesn't lock you in. All noob-specific code is optional and is applied as type annotations.
  • Multiple signals and slots: Nodes have a flexible input/output system that can couple input signals together and emit multiple independent streams
  • Cardinality Manipulation: Handle mismatches between nodes that run at different speeds, couple code that works on collections with code that works on single objects
  • Recursive Tubes: Structure your graph as a series of subgraphs and embed them within each other! Combined with noobs runner system, this gives you fine-grained control over data locality and execution style.
  • No Special Cases: All functionality is generic across nodes - if you want to mess with how noob works, make weird time travel nodes, manipulate the graph while it runs, whatever, you can do that.

Contributing

See the contributing docs!


At first I thought this was software for processing graphs...

but now I realize it's for graph processing.

-plaidtron3000@jorts.horse

  1. all programs are actually graphs, but you know what i mean.

Download files

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

Source Distribution

noob-1001.0.0.tar.gz (877.5 kB view details)

Uploaded Source

Built Distribution

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

noob-1001.0.0-py3-none-any.whl (858.2 kB view details)

Uploaded Python 3

File details

Details for the file noob-1001.0.0.tar.gz.

File metadata

  • Download URL: noob-1001.0.0.tar.gz
  • Upload date:
  • Size: 877.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for noob-1001.0.0.tar.gz
Algorithm Hash digest
SHA256 f85bb379dee2063452c5947405b2e98b29d9c9d56d4abce08a9710bb562ba097
MD5 73a175e8dbc963b1c41c1200f2aebdb2
BLAKE2b-256 55fff41f83546a47bbc8db39c7cf480a0741df2abd47da77d6def6030b889cc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for noob-1001.0.0.tar.gz:

Publisher: publish.yaml on miniscope/noob

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file noob-1001.0.0-py3-none-any.whl.

File metadata

  • Download URL: noob-1001.0.0-py3-none-any.whl
  • Upload date:
  • Size: 858.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for noob-1001.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c40bf4d16a0ed1463db914e3113261d53bfc1b0668ee8da4909922264402a61
MD5 17d8f041019a078cb08967d74d2cf497
BLAKE2b-256 e9ce55cade39d87887a5058b0e151eb299b00f56f097f17ac483caf185bc235f

See more details on using hashes here.

Provenance

The following attestation bundles were made for noob-1001.0.0-py3-none-any.whl:

Publisher: publish.yaml on miniscope/noob

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1002.0.0

2 files

This release

1001.0.0 This release

2 files

1000.1.0

2 files

1000.0.1

2 files

1000.0.0

2 files

0.0.99999999

2 files

0.0.9999999

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