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 Distribution

webex-integration-0.0.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file webex-integration-0.0.3.tar.gz.

File metadata

  • Download URL: webex-integration-0.0.3.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for webex-integration-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7b694809df66423f2c52c9f1da03ab01a4bccc7cdaf88310a3a4dfca1c001e64
MD5 ed1981db4bd57c98ca9f62e3d80494c0
BLAKE2b-256 992e7d76c058cfb18334afa9f502574328371a8b3897a7176c3e7eab79f8d303

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for webex_integration-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a61ed97b8181af8bb1a5d107debaed1ec03b75cbadee83e2a7ae48ca119898cd
MD5 2a3b607af0a05cce98b8e12223e9d639
BLAKE2b-256 eb6da6a993366d67c7b100fc2ed17a54e2c77d0845ea26b6579b5cbf870e61a8

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