Skip to main content

Python package to publish events to the Outerbounds platform

Installation

Install the package using pip:

pip install ob-events

If you want to use IAM authentication, you need some additional dependencies:

pip install ob-events[aws]

Usage

Metaflow Flow (The Receiver)

First, assume you have a Metaflow Flow that is triggered by an event, like my_event.

from metaflow import FlowSpec, step, current, trigger


@trigger(event='my_event')
class NodeSimpleTriggeredFlow(FlowSpec):
    @step
    def start(self):
        self.var_1 = ["h", "e", "l", "l"]
        self.next(self.b, foreach='var_1')

    @step
    def b(self):
        print("In B")
        self.next(self.join)

    @step
    def join(self, inputs):
        self.next(self.end)

    @step
    def end(self):
        print("In end")

if __name__ == "__main__":
    NodeSimpleTriggeredFlow()

Python Trigger (The Sender)

You can trigger this flow using the ob-events Python library. This assumes you are using Service Principals for programmatic authentication. You can get the config string for the machine user from the Outerbounds UI.

from ob_events import EventTrigger, ConfigError, TriggerError

try:
    # Create the trigger instance
    event_trigger = EventTrigger()

    # Initialize the library with the config string from the Outerbounds UI
    event_trigger.init(config_string="awssm-arn:...")

    # Or you can use static API key auth:
    #
    # event_trigger.init_from_service_principal(
    #     service_principal_name="some-static-key-principal",
    #     deployment_domain="mycompany.obp.outerbounds.com",
    #     perimeter="default",
    #     jwt_token="...key goes here..."
    # )

    # Trigger the event (name must match what's in @trigger decorator)
    print("Triggering event 'my_event'...")
    event_trigger.trigger("my_event", payload={"foo": "bar", "source": "my-service"})
    print("Event triggered successfully!")

    # You can reuse the same trigger for multiple events
    event_trigger.trigger("another_event", payload={"data": "value"})

except ConfigError as e:
    print(f"Configuration error: {e}")
except TriggerError as e:
    print(f"Trigger error: {e}")
except ImportError as e:
    print(f"Dependency error: {e}")
    print("If using AWS Secrets Manager, please run 'pip install ob-events[aws]'")

Metadata

Release files for ob-events 0.2.1

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

Source distribution (sdist)

Source distribution for ob-events 0.2.1
File Size Uploaded Provenance
ob_events-0.2.1.tar.gz 26.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ob-events 0.2.1
File Interpreter ABI Platform
ob_events-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.4 kB

Release files / ob_events-0.2.1.tar.gz

Download URL ob_events-0.2.1.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0e4ce33ccb98f97564307165640d47c4b6c03bccf171c61cf0c65383f666f5cb
BLAKE2b-256 checksum
How to use checksums
7466b38a4a79be639a94aba197ef489d60f85d3e0a4aed98ea72afcac36fb55a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Apr 6, 2026.

Transparency log

Release files / ob_events-0.2.1-py3-none-any.whl

Download URL ob_events-0.2.1-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5747c6bdb69ef6e57e3f7d19a93920783d7761863455bb9fbf5fb67df979ea30
BLAKE2b-256 checksum
How to use checksums
6cee36864f20e8a0632e8530d43860a1e3462f0245ff236ec398874ffc35a949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Apr 6, 2026.

Transparency log

Security for ob-events 0.2.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ob_events-0.2.1.tar.gz

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 Apr 6, 2026.

Transparency log

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.

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