Python samples for Google Cloud Platform products.

Overview

Google Cloud Platform Python Samples

Python samples for Google Cloud Platform products.

Build Status Build Status Build Status Build Status

Setup

  1. Install pip and virtualenv 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):

    gcloud auth application-default login
    

    Read more about Google Cloud Platform Authentication.

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.

Comments
  • Update Cloud Run region tags

    Update Cloud Run region tags

    Description

    Fixes #

    Note: It's a good idea to open an issue first for discussion.

    Checklist

    cla: yes 
    opened by averikitsch 962
  • datalabeling.manage_dataset_test: test_get_dataset failed

    datalabeling.manage_dataset_test: test_get_dataset failed

    datalabeling.manage_dataset_test: test_get_dataset failed buildID: 2b3daa3ff1daa16903d67e8ea2d4e4e11b51ad0e buildURL: https://source.cloud.google.com/results/invocations/e12b7504-8af0-4528-b97d-c50a69d9e2a0 status: failed

    priority: p2 type: process api: datalabeling 
    opened by flaky-bot[bot] 107
  • chore(deps): update dependency responses to v0.10.12

    chore(deps): update dependency responses to v0.10.12

    This PR contains the following updates:

    | Package | Update | Change | |---|---|---| | responses | patch | ==0.10.6 -> ==0.10.12 |


    Release Notes

    getsentry/responses

    v0.10.12

    Compare Source

    • Fixed incorrect content-type in add_callback() when headers are provided as a list of tuples.

    v0.10.11

    Compare Source

    • Fixed invalid README formatted.
    • Fixed string formatting in error message.

    v0.10.9

    Compare Source

    • Fixed regression with add_callback() and content-type header.
    • Fixed implicit dependency on urllib3>1.23.0

    v0.10.8

    Compare Source

    • Fixed cookie parsing and enabled multiple cookies to be set by using a list of tuple values.

    v0.10.7

    Compare Source

    • Added pypi badges to README.
    • Fixed formatting issues in README.
    • Quoted cookie values are returned correctly now.
    • Improved compatibility for pytest 5
    • Module level method names are no longer generated dynamically improving IDE navigation.

    Renovate configuration

    :date: Schedule: At any time (no schedule defined).

    :vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.

    :recycle: Rebasing: Never, or you tick the rebase/retry checkbox.

    :no_bell: Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    cla: yes automerge 
    opened by renovate-bot 90
  • storage.cloud-client.hmac_samples_test: test_create_key failed

    storage.cloud-client.hmac_samples_test: test_create_key failed

    storage.cloud-client.hmac_samples_test: test_create_key failed buildID: 2b3daa3ff1daa16903d67e8ea2d4e4e11b51ad0e buildURL: https://source.cloud.google.com/results/invocations/bbb3728b-dbdb-44ef-bf68-f0844abbadb2 status: failed

    :rotating_light: priority: p1 type: bug api: storage 
    opened by flaky-bot[bot] 74
  • bigquery.pandas-gbq-migration.samples_test: test_client_library_upload_from_dataframe failed

    bigquery.pandas-gbq-migration.samples_test: test_client_library_upload_from_dataframe failed

    This test failed!

    To configure my behavior, see the Build Cop Bot documentation.

    If I'm commenting on this issue too often, add the buildcop: quiet label and I will stop commenting.


    buildID: 18dc311c4fbbdb27db2ccdca67e84c3a58d50ae9 buildURL: Build Status, Sponge status: failed

    priority: p2 type: bug api: bigquery 
    opened by flaky-bot[bot] 72
  • bigquery.bqml.ncaa_tutorial_test: test_ncaa_tutorial failed

    bigquery.bqml.ncaa_tutorial_test: test_ncaa_tutorial failed

    bigquery.bqml.ncaa_tutorial_test: test_ncaa_tutorial failed buildID: 48f7af782874d6a51ce4b361ccde2da3bc075ffa buildURL: https://source.cloud.google.com/results/invocations/09aa881c-f276-48e8-9766-5d4b7f1c8517 status: failed

    priority: p1 type: bug api: bigquery 
    opened by flaky-bot[bot] 65
  • Error when launch Dataflow job with Flex Template: Unable to open template file

    Error when launch Dataflow job with Flex Template: Unable to open template file

    Describe the issue

    I'm hitting this error when I try to run a Dataflow job based in a Flex Template

    Failed to read the job file : gs://dataflow-staging-us-east1-174292026413/staging/template_launches/2020-10-22_10_01_20-9271036278711479772/job_object with error message: (b728f225c9d413d5): Unable to open template file: gs://dataflow-staging-us-east1-174292026413/staging/template_launches/2020-10-22_10_01_20-9271036278711479772/job_object.."

    This is the launch command:

    gcloud dataflow flex-template run job_name \
    --template-file-gcs-location=gs://path/template.json \
    --parameters experiments=disable_flex_template_entrypoint_overrride \
    --region=us-east1 \
    --service-account-email=xxx@$PROJECT.iam.gserviceaccount.com \
    --project=$PROJECT 
    

    The Service account I'm using for has Owner grant into the Project

    Any thoughts?

    Thanks!

    needs more info priority: p2 type: bug api: dataflow samples 
    opened by jasturiano 60
  • iam.api-client.custom_roles_test: test_create_role failed

    iam.api-client.custom_roles_test: test_create_role failed

    iam.api-client.custom_roles_test: test_create_role failed buildID: 48f7af782874d6a51ce4b361ccde2da3bc075ffa buildURL: https://source.cloud.google.com/results/invocations/c8e547ce-02ce-4ea1-86c3-5a7a997f2665 status: failed

    priority: p2 type: bug api: iam ownerless 
    opened by flaky-bot[bot] 52
  • django cloud sql sample for postgresql

    django cloud sql sample for postgresql

    Please add sample for django postgresql settings.

    I tried the instructions at: https://cloud.google.com/appengine/docs/flexible/python/using-cloud-sql-postgres

    But they are not working. I am getting unix socket error. More details: http://stackoverflow.com/questions/42950418/postgres-settings-for-django-on-google-app-engine-flexi

    opened by KushGoyal 43
  • feat(ai-platform): add an AI platform sample

    feat(ai-platform): add an AI platform sample

    Description

    Fixes #

    Note: It's a good idea to open an issue first for discussion.

    Checklist

    cla: yes kokoro:force-run samples 
    opened by Symmetries 42
  • jobs.v2.api_client.batch_operation_sample_test: test_batch_operation_sample failed

    jobs.v2.api_client.batch_operation_sample_test: test_batch_operation_sample failed

    jobs.v2.api_client.batch_operation_sample_test: test_batch_operation_sample failed buildID: 4aa16fd61986dad63823af87e70fdd9f549604a4 buildURL: https://source.cloud.google.com/results/invocations/241ae35d-c164-48e4-a33e-c8b28c78f646 status: failed

    priority: p2 type: bug api: jobs 
    opened by flaky-bot[bot] 38
  • I found a typo on the CONTRIBUTING document

    I found a typo on the CONTRIBUTING document

    Description

    Fixes #

    Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

    Checklist

    samples 
    opened by v-ngu 1
  • chore(deps): update dependency google-cloud-containeranalysis to v2.10.0

    chore(deps): update dependency google-cloud-containeranalysis to v2.10.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | google-cloud-containeranalysis | ==2.9.3 -> ==2.10.0 | age | adoption | passing | confidence |


    ⚠ Dependency Lookup Warnings ⚠

    Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.


    Release Notes

    googleapis/python-containeranalysis

    v2.10.0

    Compare Source

    Features
    • Add support for google.cloud.devtools.containeranalysis.__version__ (3d91a44)
    • Add typing to proto.Message based class attributes (3d91a44)
    Bug Fixes
    • Add dict typing for client_options (3d91a44)
    • deps: Require google-api-core >=1.34.0, >=2.11.0 (8a0a4b6)
    • Drop usage of pkg_resources (8a0a4b6)
    • Fix timeout default values (8a0a4b6)
    Documentation
    • samples: Snippetgen handling of repeated enum field (3d91a44)
    • samples: Snippetgen should call await on the operation coroutine before calling result (8a0a4b6)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Never, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    samples 
    opened by renovate-bot 0
  • chore(deps): update dependency google-cloud-container to v2.14.0

    chore(deps): update dependency google-cloud-container to v2.14.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | google-cloud-container | ==2.13.0 -> ==2.14.0 | age | adoption | passing | confidence |


    ⚠ Dependency Lookup Warnings ⚠

    Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.


    Release Notes

    googleapis/python-container

    v2.14.0

    Compare Source

    Features
    • Add API to enable GKE Gateway controller (944001d)
    • Add compact placement feature for node pools (944001d)
    • Add nodeconfig resource_labels api (944001d)
    • Add support for google.cloud.container.__version__ (944001d)
    • Add support for specifying stack type for clusters. This will allow clusters to be created as dual stack or toggled between IPV4 and dual stack (#​323) (5c1d04f)
    • Add typing to proto.Message based class attributes (944001d)
    • GKE cluster's control plan/node-pool network isolation (944001d)
    • v1: Add a FastSocket API (4d61084)
    • v1beta1: Add a FastSocket API (#​319) (5072864)
    Bug Fixes
    • Add dict typing for client_options (944001d)
    • deps: Require google-api-core >=1.34.0, >=2.11.0 (25c47a8)
    • Drop usage of pkg_resources (25c47a8)
    • Fix timeout default values (25c47a8)
    Documentation
    • samples: Snippetgen handling of repeated enum field (944001d)
    • samples: Snippetgen should call await on the operation coroutine before calling result (25c47a8)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Never, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    samples 
    opened by renovate-bot 0
  • chore(deps): update dependency google-cloud-build to v3.10.0

    chore(deps): update dependency google-cloud-build to v3.10.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | google-cloud-build | ==3.9.3 -> ==3.10.0 | age | adoption | passing | confidence |


    ⚠ Dependency Lookup Warnings ⚠

    Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.


    Release Notes

    googleapis/python-cloudbuild

    v3.10.0

    Compare Source

    Features
    • Add allow_failure, exit_code, and allow_exit_code to BuildStep message (#​351) (0ef62e5)
    • Add support for google.cloud.devtools.cloudbuild.__version__ (f2962f8)
    • Add typing to proto.Message based class attributes (f2962f8)
    • Integration of Cloud Build with Artifact Registry (f2962f8)
    Bug Fixes
    • Add dict typing for client_options (f2962f8)
    • deps: Require google-api-core >=1.34.0, >=2.11.0 (601b46c)
    • Drop usage of pkg_resources (601b46c)
    • Fix timeout default values (601b46c)
    Documentation
    • samples: Snippetgen handling of repeated enum field (f2962f8)
    • samples: Snippetgen should call await on the operation coroutine before calling result (601b46c)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Never, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    samples 
    opened by renovate-bot 0
  • chore(deps): update dependency google-cloud-automl to v2.9.0

    chore(deps): update dependency google-cloud-automl to v2.9.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | google-cloud-automl | ==2.8.3 -> ==2.9.0 | age | adoption | passing | confidence |


    ⚠ Dependency Lookup Warnings ⚠

    Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.


    Release Notes

    googleapis/python-automl

    v2.9.0

    Compare Source

    Features
    • Add support for google.cloud.automl.__version__ (ea81cb4)
    • Add typing to proto.Message based class attributes (ea81cb4)
    Bug Fixes
    • Add dict typing for client_options (ea81cb4)
    • deps: Require google-api-core >=1.34.0, >=2.11.0 (ad2a2d7)
    • Drop usage of pkg_resources (ad2a2d7)
    • Fix timeout default values (ad2a2d7)
    Documentation
    • samples: Snippetgen handling of repeated enum field (ea81cb4)
    • samples: Snippetgen should call await on the operation coroutine before calling result (ad2a2d7)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Never, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    samples 
    opened by renovate-bot 0
  • Deprecation notice for composer_db_transfer.py

    Deprecation notice for composer_db_transfer.py

    Description

    Fixes #8236

    Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

    Checklist

    samples 
    opened by jacek-izykowski 0
Owner
Google Cloud Platform
Google Cloud Platform
Unofficial Python Library to communicate with SESAME 3 series products from CANDY HOUSE, Inc.

pysesame3 Unofficial Python Library to communicate with SESAME 3 series products from CANDY HOUSE, Inc. This project aims to control SESAME 3 series d

Masaki Tagawa 18 Dec 12, 2022
A Python script to parse Fortinet products serial numbers, and detect the associated model and version.

ParseFortinetSerialNumber A Python script to parse Fortinet products serial numbers, and detect the associated model and version. Example $ ./ParseFor

Podalirius 10 Oct 28, 2022
A chain of stores wants a 3-month demand forecast for its 10 different stores and 50 different products.

Demand Forecasting Objective A chain store wants a machine learning project for a 3-month demand forecast for 10 different stores and 50 different pro

null 2 Jan 6, 2022
Prophet is a tool to discover resources detailed for cloud migration, cloud backup and disaster recovery

Prophet is a tool to discover resources detailed for cloud migration, cloud backup and disaster recovery

null 22 May 31, 2022
samples of neat code

NEAT-samples Some samples of code and config files for use with the NEAT-Python package These samples are largely copy and pasted, so if you

Harrison 50 Sep 28, 2022
A collection of Workflows samples for various use cases

Workflows Samples Workflows allow you to orchestrate and automate Google Cloud and HTTP-based API services with serverless workflows.

Google Cloud Platform 76 Jan 7, 2023
Set of tools to analyze Tinynuke samples

tinynuke-toolset You'll find in that repository a set of tools and scripts I developped to analyze Tinynuke samples. Dll extractor: script used to ext

Heat Miser 14 Aug 18, 2022
Ahmed Hossam 12 Oct 17, 2022
Python interface to IEX and IEX cloud APIs

Python interface to IEX Cloud Referral Please subscribe to IEX Cloud using this referral code. Getting Started Install Install from pip pip install py

IEX Cloud 41 Dec 21, 2022
:art: Diagram as Code for prototyping cloud system architectures

Diagrams Diagram as Code. Diagrams lets you draw the cloud system architecture in Python code. It was born for prototyping a new system architecture d

MinJae Kwon 27.5k Jan 4, 2023
Nimbus - Open Source Cloud Computing Software - 100% Apache2 licensed

⚠️ The Nimbus infrastructure project is no longer under development. ⚠️ For more information, please read the news announcement. If you are interested

Nimbus 194 Jun 30, 2022
Cloud Native sample microservices showcasing Full Stack Observability using AppDynamics and ThousandEyes

Cloud Native Sample Bookinfo App Observability Bookinfo is a sample application composed of four Microservices written in different languages.

Cisco DevNet 13 Jul 21, 2022
A git extension for seeing your Cloud Build deployment

A git extension for seeing your Cloud Build deployment

Katie McLaughlin 13 May 10, 2022
Media Cloud Outlet Filtering

Using ABYZ and Media-Bias Fact-Check outlet databases, I've provided outlet CSV files for both and scripts to intended to match Media Cloud files to respective outlets.

Stephen Scarano 1 Feb 2, 2022
Send notifications created in Frappe or ERPNext as push notication via Firebase Cloud Message(FCM)

FCM Notification for ERPNext Send notifications created in Frappe or ERPNext as push notication via Firebase Cloud Message(FCM) Steps to use the app:

Tridz 9 Nov 14, 2022
Google Scholar App Using Python

Google Scholar App Watch the tutorial video How to build a Google Scholar App | Streamlit #30 Demo Launch the web app: Reproducing this web app To rec

Chanin Nantasenamat 4 Jun 5, 2022
🤖🧭Creates google-like navigation menu using python-telegram-bot wrapper

python telegram bot menu pagination Makes a google style pagination line for a list of items. In other words it builds a menu for navigation if you ha

Sergey Smirnov 9 Nov 27, 2022
Jarvis Python BOT acts like Google-assistance

Jarvis-Python-BOT Jarvis Python BOT acts like Google-assistance Setup Add Mail ID (Gmail) in the file at line no 82.

Ishan Jogalekar 1 Jan 8, 2022
Python for downloading model data (HRRR, RAP, GFS, NBM, etc.) from NOMADS, NOAA's Big Data Program partners (Amazon, Google, Microsoft), and the University of Utah Pando Archive System.

Python for downloading model data (HRRR, RAP, GFS, NBM, etc.) from NOMADS, NOAA's Big Data Program partners (Amazon, Google, Microsoft), and the University of Utah Pando Archive System.

Brian Blaylock 194 Jan 2, 2023