Skip to main content

Simple, lightweight, scalable Python API wrapper for the Cisco Spark APIs

Project description

Simple, lightweight, scalable Python API wrapper for the Cisco Spark APIs

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

ciscosparkapi is a community developed Pythonic wrapping of the Cisco Spark APIs, which makes working with Cisco Spark in Python a native and natural experience!

from ciscosparkapi import CiscoSparkAPI

api = CiscoSparkAPI()

# Find all rooms that have 'ciscosparkapi Demo' in their title
all_rooms = api.rooms.list()
demo_rooms = [room for room in all_rooms if 'ciscosparkapi 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('ciscosparkapi 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://developer.ciscospark.com/images/logo_spark_lg@256.png"])

That’s more than 6 Spark API calls in less than 23 lines of code (with comments and whitespace), and likely more than that since ciscosparkapi handles pagination for you automatically!

ciscosparkapi makes your life better… Learn how!

Features

ciscosparkapi does all of this for you…

  • Transparently sources your Spark credentials 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 Cisco Spark API interactions using native Python tools

    • Authentication and Connection to the Cisco Spark Cloud ==> CiscoSparkAPI ‘Connection Object’

    • API Calls ==> Hierarchically organized method calls underneath a CiscoSparkAPI ‘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 ciscosparkapi is easy:

Install via PIP

$ pip install ciscosparkapi

Upgrading to the latest Version

$ pip install ciscosparkapi --upgrade

Documentation

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

Check out the Quickstart to dive in and begin using ciscosparkapi.

Examples

Looking for some examples or sample scripts? Check out the examples folder!

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

Release Notes

Complete and fully functional Beta releases have been published. Please see the releases page for release notes on the incremental functionality and bug fixes incorporated into the published releases.

Note: The package APIs may change, while the package is in beta.

Questions, Support & Discussion

This is a community developed and community supported project. If you experience any issues using this package, please report them using the issues log.

Please join the Python Spark Devs community Spark room to ask questions, join the discussion and share your projects and creations.

Contribution

ciscosparkapi and it’s sister project ciscosparksdk are community development projects. Feedback, thoughts, ideas and code contributions are most welcome!

Feedback, issues, thoughts and ideas…

Please use the issues log.

Interested in contributing code?

  1. Check for open issues or create a new ‘issue’ for the item you want to work on.

    • Assign yourself to the issue, and communicate with any others that may be working the issue.

  2. Review the project charter for coding standards and practices.

  3. Fork a copy of the repository.

  4. Add your code to your forked repository.

  5. Submit a pull request.

Copyright (c) 2016-2018 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

ciscosparkapi-0.10.1.tar.gz (44.7 kB view details)

Uploaded Source

File details

Details for the file ciscosparkapi-0.10.1.tar.gz.

File metadata

  • Download URL: ciscosparkapi-0.10.1.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for ciscosparkapi-0.10.1.tar.gz
Algorithm Hash digest
SHA256 b9a42bc1d660ffb7148bbeb3420a6c96e16cc33e40614339f45e66f1d5e333f7
MD5 58f33e75ca8bacb3b1734b4be82af6e5
BLAKE2b-256 8571f8b26973e14194f201229817f17e2fa7b6f96ad509d66e38db1c2be985a1

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