Skip to main content

Utilities for working with Google Sheets: establishing a connection, reading data from a sheet, and uploading a DataFrame to Google Sheets with retry support.

Project description

English:

Google Sheets Utils Module

The module provides convenient utilities for working with Google Sheets. Features include establishing a connection to the Google Sheets API, reading data from a sheet, and uploading a DataFrame to Google Sheets with retry support.

Installation

bashCopy code
pip install gs-update-utils

Usage

Establishing a Connection

pythonCopy code
from gs-update-utils import setup_google_sheets

credentials_folder = "path/to/credentials" credentials_file = "credentials.json" google_credentials = setup_google_sheets(credentials_folder, credentials_file)

Reading Data from a Sheet

pythonCopy code
from gs-update-utils import read_gs_table

worksheet_id = "your_worksheet_id" worksheet_name = "your_worksheet_name" dataframe = read_gs_table(worksheet_id, worksheet_name, google_credentials)

Uploading DataFrame to Google Sheets

pythonCopy code
from gs-update-utils import upload_table_to_google_sheet

worksheet_id = "your_worksheet_id" worksheet_name = "your_worksheet_name" upload_table_to_google_sheet(dataframe, worksheet_id, worksheet_name, google_credentials)

Русский:

Модуль Google Sheets Utils

Модуль предоставляет удобные утилиты для работы с Google Sheets. Возможности включают установку соединения с API Google Sheets, чтение данных из листа и загрузку DataFrame в Google Sheets с поддержкой повторных попыток.

Установка

bashCopy code
pip install gs-update-utils

Использование

Установка соединения

pythonCopy code
from gs-update-utils import setup_google_sheets

credentials_folder = "path/to/credentials" credentials_file = "credentials.json" google_credentials = setup_google_sheets(credentials_folder, credentials_file)

Чтение данных из листа

pythonCopy code
from gs-update-utils import read_gs_table

worksheet_id = "your_worksheet_id" worksheet_name = "your_worksheet_name" dataframe = read_gs_table(worksheet_id, worksheet_name, google_credentials)

Загрузка DataFrame в Google Sheets

pythonCopy code
from gs-update-utils import upload_table_to_google_sheet

worksheet_id = "your_worksheet_id" worksheet_name = "your_worksheet_name" upload_table_to_google_sheet(dataframe, worksheet_id, worksheet_name, google_credentials)

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

gs_update_utils-1.0.4.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gs_update_utils-1.0.4-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file gs_update_utils-1.0.4.tar.gz.

File metadata

  • Download URL: gs_update_utils-1.0.4.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for gs_update_utils-1.0.4.tar.gz
Algorithm Hash digest
SHA256 eba710c330d8a8c0048c408439f5bfa3191230cac0856b422272f89e56c5a13d
MD5 43167431175c8369fa98e396aceffc98
BLAKE2b-256 e6d77e5ff2553d94d22719902de65436b185244a869100ad456ceeb520b62450

See more details on using hashes here.

File details

Details for the file gs_update_utils-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for gs_update_utils-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 853f74574ccca9b2aecbee247c38f95c28ec22dbf3bd5c9931fb8b0cb933220c
MD5 c784300fd5fc54d75d95f607ab186392
BLAKE2b-256 e4fd8b4f6a7ef48083d7c40c9bb3f5a8d5cbf4f1af340578b08651c3dd2a74d3

See more details on using hashes here.

Supported by

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