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. The following command downloads and installs the latest version from PyPI. Once installed, you can import the event emitter into your Python project and start building event-driven logic.

pip install bridge-events

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.0.tar.gz (16.1 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.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bridge_events-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9af596b9449e85ea0d9e537c9a2c431fee63987933570ceb43de969402f53a41
MD5 6be99ee95546fe7bde64dd01af801ee2
BLAKE2b-256 d3c87e68387cd21d177299abf3dff98dc83cc059c1391c6e29f4b4988bbdb8ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bridge_events-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2a8f04b7b1071ce6d1b1ca414775cefa771ddc000e58b8fe92afa84b1387b66
MD5 8fe60a8601ca9c16bedc13d69d296d6b
BLAKE2b-256 ef7f6a298571c2e7b6fd51f32959cd35a0a59b3ac05bffaedfbe9208b5e5a897

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