This repository is the Python Functions Framework, an open-source FaaS (Function as a Service) framework developed by Google Cloud Functions team. It allows developers to write portable Python functions that can run locally, on Google Cloud Run Functions, or on Knative-based environments. The framework provides a CLI to start a local development server (Flask for WSGI or Starlette for ASGI) that invokes user-defined functions. It supports multiple function signatures: HTTP (Flask Request), CloudEvent (CloudEvents SDK), legacy background events (event/context), and typed events with custom data classes. It handles automatic event conversion between background events and CloudEvents, execution ID tracking with logging, request timeout enforcement via threading, and error handling. The architecture is modular with separate components for CLI, function registry, event conversion, execution ID, and HTTP server abstraction (Flask, Gunicorn, Starlette/Uvicorn). The codebase is well-tested with near-100% branch coverage and includes conformance tests against the Functions Framework conformance suite.
This repository contains Google Cloud Platform (GCP) service code samples in Go, designed to demonstrate API usage patterns and implementation techniques for various GCP services. The samples are organized by service (e.g., BigQuery, Firestore, Cloud Functions, Compute Engine) and include both runnable examples (main.go files) and library snippets. The repository serves as a practical reference for developers building applications on GCP, showing how to initialize clients, handle errors, manage resources, and integrate services. While not a single cohesive application, it provides executable samples that can be adapted for production use, with many samples following client initialization, context handling, and error handling patterns. The repository includes testing infrastructure and CI/CD configurations to validate samples against real GCP projects.
This is the official Google Cloud Platform Python samples repository, a large collection of self-contained, region-tagged code examples demonstrating how to use GCP services from Python. It is not a single deployable application; instead, each directory is an isolated sample set for a specific product such as Cloud Storage, BigQuery, Compute Engine, Cloud Functions, App Engine, Cloud Run, Composer, Dataflow, and Vertex AI. Most samples are small Flask apps, Cloud Functions handlers, CLI scripts, or library-usage snippets, each paired with pytest tests and a noxfile_config.py for CI execution. The dominant character is application-oriented sample code, but the repository is hybrid: it also includes Apache Airflow DAGs, Dataflow pipelines, BigQuery examples, and a small number of notebooks, making it relevant to data engineers as well as application developers. The architecture is intentionally decentralized: every sample directory has its own requirements.txt, tests, and nox configuration, so there is no shared runtime. The value of the repository is as a copy-paste reference and documentation source, backed by a mature testing harness that runs samples against real GCP resources using Kokoro/nox and environment-provided project IDs. Some notable engineering patterns emerge, including a reusable Airflow DAG validation utility and a compute snippet-generation system that composes reusable 'ingredients' into full 'recipes'. Maintenance is active, but the repository carries legacy artifacts such as App Engine Python 2.7 samples, Airflow 1.x DAGs, and some deprecated APIs, so overall technical drift is medium.