bigquery-schema-generator
BigQuery schema generator from JSON or CSV data
What it is and what it does
BigQuery Schema Generator is a command-line tool and Python library that infers BigQuery table schemas by scanning complete datasets. Unlike BigQuery's built-in auto-detection (which examines only the first 500 records), this tool processes all input records to produce a more accurate schema, especially useful when data fields are added organically over time and may not appear in early records.
The tool accepts newline-delimited JSON or CSV format on standard input and outputs a BigQuery-compatible schema in JSON format. It can be used as a standalone command-line utility or imported as a library for programmatic schema generation. It supports various options for handling nulls, quoted values, type inference modes, and schema merging with existing schemas.
Use it for:
- Generate accurate BigQuery schemas for datasets where fields appear sporadically across records, ensuring no data is lost during table creation.
- Pre-validate and generate schemas for CSV or JSON data before bulk loading into BigQuery using the bq load tool.
- Merge new schema information from incremental data exports with existing table schemas to keep them up-to-date.
- Debug and inspect inferred field types and structure from raw data files before committing to a table design.
- Automate schema generation in data pipelines where data format or structure may vary across sources.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates BigQuery table schemas from complete JSON or CSV datasets by analyzing all records, rather than relying on BigQuery's auto-detection which examines only the first 500 records.
Yes, with conditions. The tool fills a genuine gap in BigQuery's schema detection workflow. However, dormant maintenance (944 days since last release) and high install friction are concerns. Install if you regularly work with BigQuery data ingestion and need reliable schema inference across complete datasets; avoid if you need active maintenance or have strict dependency constraints.
Install
bigquery-schema-generator on PyPI
pip
pip install bigquery-schema-generatoruv
uv add bigquery-schema-generatorpoetry
poetry add bigquery-schema-generatorInstalling bigquery-schema-generator
Before you install
High install friction: the package is distributed as a source tarball with no runtime dependencies listed, suggesting potential build or environment setup requirements. Maintenance is dormant—last release was 944 days ago, though the repository remains active with a recent commit.
License in practice
Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions; suitable for both open-source and proprietary projects.
Quickstart
pip3 install bigquery-schema-generator
generate-schema < file.data.json > file.schema.json
# Or for CSV:
generate-schema --input_format csv < file.data.csv > file.schema.json
Requires Python 3.6 or higher; the generate-schema command may be installed in different locations depending on your Python environment (e.g., /usr/bin, /usr/local/bin, or ~/.local/bin).
Verify before relying
- Whether the high install friction is due to compiled dependencies, system libraries, or simply source-only distribution.
- Current compatibility with modern BigQuery API versions and schema features.
- Performance characteristics when processing very large datasets.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 944 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 787,914/month — #5,059 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bigquery-schema-generator-1.6.1.tar.gz
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
ddlparseParses CREATE TABLE DDL statements from MySQL,…
permissive · top 15,000 on PyPI
bigquery-magicsProvides IPython magic commands to query Google…
permissive · top 15,000 on PyPI
google-cloud-bigquery-storageProvides a Python client library for reading…
permissive · top 1,000 on PyPI
google-cloud-bigqueryPython client library for querying and managing…
permissive · top 1,000 on PyPI
google-cloud-bigquery-connectionManages BigQuery connections to external data…
permissive · top 15,000 on PyPI
dltdlt automates extraction, schema inference, and…
permissive · top 5,000 on PyPI
google-cloud-bigquery-datatransferPython client library for scheduling and…
permissive · top 1,000 on PyPI
bigquerySends data to Google BigQuery with minimal…
permissive · top 15,000 on PyPI
bigframesBigFrames provides a pandas-compatible…
permissive · top 5,000 on PyPI
jsonlinesSimplifies reading and writing jsonlines…
permissive · top 5,000 on PyPI