Code samples used on cloud.google.com
8,131
stars
10,626
commits
Jupyter Notebook
primary language
Sep 10, 2026
updated
Python samples for Google Cloud Platform products.
Check out some of the samples found on this repository on the Google Cloud Samples page.
Install pip and virtualenv if you do not already have them.
Clone this repository:
git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
Obtain authentication credentials.
Create local credentials by running the following command and following the oauth2 flow (read more about the command here):
gcloud auth application-default login
Read more about Google Cloud Platform Authentication.
Change directory to one of the sample folders, e.g. logging/cloud-client:
cd logging/cloud-client/
Create a virtualenv. Samples are compatible with Python 3.6+.
python3 -m venv env
source env/bin/activate
Install the dependencies needed to run the samples.
pip install -r requirements.txt
Run the sample:
python snippets.py
Contributions welcome! See the Contributing Guide.
(top 30 of 397)
Jupyter Notebook
83.6%
Python
15.4%
Code samples used on cloud.google.com
8,131
stars
10,626
commits
Jupyter Notebook
primary language
Sep 10, 2026
updated
Python samples for Google Cloud Platform products.
Check out some of the samples found on this repository on the Google Cloud Samples page.
Install pip and virtualenv if you do not already have them.
Clone this repository:
git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
Obtain authentication credentials.
Create local credentials by running the following command and following the oauth2 flow (read more about the command here):
gcloud auth application-default login
Read more about Google Cloud Platform Authentication.
Change directory to one of the sample folders, e.g. logging/cloud-client:
cd logging/cloud-client/
Create a virtualenv. Samples are compatible with Python 3.6+.
python3 -m venv env
source env/bin/activate
Install the dependencies needed to run the samples.
pip install -r requirements.txt
Run the sample:
python snippets.py
Contributions welcome! See the Contributing Guide.
(top 30 of 397)
Jupyter Notebook
83.6%
Python
15.4%