Skip to content

๐Ÿ“Š ๐Ÿ Create tables in Google BigQuery, auto-generate their schemas, and retrieve said schemas.

License

Notifications You must be signed in to change notification settings

hackersandslackers/bigquery-python-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0a70a72 ยท Jun 23, 2024

History

74 Commits
Jun 23, 2024
Feb 17, 2021
Feb 9, 2021
Feb 9, 2021
Feb 9, 2021
Apr 3, 2020
Feb 17, 2021
Feb 9, 2021
Feb 17, 2021
Feb 9, 2021
Feb 9, 2021
Feb 17, 2021
Feb 9, 2021
Aug 15, 2020
Feb 17, 2021

Repository files navigation

Google BigQuery Python SDK Tutorial

Python Google Cloud BigQuery Google Cloud Storage GitHub Last Commit GitHub Issues GitHub Stars GitHub Forks

Google BigQuery Python SDK

Source for the accompanying tutorial: https://hackersandslackers.com/google-bigquery-python/

Getting Started

Get set up locally in two steps:

Environment Variables

Replace the values in .env.example with your values and rename this file to .env:

  • GCP_PROJECT_ID: ID of your Google Cloud Project.
  • GOOGLE_APPLICATION_CREDENTIALS: Filepath to JSON containing Google Cloud credentials as service key.
  • GCP_BUCKET_NAME: Name of an existing Google Cloud Storage bucket (used to upload CSV dataset).
  • GCP_BIGQUERY_DATASET_ID: Desired BigQuery dataset ID (can be new or existing).
  • GCP_BIGQUERY_TABLE_ID: Desired BigQuery table name/ID (should be new table name).

Remember never to commit secrets saved in .env files to Github.

Installation

Get up and running with make deploy:

$ git clone https://github.com/hackersandslackers/bigquery-python-tutorial.git
$ cd bigquery-python-tutorial
$ make deploy

Hackers and Slackers tutorials are free of charge. If you found this tutorial helpful, a small donation would be greatly appreciated to keep us in business. All proceeds go towards coffee, and all coffee goes towards more content.