A helper library for some BigQuery related stuff.

pypi package

Install

pip install am4894bq

Quickstart

from am4894bq.schema import get_schema

# get a schema for a sample table
schema = get_schema('bigquery-public-data.samples.shakespeare')
schema
[SchemaField('word', 'STRING', 'REQUIRED', 'A single unique word (where whitespace is the delimiter) extracted from a corpus.', ()),
 SchemaField('word_count', 'INTEGER', 'REQUIRED', 'The number of times this word appears in this corpus.', ()),
 SchemaField('corpus', 'STRING', 'REQUIRED', 'The work from which this word was extracted.', ()),
 SchemaField('corpus_date', 'INTEGER', 'REQUIRED', 'The year in which this corpus was published.', ())]

Examples

You can see some example notebooks in the examples folder of the repository.