smartools is a wrapper around the official smartsheet-python-sdk. It monkey patches several classes to add new functionality, and also implements some completely new classes/models as well.
The decision was made to monkey patch the smartsheet sdk rather than fork it because by extending the existing package, this package can be updated independently of the original sdk and sis not dependent on a specific version.
The package is available to install from PyPi using:
pip install smartools
Once installed it can be imported with import smartools
or can more "authentically" replace the official sdk by using import smartools as smartsheet
In general, usage of smartools is identical to the standard SDK. All original functionality is supported so any existing code should not need to be updated. For more information, see the Smartsheet API Docs.
smartools allows you to easily compare sharing permissions using the standard >, <, >=, >=, == methods. This can be useful when writing code that will evaluate whether a user has high enough permissions to perform an action. Smartools also has added support for the COMMENTER permission level. It also includes a new permission level, "UNSHARED" that can be used for comparisons. That permission level simply indicates that somethng isn't shared to you, and is only ever returned when using a get_access_level
method.
sheet = smartsheet_client.Sheets.get_sheet(sheet_id)
sheet.access_level # EDITOR_SHARE
sheet.access_level >= 'EDITOR' # True
sheet.access_level == 'OWNER' # False
sheet.access_level > 'EDITOR' # True
sheet.access_level != 'UNSHARED' # True - This is a new "permission level" exclusive to smartools
Rows now allow you to get their child rows by accessing row.children.
sheet = smartsheet_client.Sheets.get_sheet(sheet_id)
sheet.rows[0].children # Will return a list of child rows
Some of the greatest improvements to smartools are in the indexing of lists. Rows, Columns, and Cells can now be indexed using strings, as explained below.