Skip to content

Instantly share code, notes, and snippets.

View rich-ard's full-sized avatar

Richard Brandt rich-ard

View GitHub Profile
@rich-ard
rich-ard / google_bigquery_backup_views_scheduled_queries_git.py
Last active December 13, 2022 18:17 — forked from krisjan-oldekamp/google_bigquery_backup_views_scheduled_queries_git.py
Backup BigQuery Views and Scheduled Queries to a Git repository using Python. Full article on stacktonic.com
############################################################
# Author Krisjan Oldekamp / Stacktonic.com
# Email [email protected]
# Article https://stacktonic.com/article/backup-your-valuable-big-query-views-and-scheduled-queries-using-python
############################################################
import os
import git
import google.oauth2.service_account
from google.cloud import bigquery