Work with the Webex Teams APIs in native Python!

WebexCommunity, updated đŸ•Ĩ 2023-02-10 22:51:09

============= WebexPythonSDK =============

Work with the Webex APIs in native Python!

.. image:: https://img.shields.io/badge/license-MIT-blue.svg :target: https://github.com/CiscoDevNet/webexteamssdk/blob/master/LICENSE .. image:: https://img.shields.io/pypi/v/webexteamssdk.svg :target: https://pypi.org/project/webexteamssdk/ .. image:: https://img.shields.io/pypi/dw/webexteamssdk.svg :target: https://pypi.org/project/webexteamssdk/ .. image:: https://travis-ci.org/CiscoDevNet/webexteamssdk.svg?branch=master :target: https://travis-ci.org/CiscoDevNet/webexteamssdk .. image:: https://readthedocs.org/projects/webexteamssdk/badge/?version=latest :target: http://webexteamssdk.readthedocs.io/en/latest/?badge=latest


With release v1.6 we are wrapping up active development on the v1.x release and shifting our focus to the next major release v2! Please see the work-in-progress Release Plan and contribute your ideas for v2.x enhancements by either opening enhancement issues or by joining our webexteamssdk - Webex Teams SDK - Python Community Contributors <https://eurl.io/#BJ0A8gfOQ>_ space and posting your ideas there.


WebexPythonSDK is a community developed Python library for working with the Webex APIs. Our goal is to make working with Webex in Python a native and natural experience!

.. code-block:: Python

from webexteamssdk import WebexTeamsAPI

api = WebexTeamsAPI()

# Find all rooms that have 'webexteamssdk Demo' in their title
all_rooms = api.rooms.list()
demo_rooms = [room for room in all_rooms if 'webexteamssdk Demo' in room.title]

# Delete all of the demo rooms
for room in demo_rooms:
    api.rooms.delete(room.id)

# Create a new demo room
demo_room = api.rooms.create('webexteamssdk Demo')

# Add people to the new demo room
email_addresses = ["[email protected]", "[email protected]"]
for email in email_addresses:
    api.memberships.create(demo_room.id, personEmail=email)

# Post a message to the new room, and upload a file
api.messages.create(demo_room.id, text="Welcome to the room!",
                    files=["https://www.webex.com/content/dam/wbx/us/images/dg-integ/teams_icon.png"])

That's more than 6 Webex API calls in less than 23 lines of code (with comments and whitespace), and likely more than that, since WebexPythonSDK handles pagination_ for you automatically!

WebexPythonSDK makes your life better... Learn how!__

__ Introduction_

Features

WebexPythonSDK does all of this for you:

  • Transparently sources your Webex access token from your local environment

  • Provides and uses default arguments and settings everywhere possible, so you don't have to think about things like API endpoint URLs, HTTP headers and JSON formats

  • Represents all Webex API interactions using native Python tools

  • Authentication and Connection to the Webex Cloud ==> WebexTeamsAPI "connection object"

  • API Calls ==> Hierarchically organized methods underneath the WebexTeamsAPI 'Connection Object'

  • Returned Data Objects ==> Native Python objects

  • Automatic and transparent pagination!

  • Automatic rate-limit handling! (wait|retry)

  • Multipart encoding and uploading of local files

  • Auto-completion in your favorite IDE, descriptive exceptions, and so much more...

Installation

Installing and upgrading webexteamssdk is easy:

Install via PIP

.. code-block:: bash

$ pip install webexteamssdk

Upgrade to the latest version

.. code-block:: bash

$ pip install webexteamssdk --upgrade

Documentation

Excellent documentation is now available at: http://webexteamssdk.readthedocs.io

Check out the Quickstart_ to dive in and begin using webexteamssdk.

Examples

Are you looking for some sample scripts? Check out the examples_ folder!

Have a good example script you would like to share? Please feel free to contribute__!

__ Contribution_

Release Notes

Please see the releases_ page for release notes on the incremental functionality and bug fixes incorporated into the published releases.

Questions, Support & Discussion

WebexPythonSDK is a community developed and community-supported project. If you experience any issues using this package, please report them using the issues_ page.

Please join the Python Webex Teams Devs__ Webex space to ask questions, join the discussion, and share your projects and creations.

__ Community_

Contribution

WebexPythonSDK is a community development project. Feedback, thoughts, ideas, and code contributions are welcome! Please see the Contributing_ guide for more information.

History

The Webex Python SDK (webexteamssdk) library started as Cisco Spark API (ciscosparkapi). We updated the library's name in alignment with Cisco's re-brand of Cisco Spark to Webex. The Cisco Spark API library has been deprecated and is no longer supported; however, its open-source codebase is still available in the ciscosparkapi_ branch of this repository.

The development team may make additional name changes as the library evolves with the Webex APIs published on developer.webex.com.

Copyright (c) 2016-2020 Cisco and/or its affiliates.

.. Release Plan: https://github.com/CiscoDevNet/webexteamssdk/wiki/Release-Plans .. _Introduction: http://webexteamssdk.readthedocs.io/en/latest/user/intro.html .. _pagination: https://developer.webex.com/docs/basics#pagination .. _webexteamssdk.readthedocs.io: https://webexteamssdk.readthedocs.io .. _Quickstart: http://webexteamssdk.readthedocs.io/en/latest/user/quickstart.html .. _examples: https://github.com/CiscoDevNet/webexteamssdk/tree/master/examples .. _webexteamssdk: https://github.com/CiscoDevNet/webexteamssdk .. _issues: https://github.com/CiscoDevNet/webexteamssdk/issues .. _Community: https://eurl.io/#HkMxO-_9- .. _projects: https://github.com/CiscoDevNet/webexteamssdk/projects .. _pull requests: https://github.com/CiscoDevNet/webexteamssdk/pulls .. _releases: https://github.com/CiscoDevNet/webexteamssdk/releases .. _the repository: webexteamssdk .. pull request: pull requests .. _Contributing: https://github.com/CiscoDevNet/webexteamssdk/blob/master/docs/contributing.rst .. _ciscosparkapi: https://github.com/CiscoDevNet/ciscosparkapi/tree/ciscosparkapi

Issues

Bump ipython from 7.16.1 to 8.10.0

opened on 2023-02-10 22:51:04 by dependabot[bot]

Bumps ipython from 7.16.1 to 8.10.0.

Release notes

Sourced from ipython's releases.

See https://pypi.org/project/ipython/

We do not use GitHub release anymore. Please see PyPI https://pypi.org/project/ipython/

Commits
  • 15ea1ed release 8.10.0
  • 560ad10 DOC: Update what's new for 8.10 (#13939)
  • 7557ade DOC: Update what's new for 8.10
  • 385d693 Merge pull request from GHSA-29gw-9793-fvw7
  • e548ee2 Swallow potential exceptions from showtraceback() (#13934)
  • 0694b08 MAINT: mock slowest test. (#13885)
  • 8655912 MAINT: mock slowest test.
  • a011765 Isolate the attack tests with setUp and tearDown methods
  • c7a9470 Add some regression tests for this change
  • fd34cf5 Swallow potential exceptions from showtraceback()
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/WebexCommunity/WebexPythonSDK/network/alerts).

Bump cryptography from 3.4.7 to 39.0.1

opened on 2023-02-08 01:18:52 by dependabot[bot]

Bumps cryptography from 3.4.7 to 39.0.1.

Changelog

Sourced from cryptography's changelog.

39.0.1 - 2023-02-07


* **SECURITY ISSUE** - Fixed a bug where ``Cipher.update_into`` accepted Python
  buffer protocol objects, but allowed immutable buffers. **CVE-2023-23931**
* Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.0.8.

.. _v39-0-0:

39.0.0 - 2023-01-01

  • BACKWARDS INCOMPATIBLE: Support for OpenSSL 1.1.0 has been removed. Users on older version of OpenSSL will need to upgrade.
  • BACKWARDS INCOMPATIBLE: Dropped support for LibreSSL < 3.5. The new minimum LibreSSL version is 3.5.0. Going forward our policy is to support versions of LibreSSL that are available in versions of OpenBSD that are still receiving security support.
  • BACKWARDS INCOMPATIBLE: Removed the encode_point and from_encoded_point methods on :class:~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicNumbers, which had been deprecated for several years. :meth:~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey.public_bytes and :meth:~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey.from_encoded_point should be used instead.
  • BACKWARDS INCOMPATIBLE: Support for using MD5 or SHA1 in :class:~cryptography.x509.CertificateBuilder, other X.509 builders, and PKCS7 has been removed.
  • BACKWARDS INCOMPATIBLE: Dropped support for macOS 10.10 and 10.11, macOS users must upgrade to 10.12 or newer.
  • ANNOUNCEMENT: The next version of cryptography (40.0) will change the way we link OpenSSL. This will only impact users who build cryptography from source (i.e., not from a wheel), and specify their own version of OpenSSL. For those users, the CFLAGS, LDFLAGS, INCLUDE, LIB, and CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS environment variables will no longer be respected. Instead, users will need to configure their builds as documented here_.
  • Added support for :ref:disabling the legacy provider in OpenSSL 3.0.x<legacy-provider>.
  • Added support for disabling RSA key validation checks when loading RSA keys via :func:~cryptography.hazmat.primitives.serialization.load_pem_private_key, :func:~cryptography.hazmat.primitives.serialization.load_der_private_key, and :meth:~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers.private_key. This speeds up key loading but is :term:unsafe if you are loading potentially attacker supplied keys.
  • Significantly improved performance for :class:~cryptography.hazmat.primitives.ciphers.aead.ChaCha20Poly1305

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/WebexCommunity/WebexPythonSDK/network/alerts).

unable to import WebexTeamsAPI using python3.11

opened on 2023-01-19 21:55:17 by jgroetzi

When trying to import WebexTeamsAPI from webexteamssdk in python3.11 it raises an exception:

from webexteamssdk import WebexTeamsAPI File "/venv/lib/python3.11/site-packages/webexteamssdk/__init__.py", line 40, in <module> from .api import WebexTeamsAPI File "/venv/lib/python3.11/site-packages/webexteamssdk/api/__init__.py", line 25, in <module> from past.types import basestring File "/venv/lib/python3.11/site-packages/past/types/__init__.py", line 25, in <module> from .oldstr import oldstr File "/venv/lib/python3.11/site-packages/past/types/oldstr.py", line 5, in <module> from collections import Iterable ImportError: cannot import name 'Iterable' from 'collections' (/usr/local/lib/python3.11/collections/__init__.py)

adding edit message support

opened on 2023-01-15 10:23:41 by SheverNts None

Python 3.12, versioneer build failure

opened on 2023-01-07 15:04:05 by scop

versioneer.py attempts to use configparser.SafeConfigParser which has been deprecated for a long time, and now removed in Python 3.12, causing build to fail.

Upgrading versioneer to a newer version would seem likely to fix this: https://github.com/python-versioneer/python-versioneer/issues/200

Fixed broken links in docs

opened on 2022-12-16 11:04:31 by sQu4rks

This PR is in reference to #184 that was recently merged. The PR included broken links in the docs section that this PR fixes.

Changes:

  • Links to additional card resources now point to the correct anchors in the docs file.
  • Also fixed a section underlining that was too short and thus triggered a warning whenever building the docs.

Releases

Hotfix 2022-06-01 15:30:41

This release is a hotfix that merges Pull request #175 into the main branch.

What's Changed

  • Fix for #147 by @fbradyirl in https://github.com/CiscoDevNet/webexteamssdk/pull/157
  • Bump pygments from 2.6.1 to 2.7.4 by @dependabot in https://github.com/CiscoDevNet/webexteamssdk/pull/158
  • Fix type check in update by @mallamanis in https://github.com/CiscoDevNet/webexteamssdk/pull/150
  • Added option to disable ssl cert verification by @sQu4rks in https://github.com/CiscoDevNet/webexteamssdk/pull/142
  • Update Cards Handling to check correct attribute for instance of AdaptiveCards (solves #140) by @sQu4rks in https://github.com/CiscoDevNet/webexteamssdk/pull/141
  • fixing OpenUrl action by @craigers521 in https://github.com/CiscoDevNet/webexteamssdk/pull/175

New Contributors

  • @fbradyirl made their first contribution in https://github.com/CiscoDevNet/webexteamssdk/pull/157
  • @dependabot made their first contribution in https://github.com/CiscoDevNet/webexteamssdk/pull/158
  • @mallamanis made their first contribution in https://github.com/CiscoDevNet/webexteamssdk/pull/150
  • @craigers521 made their first contribution in https://github.com/CiscoDevNet/webexteamssdk/pull/175

Full Changelog: https://github.com/CiscoDevNet/webexteamssdk/compare/v1.6...v1.6.1

The Catch-Up Release 2020-07-13 15:23:10

In v1.6, we have updated all of the currently wrapped and supported Webex Teams API endpoints and closed out all existing issues that users opened on the v1.x releases. The library should now be up-to-date in supporting the Webex Teams APIs documented at developer.webex.com. It is not yet up-to-date in supporting the newer and broader Webex Meetings, Calling, and Devices APIs. We are tracking adding these additional API endpoints in issue #113, and we will work to add full support for all of the published Webex APIs in v2.x of the library.

With release v1.6, we are wrapping up active development on the v1.x release and shifting our focus to the next major release v2!

Breaking Change(s)

We have introduced one (1) breaking change in v1.6:

  • We have changed the function signature (parameter names) for the WebexTeamsAPI.guest_issuer.create() method to align it with the developer documentation at developer.webex.com.

    Previous method definition:

    python def create(self, subject, displayName, issuerToken, expiration, secret): ...

    python def create(self, sub, name, iss, exp, secret): ...

Accessible Webex Tracking IDs & Custom User-Agent Header 2020-07-09 18:59:48

Version 1.5 adds several minor backend improvements, including:

  • Webex Tracking IDs are now prominently displayed for all API errors and warnings.

    Example Error Message: ``` ApiError: [401] Unauthorized - The request requires a valid access token set in the Authorization request header. [Tracking ID: ROUTER_5F05F384-D9E9-01BB-00FF-4B0C804F00FF] ````

    You can also access the Tracking IDs via the tracking_id attribute available on the raised exception and warning objects.

    ``` python api = webexteamssdk.WebexTeamsAPI(access_token="abc")

    try: api.people.me() except webexteamssdk.ApiError as e: print(e.tracking_id) ``` * The webexteamssdk library now sends a custom User-Agent header (inspired by PIP's User-Agent header).

    Example User-Agent Header: webexteamssdk/1.5 {"implementation": {"name": "CPython", "version": "3.7.8"}, "distro": {"name": "macOS", "version": "10.15.5"}, "system": {"name": "Darwin", "release": "19.5.0"}, "cpu": "x86_64"}

  • Minor package and PEP8 improvements.

Add support for the Admin Audit Events API 2020-07-07 20:24:37

Version 1.4 adds support for the Admin Audit Events API; however, you should note that pagination is currently broken ☚ī¸ on responses from the /v1/adminAudit/events API endpoint. Hopefully, the Developer Support Team will get this fixed quickly.

Also in this release we...

  • Squashed a timezone info bug that was affecting Python v2.7 and 3.5

Official Support for the Attachment Actions API 2020-04-13 13:19:31

This minor update adds official support for adding attachments to messages via WebexTeamsAPI.messages.create() thanks to @bradh11, @jianchen2580, @zhanto97, and @jwa1 🙌!

@jpjpjp has created an excellent Webex Teams bot example that demonstrates using webhooks, Adaptive Cards, and response actions! 😎

Python Adaptive Cards Beta

This release includes a beta of @sQu4rks Python Adaptive Cards, but please do not get too attached using this functionality directly from the Webex Teams SDK as we will be migrating this functionality to leverage @sQu4rks newer (and independently maintained) pyadaptivecards library.

Proxy Support 2019-09-20 17:41:40

Thanks to @sQu4rks 😎, webexteamssdk now (offically) supports configuration and use of an HTTP/HTTPS proxy! Just past a dictionary with the proxy configuration when creating your WebexTeamsAPI connection object, and you are good to go. 👊

```python

from webexteamssdk import WebexTeamsAPI proxy = {'https': 'http://:'} api = WebexTeamsAPI(access_token=, proxies=proxy) ```

Check out the requests documentation on Proxies for details on what should be in the proxies dictionary.

Webex Developer Community

An organization for the Webex Developer Community supported projects

GitHub Repository Homepage

cisco webex webex-teams webex-teams-sdk python python2 python3 python-library python-sdk python-wrapper webex-teams-bot cisco-spark-bot