skillfed

bigquery-magics

Google BigQuery magics for Jupyter and IPython

bigquery-magics v0.15.1 226.2K downloads/30d#9,204 on PyPI5,373
Permissive license Apache 2.0 Active released

What it is and what it does

bigquery-magics extends IPython and Jupyter with magic commands that let you write and execute BigQuery SQL queries directly in notebook cells. Instead of writing Python code to instantiate a client and fetch results, you use `%%bigquery` to run SQL and get back a pandas DataFrame automatically. The package wraps google-cloud-bigquery and handles the connection, authentication, and result formatting for you.

It's designed for data analysts and engineers working in Jupyter environments who want to explore BigQuery datasets interactively without leaving the notebook. The magic commands integrate with the notebook's display system to show query results inline, and they depend on ipywidgets, ipython, and pandas to provide a seamless interactive experience. You must have a Google Cloud project with BigQuery enabled and valid credentials configured before use.

Use it for:

  • Exploratory data analysis on BigQuery tables directly from a Jupyter notebook without writing boilerplate client code.
  • Teaching or documenting BigQuery SQL workflows in notebooks where SQL queries are the primary focus.
  • Building data science workflows where analysts switch between SQL queries and pandas manipulation in the same notebook.
  • Prototyping analytics queries interactively before deploying them to production pipelines.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides IPython magic commands to query Google BigQuery directly from Jupyter notebooks and IPython shells, with results returned as pandas DataFrames.

Yes, if you work with BigQuery in Jupyter notebooks. Low install friction, active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. The package solves a real friction point—writing SQL queries in notebooks without boilerplate—and integrates cleanly with the IPython ecosystem. Prerequisite: you must already have a Google Cloud project with BigQuery API enabled and authentication set up.

Install

bigquery-magics on PyPI

pip

pip install bigquery-magics

uv

uv add bigquery-magics

poetry

poetry add bigquery-magics

Installing bigquery-magics

Before you install

Low install friction; pure Python wheel with no compiled dependencies. Actively maintained with a recent release and 5373 repository stars. Supports current Python versions (3.10–3.14).

License in practice

Apache 2.0 permissive license allows use in commercial and open-source projects with minimal restrictions.

Quickstart

pip install bigquery-magics

In a Jupyter notebook:
%load_ext bigquery_magics
%%bigquery
SELECT name, SUM(number) as count
FROM 'bigquery-public-data.usa_names.usa_1910_current'
GROUP BY name ORDER BY count DESC LIMIT 3

Requires Python >= 3.10; Google Cloud project with BigQuery API enabled and authentication configured (service account or user credentials).

Verify before relying

  • Whether the package handles authentication transparently via Application Default Credentials or requires manual setup in all cases.
  • Performance characteristics when querying very large result sets or long-running queries.

Package facts

License Apache 2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 11 — db-dtypes, google-cloud-bigquery, ipywidgets, ipython, ipykernel, packaging, pandas, pyarrow, pydata-google-auth, tqdm, pyopenssl
Maintenance actively maintained — 8 days since the last release
Last repo commit
First released
Downloads 226,221/month — #9,204 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: bigquery_magics-0.15.1-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet

Tags

bigquery jupyter magic commandsipython bigquery queriesnotebook sql bigquerygoogle cloud bigquery magicsjupyter bigquery integration
jupyter-integrationbigquerysql-notebook

More Internet packages

botocore

Botocore provides low-level, data-driven access…

permissive · top 100 on PyPI

aiobotocore

Provides an async client for AWS services using…

permissive · top 100 on PyPI

pydantic

Pydantic validates Python data structures…

permissive · top 100 on PyPI

filelock

Provides a platform-independent file locking…

permissive · top 100 on PyPI

fastapi

FastAPI is a Python web framework for building…

permissive · top 100 on PyPI

googleapis-common-protos

Provides common Protocol Buffer message…

permissive · top 100 on PyPI

emr-notebooks-magics

Provides iPython magics for Amazon EMR…

permissive · top 5,000 on PyPI

google-cloud-bigquery

Python client library for querying and managing…

permissive · top 1,000 on PyPI

bigquery-schema-generator

Generates BigQuery table schemas from complete…

permissive · top 15,000 on PyPI

jupysql

Adds SQL execution to Jupyter and IPython…

permissive · top 15,000 on PyPI

pandas-gbq

pandas-gbq reads data from Google BigQuery into…

permissive · top 1,000 on PyPI

pybigquery

SQLAlchemy dialect for BigQuery that enables…

permissive · top 15,000 on PyPI

sqlalchemy-bigquery

SQLAlchemy dialect that enables you to use…

permissive · top 1,000 on PyPI

google-cloud-bigquery-storage

Provides a Python client library for reading…

permissive · top 1,000 on PyPI

google-cloud-bigquery-biglake

Python client library for accessing BigLake…

permissive · top 5,000 on PyPI

google-cloud-bigquery-connection

Manages BigQuery connections to external data…

permissive · top 15,000 on PyPI