Skip to main content

A Python package for manipulating google sheets directly on any coding platform and perform CRUD process easily. Sheets can be stored and retrieved in firebase storage

Project description

GPYCRAFT

SVG

This python module makes it possible to manipulate google sheets or any sheets stored in firebase storage. It allows for manipulation and display sheet data in a convenient way for analysis. It supports creation of API to google sheet

Before Starting it is neccessary to have credentials.json file found in Google cloud platform and make sure the google sheet link is shareable

Read data from Google Sheets

data = db.read_sheet(key='column_name', number_of_rows=5, start_index=1, end_index=10) key: The column name to filter data by. number_of_rows: The number of rows to retrieve. start_index and end_index: The range of rows to retrieve. Converting Data to Pandas DataFrame in_pd Method python Copy code

Convert data to Pandas DataFrame

df = db.in_pd() Converting Data to JSON in_json Method python Copy code

Convert data to JSON

json_data = db.in_json(target_key='column_name', num_rows=5, start_index=1, end_index=10) target_key: The specific key to include in the JSON output. num_rows: The number of rows to include in the JSON output. start_index and end_index: The range of rows to include in the JSON output. FireStoreUpload Class Initialization python Copy code from googlepycraft.fireStore.firestoreupload import FireStoreUpload Initialize the FireStoreUpload class with the path to your Firebase service account credentials JSON file and the name of your Firebase Storage bucket.

python Copy code uploader = FireStoreUpload(credentials_path='path/to/firebase_credentials.json', storage_bucket='your_storage_bucket_name') Uploading Files to Firebase Storage upload_file Method python Copy code

Upload a file to Firebase Storage

uploader.upload_file(local_file_path='path/to/local/file.txt') local_file_path: The local path of the file to be uploaded. Example Usage python Copy code

Example usage of gsheetsdb

db = gsheetsdb(credentials_path='path/to/credentials.json', sheet_url='https://docs.google.com/spreadsheets/d/your_spreadsheet_id/edit') data = db.read_sheet(key='column_name', number_of_rows=5, start_index=1, end_index=10) df = db.in_pd() json_data = db.in_json(target_key='column_name', num_rows=5, start_index=1, end_index=10)

Example usage of FireStoreUpload

uploader = FireStoreUpload(credentials_path='path/to/firebase_credentials.json', storage_bucket='your_storage_bucket_name') uploader.upload_file(local_file_path='path/to/local/file.txt')

Note: Make sure to replace placeholders such as path/to/credentials.json, your_spreadsheet_id, your_storage_bucket_name, etc., with your actual file paths and identifiers.

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

gpycraft-1.0.3.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

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

gpycraft-1.0.3-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file gpycraft-1.0.3.tar.gz.

File metadata

  • Download URL: gpycraft-1.0.3.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for gpycraft-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c105ce36a3cf5c1f5cd9d803f9b14c220a67c0e35bf41227b6b286fa08937149
MD5 235ca10600aee1f7c1fc4683b02881e3
BLAKE2b-256 8c072d6106196d78260c02ae8362bc18c109381d98191f0e55f4a2ed45294005

See more details on using hashes here.

File details

Details for the file gpycraft-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: gpycraft-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for gpycraft-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b080087c2344ac636afec61af7c7f5809154d8ab833a320dc6bc532c2cefd502
MD5 06c79863914bb52ced27a88070fdf1a8
BLAKE2b-256 167e0d4628119938c946932591cbf065ea91458e0e33ba52d3b041be5d0ae4bf

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