Metadata-Version: 2.1
Name: gc_data_storage
Version: 0.0.1
Summary: Python utility for data storage in Google Cloud Environments.
Home-page: https://github.com/AymoneKouame/data-science-utilities/gc_temp_tables/
Author: Aymone Jeanne Kouame
Author-email: aymone.jk@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown


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()
```


