Metadata-Version: 2.1
Name: pyplatform-datawarehouse
Version: 2020.8.1
Summary: Pyplatform-datawarehouse package provides functions for querying, writing and managing data in Google BiqQuery.
Home-page: https://github.com/mhadi813/pyplatform
Author: Muhammad Hadi
Author-email: mhadi813@gmail.com
License: BSD
Keywords: google bigquery cloud functions storage jupyterlab python SQL
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Office/Business
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Description-Content-Type: text/markdown
Requires-Dist: google-cloud-bigquery (>=1.24.0)
Requires-Dist: google-cloud-bigquery-storage
Requires-Dist: pyarrow (==0.16.0)
Requires-Dist: xlrd
Requires-Dist: XlsxWriter
Requires-Dist: openpyxl
Requires-Dist: pyplatform-common

### Pyplatform-datawarehouse package provides functions for querying, writing and managing data in Google BiqQuery.

## Installation
```python
pip install pyplatform-datawarehouse
```
## Authentication and environment variables
Refer to [main page](https://github.com/mhadi813/pyplatform) for documentation on authentication

## Exploring the modules
```python

from pyplatform.datawarehouse import *
show_me()
```

## Usage
### querying BigQuery table
```python
import pyplatform.datawarehouse as dw
sql = """SELECT Order_ID, Order_Date, Ship_Date, Ship_Mode, Customer_ID, Customer_Name, Segment 
FROM `project_id.dataset.sample_superstore` """
df = dw.bq_to_df(sql)
df.head()

# select statemet is enclosed in the stored procedure
sql = """CALL `project_id.dataset.spoc_sample_superstore`();"""
df = dw.bq_to_df(sql)
df.head()

```
### writing dataframe BigQuery table
```python
import pyplatform.datawarehouse as dw
# df #TODO create dataframe as source
table_id = 'project_id.dataset.sample_superstore'
job = dw.df_to_bq(df,table_id)

print(dw.bq_get_job_info(job))

```

