bigquery-magics
Google BigQuery magics for Jupyter and IPython
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-magicsuv
uv add bigquery-magicspoetry
poetry add bigquery-magicsInstalling 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
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
emr-notebooks-magicsProvides iPython magics for Amazon EMR…
permissive · top 5,000 on PyPI
google-cloud-bigqueryPython client library for querying and managing…
permissive · top 1,000 on PyPI
bigquery-schema-generatorGenerates BigQuery table schemas from complete…
permissive · top 15,000 on PyPI
jupysqlAdds SQL execution to Jupyter and IPython…
permissive · top 15,000 on PyPI
pandas-gbqpandas-gbq reads data from Google BigQuery into…
permissive · top 1,000 on PyPI
pybigquerySQLAlchemy dialect for BigQuery that enables…
permissive · top 15,000 on PyPI
sqlalchemy-bigquerySQLAlchemy dialect that enables you to use…
permissive · top 1,000 on PyPI
google-cloud-bigquery-storageProvides a Python client library for reading…
permissive · top 1,000 on PyPI
google-cloud-bigquery-biglakePython client library for accessing BigLake…
permissive · top 5,000 on PyPI
google-cloud-bigquery-connectionManages BigQuery connections to external data…
permissive · top 15,000 on PyPI