Export a pandas dataframe to a online spreadsheet.
Project description
Export a pandas dataframe to an online spreadsheet
The online spreadsheet such as Google Sheets, Feishu Docs, is a good way to share data with others and is a powerful tool for data analysis and visualization. This package provides a simple way to export a pandas dataframe to a online spreadsheet.
Installation
You can install this package from PyPI using pip:
pip install dataframe-to-online-spreadsheet
Usage
Feishu Docs
- You need to register a Feishu team and get the manager_ids from Feishu Admin. Fortunately, it is free for a small team.
- You need to create an app and get the app_id and app_secret from Feishu Open Platform.
import pandas as pd
import dataframe_to_online_spreadsheet.feishu
import os
def test_feishu():
app_id = os.getenv("APP_ID")
app_secret = os.getenv("APP_SECRET")
sheet1_data = pd.read_csv("./tests/test_data1.csv")
token = sheet1_data.feishu.to_spreadsheet(app_id, app_secret, title="Daily Report", data={'title': 'sheet_name1', 'data': sheet1_data}, manager_ids=['xxx'])
sheet2_data = pd.read_csv("./tests/test_data2.csv")
token = sheet2_data.feishu.to_spreadsheet(app_id, app_secret, title="Daily Report", data={'title': 'sheet_name2', 'data': sheet2_data}, manager_ids=['xxx'], spreadsheet_token=token)
sheet3_data = pd.read_csv("./tests/test_data3.csv")
token = sheet3_data.feishu.to_spreadsheet(app_id, app_secret, title="Daily Report", data={'title': 'sheet_name3', 'data': sheet3_data}, manager_ids=['xxx'], spreadsheet_token=token)
logging.info(f"spreadsheet token: {token}")
assert token
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 dataframe_to_online_spreadsheet-0.1.8.tar.gz
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 3e3ab88f138015a17c26f6875f8e70c82d039aefd6fa21a9421f632ccff53b07 |
|
| MD5 | 7c43381a57fc19bb63ab52ee0b56f1ec |
|
| BLAKE2b-256 | 272f799f5b86a0b5f7f8574a27a21873fab5efc4935ad7acc60f5a63ca6810ca |
Close
Hashes for dataframe_to_online_spreadsheet-0.1.8-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 601df444b3254baa349e9c0f6acfcd5468da525345977f1a0cd18ebdd3dc73e6 |
|
| MD5 | ee86fe75636bc7a2f754eceb2969f3b3 |
|
| BLAKE2b-256 | 66b17f389bb5774fc50bab62c0982394b98f20f851e35e7879c19c9474dc3590 |