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 and initialize
## When initializing,  use the default AllofUS Researcher workbench bucket or input your own
from gc_temp_tables import gc_temp_tables as gct
gct = gct()

#list data in the bucket root directory 
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.1.tar.gz (2.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: gc_temp_tables-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 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.1.tar.gz
Algorithm Hash digest
SHA256 c1ca9f1a278da82ce1c2083707b0ae4d8375eb88f47d6e0defbed54490bac46f
MD5 0beb5cec077592af295502dacb6367e2
BLAKE2b-256 f3f54b7289cb9bf2ab6ff92153bc88021d088f282e6f79412c65ac4f0d80ec74

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