Skip to main content

A helper package to use common functions

Project description

Helpful Helper

A (so far) little package that contains commonly used and useful functions. Good for team morale as they say.

About

Contents include functions for connecting to redshift and using gspread, a py library for writing and reading from google sheets. For help with what functions are available, please run get_help() after importing helpful-pys.

Official pypi

Installation

To install functional-functions, you can install it using pip:

pip install helpful-pys

Within your jupyter lab/notebook setup:

from helpful_pys import helpers

helpers.get_help()

Before Using

Once the package is installed, your package will be found within your site-packages folder

  1. Rename your local creds file within the helpful_pys(rename creds.py.sample to creds.py)
  2. Please authorize access to google sheets API and insert generated service account key into your local creds file, see Additional prerequisites for more details
  3. Please fill in your redshift creds into the local creds file before using

Additional Prequisites

The package will install gspread but will require further setup to get it running. I recommend using the gspread documentation for Authentication which will allow you to authorize the google sheets API and generate a service account key.

Don't forget the client-email in your key, it will be constantly needed to give share access to sheets for usage with gspread.

I have included a creds.py.sample file in the package to allow the user to input their personal creds to use. If there are better access/security storage policies like AWS Secrets Manager, this repo can be updated to accommodate such.

Usage

This package is intended for usage with local py setups and local jupyter notebook/lab setups. It is not intended for production script usage.

Querying Redshift

q = "select * from that_table limit 100"

result_df = helpers.query_redshift(q)

Using gspread

gc = helper.gsheets_start()

workbook = gc.open_by_url('googlesheetsurlhere')

workbook.update_title("Really Cool and Helpful Workbook")

ws = test.worksheet('Sheet1')
ws.update_title("The coolest worksheet")


data_formatted = data[['id','helpful_id','cool_id']].copy()

ws.update([data_formatted.columns.values.tolist()] + data_formatted.values.tolist())

More gspread example use cases

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

helpful_pys-0.2.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

helpful_pys-0.2.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file helpful_pys-0.2.2.tar.gz.

File metadata

  • Download URL: helpful_pys-0.2.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for helpful_pys-0.2.2.tar.gz
Algorithm Hash digest
SHA256 382af63b8dc86b51d24412bb6e0d9db26f138ab90aad53da3f7635e1dcf0ac88
MD5 5f259c000b34465d74bf26b63192aad7
BLAKE2b-256 b27e0a9de02525824ead2fcd8e7d1da915c8b1d2a8423e6855480168c876eb75

See more details on using hashes here.

File details

Details for the file helpful_pys-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: helpful_pys-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for helpful_pys-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9879ab823528548e876b00e501d4fe66b95376e62913de2da193e8cec36ac2e3
MD5 ce6b65e4910204d417b4966df85ad4f0
BLAKE2b-256 0ce592a3168bb8ac33b1440113127ddc65343515c8384eadb0bbbf6cea5b06c7

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