Skip to main content

Pythonic adapter for Bridge events

Project description

Version Code Size License

bridge-events is a library designed to provide a flexible event emitter and server for integrating with Bridge. It enables developers to build event-driven applications and services that can easily handle and emit custom events in real time.

Getting started

Installation

To begin using bridge-events, you first need to install the package. Select the installation method that best fits your workflow:

📦 Using pip
pip install bridge-events
🚀 Using pipx
pipx install bridge-events
⚡ Using uv
uv add bridge-events

Once installed, you can import the event emitter into your Python project and start building event-driven logic.

Usage

After installation, you can import the event emitter and create event handlers in your Python code. The following example demonstrates how to set up an event emitter, register handlers for specific events and respond to incoming data. This approach allows you to build applications that react to events in real time.

# main.py

from bridge_events import EventEmitter

emitter = EventEmitter(signature="secret")

@emitter.on("item.created")
def handle_item_created(data):
    print(f"Received item created event: {data}")

@emitter.on("item.refreshed")
def handle_item_refreshed(data):
    print(f"Received item refreshed event: {data}")

@emitter.on("payment.transaction.created")
def handle_payment_transaction_created(data):
    print(f"Received payment transaction created event: {data}")

@emitter.on("payment.transaction.updated")
def handle_payment_transaction_updated(data):
    print(f"Received payment transaction updated event: {data}")

@emitter.on("error")
def handle_error(data):
    print(f"Received error event: {data}")

Project details


Download files

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

Source Distribution

bridge_events-1.0.2.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

bridge_events-1.0.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file bridge_events-1.0.2.tar.gz.

File metadata

  • Download URL: bridge_events-1.0.2.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for bridge_events-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2d9919ba0b0c5c99db323f0d7f6bdf4c8cf8330a5af519e1dc823df37dac76ed
MD5 2f58826e410ff3e40d58d5eb1ae06c55
BLAKE2b-256 90e80427ffc91c7c3e2d3d851f9842fd60c6dc84c11d695a3fac583ea7e7a7b4

See more details on using hashes here.

File details

Details for the file bridge_events-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bridge_events-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3daedbd61b47c500aad1c409b7a933bbfb9839e361854607e3c7c8b598ecd5d0
MD5 6e5518844b9cc23ffddf219c1cafca2b
BLAKE2b-256 82d10a751c825f59c8f3ebdd188da0245499d91d55845c691a0242ad0f766b3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page