Skip to main content

Python wrapper for the OpenParallax channels module

Project description

openparallax-channels

Multi-channel messaging adapters (WhatsApp, Telegram, Discord, Signal, iMessage)

Python wrapper for the OpenParallax channels module. Communicates with a pre-built Go binary over JSON-RPC (stdin/stdout).

Installation

pip install openparallax-channels

Usage

from openparallax_channels import Channels

with Channels() as ch:
    # Split a long message into platform-safe chunks
    parts = ch.split_message(long_text, max_length=2000)

    # Format a message (0=plain, 1=markdown, 2=HTML)
    msg = ch.format_message("Hello!", format=1)

Passing Channel Credentials

Channel credentials (bot tokens, API keys, webhook URLs) are passed through OpenParallax's workspace config.yaml, not through this wrapper directly. The wrapper communicates with the Go channels-bridge binary, which reads credentials from the workspace config.

Configure channels in your workspace config.yaml:

channels:
  telegram:
    enabled: true
    bot_token_env: TELEGRAM_BOT_TOKEN
  discord:
    enabled: true
    bot_token_env: DISCORD_BOT_TOKEN
  slack:
    enabled: true
    bot_token_env: SLACK_BOT_TOKEN
    app_token_env: SLACK_APP_TOKEN

Telegram Example

export TELEGRAM_BOT_TOKEN="123456:ABC-DEF..."
# config.yaml
channels:
  telegram:
    enabled: true
    bot_token_env: TELEGRAM_BOT_TOKEN
from openparallax_channels import Channels

with Channels() as ch:
    parts = ch.split_message(response_text, max_length=4096)
    for part in parts:
        send_to_telegram(chat_id, part)

Documentation

See the channels documentation for all supported platforms and configuration options.

License

Apache License 2.0

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

openparallax_channels-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

openparallax_channels-0.1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file openparallax_channels-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for openparallax_channels-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8f5e5a50d9c043feb147a7e37b85ecf2b661f1dbcc46f631cb95d5937260c784
MD5 e953ba616d53af94567b531edadb4870
BLAKE2b-256 efcf4f8a4bf35a9fc64c32016f1d5da8eefcd797745dcd47783c071cc3a4d829

See more details on using hashes here.

Provenance

The following attestation bundles were made for openparallax_channels-0.1.1.tar.gz:

Publisher: release.yml on openparallax/openparallax

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

File details

Details for the file openparallax_channels-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openparallax_channels-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b468a577a2b82985a1c6f3c7812654da0126ea808108d91c2d86c9a44de2a85
MD5 2f2c319df6c19a706990d1b8cdaa102a
BLAKE2b-256 65c2452ef845943742a058ddbcfd76b14348f4db20e7b80e6964881e19a0eae1

See more details on using hashes here.

Provenance

The following attestation bundles were made for openparallax_channels-0.1.1-py3-none-any.whl:

Publisher: release.yml on openparallax/openparallax

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

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