Skip to main content

integrate Webex to your python project

Project description

Webex-Integration

webex-integration a simple project which can be used to send webex messages and emits log records from the native logging module

Installing Webex-Integration

Webex-Integration is available on PyPi

$ python -m pip install webex-integration

Usage

Simple Message

In order to send a simple webex message, you just have to initialize a new WebexTeams instance with you personal token and the appropriate room id:

from webexintegration import WebexTeams

webex_teams = WebexTeams(
    token = my_token,
    room_id = my_room_id
)

response = webex_teams.send_message("This is a bot")
response.raise_for_status()

logging handler

In order to send logging message into an selected chat room, you just have to initialize a new WebexTeamsHandler with an appropriate WebexTeams instance and pass the handler to your logging instance:

import logging
from webexintegration import WebexTeams

webex_teams = WebexTeams(
    token = my_token,
    room_id = my_room_id
)
webex_handler = WebexHandler(webex_teams)
webex_handler.setLevel(logging.INFO)

logging.basicConfig(level=logging.INFO, handlers=[webex_handler])

try:
    raise RuntimeError()
except Exception as ex:
    logging.error("An Error occured")

The default logging formatter is set to WebexFormatter, feel free to override or use a different formatter.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

webex_integration-0.0.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file webex_integration-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for webex_integration-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 651ace7b7db59909be06cbad0c9f55fde7c501d28b88686af938d761a68f8920
MD5 78f2af8d077ef2f0014301cb2f958143
BLAKE2b-256 c606124bc5132edbedbac5322b566c6bfd5f0aed9716c701cb29a3d3d259d590

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