Skip to main content

A wrapper to use pygsheets

Project description

Setup

How to save your 'GS_SERVICE_ACCOUNT' env-var to use this code

Your 'GS_SERVICE_ACCOUNT' needs to be the whole json file as a string instead of the path to the file.
Then, it also needs to be encrypted. To have the correct format, copy the json file contents to your clipboard, then
go in the terminal and execute `pbpaste | base64 | pbcopy`. These commands will encrypt the json content and put it back
to your clipboard. Then just paste the encrypted contents to your local env-var

i.e.

copy the content of the .json file to your memory and run the following in terminal:

pbpaste | base64 | pbcopy

this will give you an encrypted string

save this sting as a envar called GS_SERVICE_ACCOUNT

Initiate

from pyKadabra import kinesis

sheet_url = 'https://docs.google.com/spreadsheets/d/1Alaj8Pb6sy3_W2oGb9WUoYznFof5W7kigAx/edit?usp=sharing'
working_sheet = kinesis.gsheets_handler(gsheet_url=sheet_url)

Usage examples

create sheet
working_sheet.create_sheet(worksheet='Psybeam')
delete
working_sheet.delete_sheet(worksheet='Psyshock') # sheet with name
working_sheet.delete_sheet(worksheet=1) # sheet with index
writ to sheets
working_sheet.write_to_sheet(input_dataframe=df_test, worksheet='Future Sight') # sheet with name
working_sheet.write_to_sheet(input_dataframe=df_test, worksheet=2) # sheet with index
count rows
working_sheet.count_rows(worksheet='Future Sight')
clear range
working_sheet.clear_range(worksheet='Future Sight') # entire sheet
working_sheet.clear_range(worksheet='Future Sight', clear_range_str='B2:D4') # subsection only
read from sheets
df_read = working_sheet.read_sheet(worksheet='Future Sight') # sheet with name
df_read = working_sheet.read_sheet(worksheet=1) # sheet with index
df_read2 = working_sheet.read_sheet(worksheet='Future Sight', target_range_str='B1:C4') # subsection only

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

pykadabra-0.0.2.tar.gz (5.7 MB view details)

Uploaded Source

Built Distribution

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

pykadabra-0.0.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pykadabra-0.0.2.tar.gz.

File metadata

  • Download URL: pykadabra-0.0.2.tar.gz
  • Upload date:
  • Size: 5.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pykadabra-0.0.2.tar.gz
Algorithm Hash digest
SHA256 89f7a3e30c13342ff165354dd8c8eda9e0d9773a13a876756c94e4d7406ab42b
MD5 57cffc9a96392ae4fae533a34280979c
BLAKE2b-256 43fbcd38cfedb338d2e3d86968384f62391b968364e71bfc4467c504d82cf8c0

See more details on using hashes here.

File details

Details for the file pykadabra-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pykadabra-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pykadabra-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 713c05f2ea2234e118b0b6e3953cccc79137ed7b8b6df0fd9d21e86b6215c3c3
MD5 eb26c440809d7de7ead5c73d8f865dac
BLAKE2b-256 64d391cdb8a9d11b61701585d534bafb1719c7c437a053467d989d060bc71dbb

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