Skip to main content

The package provides as magic on top of Pandas GBQ to make querying in Jupter envioronment easy and user friendly

Project description

Big-Query-Magic

The package has been created for Mac OS

Requirements

It is assumed that you have basic packages like pandas installed Install Auth2client and pandas_gbq Ensure that you can query data using pandas gbq


This packacge installs a magic in your startup directory which makes querying in jupyter environment more user friendly and easier to use.Post intallation simply type %%BQSQL and write your query example

%%BQSQL
SELECT * 
FROM table 
LIMIT 10; 

There are other features also present which makes it even more user friendly which can be explained with help of the argument this magic can take

-job [Y or None] If Y is passed as job argument this will run just the query but will not pull the out put, this is useful when one is creating a large temp table during the workflow and does not want to download and load it in python, the existing pandas_gbq does not offer that

-save_to [Table Name] Pass a variable in which the output needs to be store

Note Do not pass both the arguments at the same time

-para [Y or None] If Y is passed the query will look if parameters or python variables are used in the query. Yes this is one of the best features of this magic you can use python variables directly in your query

example

x = ['user1','user2']

%%BQSQL -para Y -job Y
SELECT * 
FROM table 
WHERE user_id IN @x 

Currently string int and list of these two can be passed as a parameter. Note parameter needs to be preceeded by @ in case one was planning to use @ just as character in that case please avaoid using parameter

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

pandas_gbq_magic-1.1.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

pandas_gbq_magic-1.1.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

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