Skip to main content

Python utility for data storage in Google Cloud Environments.

Project description

gc_temp_tables lets you easily create and query temporary tables within Google Cloud environments. The user has the option to do this within a session or not. The user can also call an external table. The typical steps are:

  • Optional: initiate a session, using create_bq_session().

  • Optional: if using an external table (must be located in the Google Cloud bucket), get the external table configurations using `get_external_table_config(filename_in_bucket, bucket_dir).

  • Create a temporary table using create_temp_table(query). The query must follow the format '''CREATE TEMP TABLE temp_table AS () '''. Options to add a session and/or an external table.

  • Query a temporary table using query_temp_table().

  • Delete un-needed temporary table using query_temp_table(f'DROP TABLE {table_to_drop}').

gc_temp_tables was originally written to be used within the All of Us Researcher Workbench environment but can be used in other Google Cloud Environments.

#install the package if not already done
##pip install gc_temp_tables 

#import
from gc_temp_tables import gc_temp_tables as gct

#create/initialize a session 
session_id = gct.create_bq_session()

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

gc_temp_tables-0.0.2.tar.gz (2.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: gc_temp_tables-0.0.2.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.12

File hashes

Hashes for gc_temp_tables-0.0.2.tar.gz
Algorithm Hash digest
SHA256 adf4b654f8a880e8aa94d1746729f11b1cf09495127615ffb140a1682ee57a88
MD5 be6097badd04f122ff0062ede1b24093
BLAKE2b-256 b758e9df3ea1f407fa371deb30f5ffa52eaa398f7cc943bc7460c61425a3c5e4

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