Linux Python 3.6 script example to download a Smartsheet?


I've been searching for several days for a Python SDK script to download a Smartsheet that I have previously created. I have an existing Smartsheet with 5 columns, and 2690 rows. I only want to download the first column which is a number and assign it to an array.

What I've tried so far:


Smartsheet offers a solution where I can the Internet URL to the Excel Data Source. However, when I try retrieving the data, I get a timeout. There is about 2690 rows and 5 columns to download.

Searching the Internet, I found a potential Python solution using an app and attempted to install pip install simple-smartsheet. The install results in "already satisfied" messages when running.

However, when I try to run their example script:


import os

from datetime import date

from pprint import pprint

from simple_smartsheet import Smartsheet

from simple_smartsheet.models import Sheet, Column, Row, Cell, ColumnType

# SMARTSHEET_API_TOKEN is in the Environment


SHEET_NAME = "[TEST] My New Sheet"

smartsheet = Smartsheet(TOKEN)

I get the error:

pi@SmartSheet:~/Documents/tscripts $ ./

./ line 1: import: command not found

from: can't read /var/mail/datetime

from: can't read /var/mail/pprint

from: can't read /var/mail/simple_smartsheet

from: can't read /var/mail/simple_smartsheet.models

./ line 8: syntax error near unexpected token `('

./ line 8: `TOKEN = os.getenv("SMARTSHEET_API_TOKEN")'


Thank you!



  • Alejandra
    Alejandra Employee

    Hi @Michael Tuccillo,

    I think you need to either add the following as the first line of your script:

    #!/usr/bin/env python




    invoke it on the command line with python or python3

    Also, if you have access to Microsoft Power Automate, you may be able to use Power Automate with an HTTP request to Smartsheet, copy the column to an Excel Spreadsheet and use the Transpose formula in Excel (No code required).