Skip to main content

PostX is a package that provides a simple interface for posting messages to multiple platforms.

Project description

pipeline status coverage report PyPI version

Python PostX

PostX is a package that provides a simple interface for posting messages to multiple platforms. The user has the ability to send the same message to multiple services or to an indivdual service. The same message is translated to the appropriate calls for the each platform.

Full Docs: Here

Getting Started

Installing via pip

pip install python-postx

Quick Start

from postx import Broker
from postx.message import Message

# Create the broker
broker = Broker()

# You can register as many endpoints as you wish of any combination
broker.register('slack', 'your slack webhook url')
broker.register('teams', 'your teams webhook url')

# Make your message
message = Message()
message.title('My Awesome Update')
message.sub_title('This is an awesome update')
message.text('The update is for all people to see and affects everything')
message.list_unordered(['item 1', 'item 2'])
message.link('Read More Here', 'link to more information')

# Or a shorter way
message = Message()
message.title('My Awesome Update') \
    .sub_title('This is an awesome update') \
    .text('The update is for all people to see and affects everything') \
    .list_unordered(['item 1', 'item 2']) \
    .link('Read More Here', 'link to more information')

# Or even shorter
message = Message()
message.title('My Awesome Update') \
    .sub('This is an awesome update') \
    .text('The update is for all people to see and affects everything') \
    .ul(['item 1', 'item 2']) \
    .link('Read More Here', 'link to more information')

# Send the message to all
broker.send(message)

# Send the message to slack only
broker.send_single_service(message, 'slack')

# Send the message to a single endpoint
broker.send_single_link(message, 'your registered endpoint url')

Supported targets

  • Microsoft Teams
  • Slack

Meta

Kyle Mason - Mediatech15 - Gitlab

Distributed under the MIT license. See LICENSE for more information.

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

python-postx-1.0.4.tar.gz (15.8 kB view hashes)

Uploaded Source

Built Distribution

python_postx-1.0.4-py3-none-any.whl (16.3 kB view hashes)

Uploaded Python 3

Supported by

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