Google Cloud Platform Python Documentation Samples
repository·main·Indexed 27 days ago
https://github.com/googlecloudplatform/python-docs-samplesA repository of Python code samples for various Google Cloud Platform products, designed to help developers use Google Cloud APIs and client libraries. Includes examples for App Engine Flexible Environment (Django, Flask, SciPy, Cloud SQL, Cloud Storage, Pub/Sub), Anti Money Laundering AI (AML AI), and deploying an MCP server on Cloud Run.
What's inside python-docs-samples
- This repository contains Python code snippets demonstrating various operations on NDB (Next Generation Database) properties for App Engine Standard. These samples are designed to support the official Google Cloud documentation regarding entity property references in Datastore.
Overview of Global Fishing Watch Timeseries Classification
mainThis project implements a machine learning pipeline to classify whether a ship is fishing or not on an hourly basis using Maritime Mobile Service Identity (MMSI) location data. The solution utilizes a 1D Fully Convolutional Network built with Keras.
The pipeline architecture consists of:
- Dataset Creation: Using Apache Beam on Google Cloud Dataflow.
- Model Training: Using Keras on Vertex AI.
- Inference/Predictions: Using Keras deployed on Cloud Run.
Overview of Cloud Run functions versions
mainThis repository contains samples for two versions of Cloud Run functions:
- Cloud Run functions (2nd gen): Formerly known as Cloud Functions (2nd gen). These deploy as services on Cloud Run and can be triggered using Eventarc and Pub/Sub. They are created using
gcloud functionsorgcloud run. Samples are located in thefunctions/v2/folder. - Cloud Run functions (1st gen): Formerly known as Cloud Functions (1st gen). These have limited event triggers and configurability. They are created using
gcloud functions --no-gen2. Samples are located in the currentfunctions/folder.
- Cloud Run functions (2nd gen): Formerly known as Cloud Functions (2nd gen). These deploy as services on Cloud Run and can be triggered using Eventarc and Pub/Sub. They are created using
Overview of Logging Redaction Dataflow Pipeline
mainThis sample implements a Dataflow pipeline designed to detect and mask US Social Security Numbers (SSNs) from log payloads at ingestion time. The pipeline streams log entries from Pub/Sub to a destination Log bucket and utilizes the DLP (Data Loss Prevention) API for redaction.Overview of App Engine Datastore NDB Cache Samples
mainThis repository contains Python code snippets demonstrating various operations on App Engine Datastore NDB caches. These samples are designed to support the official Google Cloud documentation for NDB caching.Overview of Cloud Functions + Cloud Composer integration
mainThis directory contains code used by Google Cloud Functions (GCF) to trigger workflows in Cloud Composer. This pattern allows for event-driven orchestration where a Cloud Function acts as the entry point to initiate a Cloud Composer DAG.Overview of Cloud Data Loss Prevention
mainCloud Data Loss Prevention (DLP) is a service that enables enterprises to automatically discover, classify, and protect sensitive data elements within their environment.Overview of Weather Forecasting with Timeseries Regression
mainThis project demonstrates a weather forecasting model that uses satellite data to predict precipitation for the next 2 and 6 hours. The workflow involves:
- Model Architecture: A 2D Fully Convolutional Network implemented in PyTorch.
- Dataset Creation: Uses Sentinel-2 satellite data and ESA WorldCover sourced from Google Earth Engine, processed using Dataflow.
- Model Training: Performed using PyTorch on Vertex AI.
- Inference: Predictions can be generated using PyTorch in a local environment.
Overview of Coal Plant Predictions using Geospatial Classification
mainThis project demonstrates a machine learning workflow that uses satellite data to predict whether a coal plant is operational and producing carbon emissions.
Key components of the pipeline include:
- Data Source: Sentinel-2 satellite data retrieved from Google Earth Engine.
- Model Architecture: A 1D Fully Convolutional Network implemented in TensorFlow.
- Training: Model training is performed using TensorFlow on Vertex AI.
- Inference: Predictions are served using TensorFlow on Cloud Run.
Overview of App Engine Datastore NDB Queries Samples
mainThis repository contains Python code snippets demonstrating various ways to perform NDB (Next Generation Database) queries in the Google App Engine standard environment. These samples are designed to support the official App Engine documentation for NDB queries.Overview of Wildlife Insights Image Classification
mainThis sample demonstrates a machine learning workflow for recognizing animal species from camera trap pictures. The project utilizes a combination of Google Cloud services to manage the end-to-end lifecycle of an image classification model.Overview of Dataflow custom containers
mainThis repository contains samples demonstrating common use cases for creating custom container images for Dataflow workers. Custom containers allow you to specify the environment, dependencies, and system libraries required by your Dataflow pipeline. For detailed official documentation on implementation, refer to the Using custom containers in Dataflow guide.