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_data_storage-0.0.1.tar.gz (2.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: gc_data_storage-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_data_storage-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ba5130e831f0bfbea61aaa8952434c09145d1d4abe4f7519d988030dd0ea31fc
MD5 784c2c8d200bbb3fa4e6c5ba1cb8980b
BLAKE2b-256 0335465690bc31a0a7362c5c2ea8d993a99ebc39d29f4866c92ffd59656431ab

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