Skip to main content

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

Project description

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

Installation

pip install pyplatform-datawarehouse

Authentication and environment variables

Refer to main page for documentation on authentication

Exploring the modules

from pyplatform.datawarehouse import *
show_me()

Usage

querying BigQuery table

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 to BigQuery table

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

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

pyplatform-datawarehouse-2020.11.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file pyplatform-datawarehouse-2020.11.1.tar.gz.

File metadata

  • Download URL: pyplatform-datawarehouse-2020.11.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pyplatform-datawarehouse-2020.11.1.tar.gz
Algorithm Hash digest
SHA256 dd2fd837730f61aa96dc00d8b6e6da05829edb69e5f0fae31e4d66c8b456ce21
MD5 6e576c350b0e45159e022e54397a3577
BLAKE2b-256 105e0249343e5dc1617daabe22bd33ec72e59a043d78d79f656584ab0ca17cb1

See more details on using hashes here.

File details

Details for the file pyplatform_datawarehouse-2020.11.1-py3-none-any.whl.

File metadata

  • Download URL: pyplatform_datawarehouse-2020.11.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pyplatform_datawarehouse-2020.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f2ec4884988465f890d23547eff464834ba9692f42914851f9c8a72191fe7d0
MD5 89295982aaeb98f257e0cdaed9922f52
BLAKE2b-256 e63a93a9ec3c68d0af904f8fdc64ec62b19f6710793ec8b07f66b1307976147b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page