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.1.tar.gz (16.2 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.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bridge_events-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c89e8833344052dad0b8f16866f0518567e94e6b8a5029e1bedfe183b5ca81f9
MD5 74b8e3535c18050c79fc3b441207bbf6
BLAKE2b-256 3107706ffd748fa1c46aac9366d67fd788270519a6070da6950529d0bffb5653

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bridge_events-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a265be13af4ddc0e78ec306cdd3edf7d1ac4a9bfca953a451cc80a65cdd05c09
MD5 856b51b0eb5b364e1dd5e7032fd8d6d6
BLAKE2b-256 2a57c89fd816d883e8ec06b3655c6a5d5719f291ad1c4cad8422904e4d26ff2d

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