GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-bigquery/samples/snippets at main · rstkit/python-bigquery

Expand file tree

/

snippets

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

snippets

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
.gitignore
.gitignore
 
 
README.rst
README.rst
 
 
README.rst.in
README.rst.in
 
 
authenticate_service_account.py
authenticate_service_account.py
 
 
authenticate_service_account_test.py
authenticate_service_account_test.py
 
 
authorized_view_tutorial.py
authorized_view_tutorial.py
 
 
authorized_view_tutorial_test.py
authorized_view_tutorial_test.py
 
 
client_query.py
client_query.py
 
 
client_query_test.py
client_query_test.py
 
 
conftest.py
conftest.py
 
 
create_iam_policy_test.py
create_iam_policy_test.py
 
 
create_partitioned_table.py
create_partitioned_table.py
 
 
create_partitioned_table_test.py
create_partitioned_table_test.py
 
 
create_table_cmek.py
create_table_cmek.py
 
 
create_table_cmek_test.py
create_table_cmek_test.py
 
 
create_table_external_data_configuration.py
create_table_external_data_configuration.py
 
 
create_table_external_data_configuration_test.py
create_table_external_data_configuration_test.py
 
 
create_table_external_hive_partitioned.py
create_table_external_hive_partitioned.py
 
 
create_table_external_hive_partitioned_test.py
create_table_external_hive_partitioned_test.py
 
 
create_table_schema_from_json.py
create_table_schema_from_json.py
 
 
create_table_schema_from_json_test.py
create_table_schema_from_json_test.py
 
 
create_table_snapshot.py
create_table_snapshot.py
 
 
create_table_snapshot_test.py
create_table_snapshot_test.py
 
 
dataset_access_test.py
dataset_access_test.py
 
 
delete_job.py
delete_job.py
 
 
delete_job_test.py
delete_job_test.py
 
 
delete_label_table.py
delete_label_table.py
 
 
delete_label_table_test.py
delete_label_table_test.py
 
 
get_table_labels.py
get_table_labels.py
 
 
get_table_labels_test.py
get_table_labels_test.py
 
 
get_table_make_schema.py
get_table_make_schema.py
 
 
get_table_make_schema_test.py
get_table_make_schema_test.py
 
 
label_job.py
label_job.py
 
 
label_job_test.py
label_job_test.py
 
 
label_table.py
label_table.py
 
 
label_table_test.py
label_table_test.py
 
 
load_table_schema_from_json.py
load_table_schema_from_json.py
 
 
load_table_schema_from_json_test.py
load_table_schema_from_json_test.py
 
 
load_table_uri_firestore.py
load_table_uri_firestore.py
 
 
load_table_uri_firestore_test.py
load_table_uri_firestore_test.py
 
 
manage_job_cancel.py
manage_job_cancel.py
 
 
manage_job_get.py
manage_job_get.py
 
 
manage_job_test.py
manage_job_test.py
 
 
materialized_view.py
materialized_view.py
 
 
materialized_view_test.py
materialized_view_test.py
 
 
mypy.ini
mypy.ini
 
 
natality_tutorial.py
natality_tutorial.py
 
 
natality_tutorial_test.py
natality_tutorial_test.py
 
 
nested_repeated_schema.py
nested_repeated_schema.py
 
 
nested_repeated_schema_test.py
nested_repeated_schema_test.py
 
 
noxfile.py
noxfile.py
 
 
noxfile_config.py
noxfile_config.py
 
 
quickstart.py
quickstart.py
 
 
quickstart_test.py
quickstart_test.py
 
 
relax_column.py
relax_column.py
 
 
relax_column_test.py
relax_column_test.py
 
 
requirements-test.txt
requirements-test.txt
 
 
requirements.txt
requirements.txt
 
 
revoke_dataset_access.py
revoke_dataset_access.py
 
 
schema.json
schema.json
 
 
schema_us_states.json
schema_us_states.json
 
 
simple_app.py
simple_app.py
 
 
simple_app_test.py
simple_app_test.py
 
 
test_update_with_dml.py
test_update_with_dml.py
 
 
update_dataset_access.py
update_dataset_access.py
 
 
update_table_expiration.py
update_table_expiration.py
 
 
update_table_expiration_test.py
update_table_expiration_test.py
 
 
update_with_dml.py
update_with_dml.py
 
 
user_sessions_data.json
user_sessions_data.json
 
 
view.py
view.py
 
 
view_test.py
view_test.py
 
 

README.rst

Outline

Google BigQuery Python Samples

https://gstatic.com/cloudssh/images/open-btn.png

This directory contains samples for Google BigQuery. Google BigQuery is Google's fully managed, petabyte scale, low cost analytics data warehouse. BigQuery is NoOps—there is no infrastructure to manage and you don't need a database administrator—so you can focus on analyzing data to find meaningful insights, use familiar SQL, and take advantage of our pay-as-you-go model.

To run the sample, you need to have the BigQuery Admin role.

Setup

Authentication

This sample requires you to have authentication setup. Refer to the Authentication Getting Started Guide for instructions on setting up credentials for applications.

Install Dependencies

  1. Clone python-docs-samples and change directory to the sample directory you want to use.

    $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
  2. Install pip and virtualenv if you do not already have them. You may want to refer to the Python Development Environment Setup Guide for Google Cloud Platform for instructions.

  3. Create a virtualenv. Samples are compatible with Python 3.7+.

    $ virtualenv env
    $ source env/bin/activate
  4. Install the dependencies needed to run the samples.

    $ pip install -r requirements.txt

Samples

Quickstart

https://gstatic.com/cloudssh/images/open-btn.png

To run this sample:

$ python quickstart.py

Simple Application

https://gstatic.com/cloudssh/images/open-btn.png

To run this sample:

$ python simple_app.py

User Credentials

https://gstatic.com/cloudssh/images/open-btn.png

To run this sample:

$ python user_credentials.py

usage: user_credentials.py [-h] [--launch-browser] project

Command-line application to run a query using user credentials.

You must supply a client secrets file, which would normally be bundled with
your application.

positional arguments:
  project           Project to use for BigQuery billing.

optional arguments:
  -h, --help        show this help message and exit
  --launch-browser  Use a local server flow to authenticate.

The client library

This sample uses the Google Cloud Client Library for Python. You can read the documentation for more details on API usage and use GitHub to browse the source and report issues.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.