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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file gc_temp_tables-0.0.3.tar.gz.
File metadata
- Download URL: gc_temp_tables-0.0.3.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7ca4fc13428c08cbf78fd600091c9e39d1cb8cf2d8b70d104299004225791ba
|
|
| MD5 |
d38684a53314659224f5ff2102c797fc
|
|
| BLAKE2b-256 |
d951be00127d39cbfbd40cf0716a2fdef42c38d4bb5cd63e7db0506dc579e865
|