Skip to main content

Community-developed Python SDK for the Webex Teams APIs

Project description

Work with the Webex Teams APIs in native Python!

https://img.shields.io/badge/license-MIT-blue.svg https://img.shields.io/pypi/v/webexteamssdk.svg https://img.shields.io/pypi/dw/webexteamssdk.svg https://travis-ci.org/CiscoDevNet/webexteamssdk.svg?branch=master https://readthedocs.org/projects/webexteamssdk/badge/?version=latest

Looking for ciscosparkapi? You are in the right place. ciscosparkapi is now webexteamssdk! It still has all of the native and natural Webex Teams Python functionality that you love and now we have made room for even more functionality to be added in the future.

We will maintain the ciscosparkapi package (bug fixes, etc.) in the ciscosparkapi branch of this repository and continue to publish package updates with these fixes to PyPI (through the end of 2019). Maintaining the ciscosparkapi package should keep your code and projects up and running while giving you 12+ months to migrate your code to the new webexteamssdk library.

Migration Note: Migrating should be easy. The WebexTeamsAPI class and the Python objects returned by the API calls are nearly identical to their CiscoSparkAPI predecessors. Does the word “nearly” scare you? Here are some specifics:

  • The obvious top-level name change from CiscoSparkAPI to WebexTeamsAPI.

  • WebexTeamsAPI’s API structure: method and attribute names are identical.

  • The returned Python objects (now derivatives of an ImmutableData base class) are now immutable; so you can use them in sets and as keys in dictionaries.

  • WebexTeamsAPI converts object attributes that contain data-time strings (like a room’s creation date) to Python datetime’s (actually a derived class that has been customized to model the Webex Teams data-time format)

There is also some new functionality under the hood that we will document, communicate, and generally make available in the future.


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

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 = ["test01@cmlccie.com", "test02@cmlccie.com"]
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 Teams API calls in less than 23 lines of code (with comments and whitespace), and likely more than that since webexteamssdk handles pagination for you automatically!

webexteamssdk makes your life better… Learn how!

Features

webexteamssdk does all of this for you:

  • Transparently sources your Webex Teams 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 Teams API interactions using native Python tools

    • Authentication and Connection to the Webex Teams 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

$ pip install webexteamssdk

Upgrading to the latest Version

$ 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!

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

webexteamssdk 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 Teams space to ask questions, join the discussion, and share your projects and creations.

Contribution

webexteamssdk is a community development projects. Feedback, thoughts, ideas, and code contributions are welcome! Please see the Contributing guide for more information.

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

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

webexteamssdk-1.5.tar.gz (60.4 kB view details)

Uploaded Source

Built Distribution

webexteamssdk-1.5-py3-none-any.whl (110.8 kB view details)

Uploaded Python 3

File details

Details for the file webexteamssdk-1.5.tar.gz.

File metadata

  • Download URL: webexteamssdk-1.5.tar.gz
  • Upload date:
  • Size: 60.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for webexteamssdk-1.5.tar.gz
Algorithm Hash digest
SHA256 8bc021fb51682e3b8199f488c6df162b8b3637d6769cded99657a4c5155f3597
MD5 6d508d48c9614a60a9c22766fed8b9db
BLAKE2b-256 b49ec9c6cc643fdc627bf9d080300020d9e6fbd84fb19c393bbe4ca7d025167f

See more details on using hashes here.

File details

Details for the file webexteamssdk-1.5-py3-none-any.whl.

File metadata

  • Download URL: webexteamssdk-1.5-py3-none-any.whl
  • Upload date:
  • Size: 110.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for webexteamssdk-1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ff3fd97185b7e6c3c4ce2843136e4d39be0afe49f377df7c09bfcc6291954176
MD5 6991861df0d82b4b621b5b9aacf84e1d
BLAKE2b-256 d91a204ab8340514e9a1a555a7fbb5b01b96d84ac3aa1c45dc599e3fd3520433

See more details on using hashes here.

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