This library is intended to simplify connecting to the Smartsheet API from Python applications.
The SDK currently supports Python 2.7, 3.3, 3.4, 3.5, 3.6, pypy, and pypy3. The following packages are required.
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.
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
To install this SDK manually, download the source code from GitHub and then run:
$ python setup.py install
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)
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 with the Python SDK is easy:
-
Set SMARTSHEET_ACCESS_TOKEN in your environment. Find out more about Authentication and Access Tokens in the Smartsheet API Documentation.
-
Install the Smartsheet Python SDK from the Python Package Index, or by using "pip install smartsheet-python-sdk".
-
Import the smartsheet module:
import smartsheet
-
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
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.
If you would like to contribute a change to the SDK, please fork a branch and then submit a pull request.
- Run
pytest
. Note, the integration and mock API tests will fail unless the mock server is running. See Mock API Tests and Integration Tests
- Follow the instructions here
- Run
pytest tests/integration
- Clone the Smartsheet SDK tests repo and follow the instructions from the README to start the mock server
- Run
pytest tests/mock_api
Each release with notes is available for download on the Github Releases page.