Skip to content

Library that uses Python to connect to Smartsheet services (using API 2.0).

License

Notifications You must be signed in to change notification settings

cameronbowie/smartsheet-python-sdk

 
 

Repository files navigation

Build Status Coverage Status

Smartsheet Python SDK

This library is intended to simplify connecting to the Smartsheet API from Python applications.

System Requirements

The SDK currently supports Python 2.7, 3.3, 3.4, 3.5, 3.6, pypy, and pypy3. The following packages are required.

Installation

The SDK can be installed by using a package manager (pip) or manually by downloading the SDK directly from Git. These two steps are outlined below.

Install with pip

If unfamiliar with pip, please review the pip documentation.

This SDK's Python package is called smartsheet-python-sdk. To install using pip:

$ pip install smartsheet-python-sdk

Install manually

To install this SDK manually, download the source code from GitHub and then run:

$ python setup.py install

Logging

There are three log levels currently supported by the Smartsheet Python SDK (in increasing order of verbosity):

ERROR - messages related to API or JSON serialization errors

INFO - messages about the API resources being requested

DEBUG - API request and response bodies and messages regarding object attributes that are changed by the SDK due to the nature of the API call being made

Use the logging facility's basicConfig method to set your logging properties:

import logging
logging.basicConfig(filename='mylog.log', level=logging.DEBUG)

Documentation

The Smartsheet API is documented here: http://smartsheet-platform.github.io/api-docs/

The Python SDK documentation can be viewed here: http://smartsheet-platform.github.io/smartsheet-python-sdk/.

Getting Started

Getting started with the Python SDK is easy:

  1. Set SMARTSHEET_ACCESS_TOKEN in your environment. Find out more about Authentication and Access Tokens in the Smartsheet API Documentation.

  2. Install the Smartsheet Python SDK from the Python Package Index, or by using "pip install smartsheet-python-sdk".

  3. Import the smartsheet module: import smartsheet

  4. Refer to the Smartsheet API Documentation for Python SDK usage examples.

See a sample application here: https://github.com/smartsheet-samples/python-read-write-sheet

Support

If you have any questions or issues with this SDK please post on StackOverflow using the tag "smartsheet-api" or contact us directly at api@smartsheet.com.

Contributing

If you would like to contribute a change to the SDK, please fork a branch and then submit a pull request.

Running the Tests

All

  1. Run pytest. Note, the integration and mock API tests will fail unless the mock server is running. See Mock API Tests and Integration Tests

Integration Tests

  1. Follow the instructions here
  2. Run pytest tests/integration

Mock API Tests

  1. Clone the Smartsheet SDK tests repo and follow the instructions from the README to start the mock server
  2. Run pytest tests/mock_api

Release Notes

Each release with notes is available for download on the Github Releases page.

About

Library that uses Python to connect to Smartsheet services (using API 2.0).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.2%
  • Makefile 0.8%