BigQuery helper library for Python
import bruneus
bruneus.select("SELECT * FROM `foo.bar.purchases` LIMIT 20").as_dicts()
bruneus.select("SELECT * FROM `foo.bar.purchases` ORDER BY created_at LIMIT 1", client=bigquery.Client(project="foobar")).first_as_dict()
bruneus.select("SELECT * FROM `foo.bar.purchases` LIMIT 20").to_dataframe()
bruneus.select("SELECT * FROM `some.source.table`").to_table("foo.bar.new_table")
bruneus.select("SELECT * FROM `some.source.table`").to_table("foo.bar.new_table").expires_in(days=7)
bruneus.export_table("foo.bar.sample").as_csv(gzip=True).to_gcs("my-bucket", "exported-table.csv.gz")
bruneus.random_table_name("prefix-here")
docker compose run bruneus