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']```

```python
%%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 preceded by @ in case one was planning to use @ just as character in that case please avoid using parameter

Installation

Run

from pandas_gbq_magic import magic
magic.install('You Bigquery Project name')

Restart Jupyter notebook

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.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandas_gbq_magic-1.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file pandas_gbq_magic-1.1.2.tar.gz.

File metadata

  • Download URL: pandas_gbq_magic-1.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pandas_gbq_magic-1.1.2.tar.gz
Algorithm Hash digest
SHA256 8beaa99107d200907a32c468f13976156512a84e1da3c796c141de7e5c55c971
MD5 f12cc9fd98de9b5f742345531bf5e8ea
BLAKE2b-256 22ab9268d0f5c3d80478809d8593b7d988507531b6269a331fc4c1e1e95beb6c

See more details on using hashes here.

File details

Details for the file pandas_gbq_magic-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pandas_gbq_magic-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14fff375070fb0f6aa4874ea870cd6a0fb04e800beaf8ac1acde758c0fab49b9
MD5 cb26ffceb8f2f62fa92a994cc55296dc
BLAKE2b-256 0b1433d905300214fac50134e38bf2c126256e4e8038016ba25a88c447b1f51d

See more details on using hashes here.

Supported by

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