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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for smartsheet_dataframe-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a3806821e01a6dc26ae6eebf8727c019a04784fed7bbcde204d9cbea0e30a9e |
|
MD5 | 752dbb68f9e1b6a71f640b42e0a50c23 |
|
BLAKE2b-256 | 1518298b42ad6d2a14e9dcf71d5b10a8cd2fca26029cb06bdf0953469d89bba3 |
Close
Hashes for smartsheet_dataframe-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ac3652cc4a4283a53d23929f3cfb83e02836269c2b33a1c1d9a46c6a6f5529a |
|
MD5 | 9e416ec3c249410852a1c29554ace8ef |
|
BLAKE2b-256 | c9c3f2df73ac456449e1132261b04562683bcafca5bb40679f69def2963254f3 |