Skip to main content

Converts Smartsheet sheets and reports to a Pandas DataFrame

Project description

smartsheet-dataframe

Python library to ease movement of data between a Smartsheet or report and a Pandas DataFrame.

This package can be used alongside the smartsheet-python-sdk package or can be used standalone.

TODO: Implement functions to write to a sheet Implement usage of Pandas kwargs

To get a sheet as a dataframe:

from smartsheet_dataframe import get_as_df, get_sheet_as_df

# Standalone (without smartsheet-python-sdk)
df = get_sheet_as_df(token='smartsheet_auth_token',
                     sheet_id=sheet_id_int)

# Using 'generic' function (without smartsheet-python-sdk)                     
df = get_as_df(type_='sheet',
               token='smartsheet_auth_token',
               id_=sheet_id_int)

Alternatively, objects can be used from the smartsheet-python-sdk package.

from smartsheet_dataframe import get_as_df, get_sheet_as_df
import smartsheet

# Using smartsheet-python-sdk
smartsheet_client = smartsheet.Smartsheet('smartsheet_auth_token')
sheet = smartsheet_client.Sheets.get_sheet(sheet_id_int)

df = get_sheet_as_df(sheet_obj=sheet)

# And using the 'generic' function
df = get_as_df(type_='sheet',
               obj=sheet)

To get a report as a dataframe:

    from smartsheet_dataframe import get_as_df, get_report_as_df
    
    # Standalone (without smartsheet-python-sdk)
    df = get_report_as_df(token='smartsheet_auth_token',
                          report_id=report_id_int)
    
    # Using 'generic' function (without smartsheet-python-sdk)                     
    df = get_as_df(type_='report',
                   token='smartsheet_auth_token',
                   id_=report_id_int)

And using a report object from the smartsheet-python-sdk package.

from smartsheet_dataframe import get_as_df, get_sheet_as_df
import smartsheet

# Using smartsheet-python-sdk
smartsheet_client = smartsheet.Smartsheet('smartsheet_auth_token')
sheet = smartsheet_client.Reports.get_report(sheet_id_int)

df = get_sheet_as_df(sheet_obj=sheet)

# And using the 'generic' function
df = get_as_df(type_='sheet',
               obj=sheet)

Installation

Requirements
  • Python 3+ (Tested using 3.6.5+)
  • Pandas >= 0.24.0
From PyPI
pip install smartsheet-dataframe

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartsheet-dataframe-0.3.4.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

smartsheet_dataframe-0.3.4-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file smartsheet-dataframe-0.3.4.tar.gz.

File metadata

  • Download URL: smartsheet-dataframe-0.3.4.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for smartsheet-dataframe-0.3.4.tar.gz
Algorithm Hash digest
SHA256 4af0969846ae192e4df523f657d826eefe051f7e8db5436c20c94b3ec1dc8c37
MD5 7f8b3738d5071dbbce334f8e8858a9d7
BLAKE2b-256 53c36a685179df04a16c5d8d4f98979cc8ee8de58b63082b409e5e636ed1d139

See more details on using hashes here.

File details

Details for the file smartsheet_dataframe-0.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for smartsheet_dataframe-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9a8b3c4680590f21c969a90336359926d02c70ed0d5d7c2822a3a933431def58
MD5 7b4345d748e121f3c48fe9e2b8c50e4f
BLAKE2b-256 0e2d583724c8a0505777d4dcfa5300fe4ef9cf02e0cd97cfd0d01c3d5b91b4ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page