Skip to content
Projects

GoogleCloudPlatform/python-docs-samples has 8,161 GitHub stars and 6,733 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-08 02:14 UTC. Last push 2026-11-07.

How these counts are measured

Code samples used on cloud.google.com

Measured star growth

in 24h
0
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Google Cloud Platform Python Samples

Python samples for [Google Cloud Platform products][cloud].

Google Cloud Samples

Check out some of the samples found on this repository on the Google Cloud Samples page.

Setup

  1. Install [pip and virtualenv][cloud_python_setup] if you do not already have them.

  2. Clone this repository:

    git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
    
  3. Obtain authentication credentials.

    Create local credentials by running the following command and following the oauth2 flow (read more about the command [here][auth_command]):

    gcloud auth application-default login
    

    Read more about [Google Cloud Platform Authentication][gcp_auth].

How to run a sample

  1. Change directory to one of the sample folders, e.g. logging/cloud-client:

    cd logging/cloud-client/
    
  2. Create a virtualenv. Samples are compatible with Python 3.6+.

    python3 -m venv env
    source env/bin/activate
    
  3. Install the dependencies needed to run the samples.

    pip install -r requirements.txt
    
  4. Run the sample:

    python snippets.py
    

Contributing

Contributions welcome! See the Contributing Guide.

[slack_badge]: https://img.shields.io/badge/slack-Google%20Cloud%20Platform-E01563.svg [slack_link]: https://googlecloud-community.slack.com/ [cloud]: https://cloud.google.com/ [cloud_python_setup]: https://cloud.google.com/python/setup [auth_command]: https://cloud.google.com/sdk/gcloud/reference/beta/auth/application-default/login [gcp_auth]: https://cloud.google.com/docs/authentication#projects_and_resources

Explore related projects