Registry / crm-productivity / smartsheet-python-sdk

smartsheet-python-sdk

JSON →
library4.4.0pypypi✓ verified 22d ago

The Smartsheet Python SDK is a library for connecting Python applications to Smartsheet services using API 2.0. It provides a programmatic interface to manage sheets, rows, columns, users, and other Smartsheet resources. The library simplifies interaction with the Smartsheet API, handling authentication, request serialization, and response deserialization. It is actively maintained, with the current version being 3.7.2, and typically sees updates for API endpoint changes and new features.

pip install smartsheet-python-sdk
INSTALL
IMPORT
SIG · SMARTSHEET-PYTHON-
S
smartsheet-python-sdk
crm-productivitypythonv4.4.0
Install
2.5s avg
Import
522ms
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.540s · 24.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.504s · 25MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Smartsheet
from smartsheet import Smartsheet
import smartsheet smart = smartsheet.Smartsheet()

This quickstart initializes the Smartsheet client using an API access token from environment variables. It then lists the user's sheets and retrieves details for the first one found. It also demonstrates how to enable exceptions for API errors.

import smartsheet import os # Ensure SMARTSHEET_ACCESS_TOKEN is set in your environment variables # You can generate an access token in Smartsheet UI under Account > Personal Settings > API Access. access_token = os.environ.get('SMARTSHEET_ACCESS_TOKEN', '') if not access_token: print("Error: SMARTSHEET_ACCESS_TOKEN environment variable not set.") print("Please generate an access token from Smartsheet and set it.") else: try: # Create a Smartsheet client smart = smartsheet.Smartsheet(access_token) # Optional: Enable exceptions for API errors instead of returning Error objects smart.errors_as_exceptions(True) # List all sheets the authenticated user has access to response = smart.Sheets.list_sheets() if response.data: first_sheet = response.data[0] print(f"Found sheet: {first_sheet.name} (ID: {first_sheet.id})") # Get a specific sheet by ID sheet = smart.Sheets.get_sheet(first_sheet.id) print(f"The sheet '{sheet.name}' has {sheet.total_row_count} rows.") else: print("No sheets found for this user.") except smartsheet.exceptions.SmartsheetException as e: print(f"An error occurred: {e}") except Exception as e: print(f"An unexpected error occurred: {e}")
Debug
Known issues
gotchaAuthentication primarily relies on the `SMARTSHEET_ACCESS_TOKEN` environment variable for direct API access. For application development, OAuth 2.0 is supported but requires more setup. Misconfiguring or not setting the access token is a common source of 'Unauthorized' errors.
fix
Generate an API access token from your Smartsheet personal settings and set it as the `SMARTSHEET_ACCESS_TOKEN` environment variable. For OAuth, follow the official Smartsheet API documentation.
affects: All
gotchaBy default, the SDK returns `Error` objects instead of raising exceptions for API errors. This can lead to silent failures if not handled correctly. Ensure you check the return type of API calls.
fix
Call `smartsheet_client.errors_as_exceptions(True)` after initializing your client to make the SDK raise `smartsheet.exceptions.SmartsheetException` instances for API errors, allowing for standard Python exception handling.
affects: All
breakingSmartsheet API endpoints are periodically updated or deprecated. Older SDK versions might not support new endpoints or parameters, leading to unexpected behavior or `AttributeError` if attempting to call non-existent methods.
fix
Always keep the `smartsheet-python-sdk` up-to-date (`pip install --upgrade smartsheet-python-sdk`). Consult the `CHANGELOG.md` in the GitHub repository for breaking changes and new endpoint support.
affects: <3.x for some specific endpoints/parameters; ongoing for new API changes
gotchaMany list operations (e.g., listing sheets, rows, contacts) are paginated by default. If you need all results, you must either explicitly pass `include_all=True` to the list method or implement manual pagination using `page` and `page_size` parameters.
fix
When calling list methods, review the documentation for pagination parameters. Use `include_all=True` for convenience, or loop through `page` and `page_size` for fine-grained control.
affects: All
gotchaAccessing model creation methods (e.g., for Sheet, Column, Row objects) directly from `smartsheet.Smartsheet.models.ClassName` instead of using the methods on the instantiated service objects (e.g., `smart.Sheets.add_sheet()`) or correctly creating model instances, can lead to `AttributeError`.
fix
When creating or manipulating objects, ensure you're using the correct methods on the client's service objects (e.g., `smart.Sheets.create_sheet()`) or correctly instantiating model classes with `smartsheet.Smartsheet.models.Sheet({'name': 'New Sheet'})` before passing them to service methods.
affects: All
Upgrade
Version history
4.4.0latest on PyPI · released Aug 12, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
34
OpenAI (training)
1
Resources
smartsheet-python-sdk — pip install smartsheet-python-sdk · libregistry