Skip to main content

Google API Client Generator for Python

Project description

release level pypi versions

A generator for protocol buffer described APIs for and in Python 3.

This is a generator for API client libraries for APIs specified by protocol buffers, such as those inside Google. It takes a protocol buffer (with particular annotations) and uses it to generate a client library.

Purpose

This library replaces the monolithic generator with some improvements:

  • An explicit normalized format for specifying APIs.

  • Light weight, in-language code generators.

Bazel

This generator can be called from Bazel, which is a recommended way of using it inside a continuous integration build or any other automated pipeline.

Clone the googleapis repository $ git clone https://github.com/googleapis/googleapis.git

Create the targets

You need to add the following targets to your BUILD.bazel file.

load(
    "@gapic_generator_python//rules_python_gapic:py_gapic.bzl",
    "py_gapic_library"
)

load(
    "@gapic_generator_python//rules_python_gapic:py_gapic_pkg.bzl",
    "py_gapic_assembly_pkg"
)

py_gapic_library(
    name = "documentai_py_gapic",
    srcs = [":documentai_proto"],
)

py_gapic_assembly_pkg(
    name = "documentai-v1beta2-py",
    deps = [
        ":documentai_py_gapic",
    ],
)

Compiling an API

Using Bazel:

bazel build //google/cloud/documentai/v1beta2:documentai-v1beta2-py

Using Protoc:

# This is assumed to be in the `googleapis` project root.
$ protoc google/cloud/vision/v1/*.proto \
    --python_gapic_out=/dest/

Development

Development

Contributing

If you are looking to contribute to the project, please see Contributing for guidlines.

Documentation

See the documentation.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gapic_generator-1.20.2.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

gapic_generator-1.20.2-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file gapic_generator-1.20.2.tar.gz.

File metadata

  • Download URL: gapic_generator-1.20.2.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.18

File hashes

Hashes for gapic_generator-1.20.2.tar.gz
Algorithm Hash digest
SHA256 b793e3817d10246ea57c43cd35c47f53898db355a09f857939446b3ddb119442
MD5 19d28379fc6f0692a07469e5cbe31e7e
BLAKE2b-256 8c86a96de293841a9b1aa0418c6670394413357677802f5fe0340180ec8fbdf0

See more details on using hashes here.

File details

Details for the file gapic_generator-1.20.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gapic_generator-1.20.2-py3-none-any.whl
Algorithm Hash digest
SHA256 57e03e595ec064621d09866c30c2ace8bd938255f9c1a90ca16531242ba77fa6
MD5 08237857257f3eaf1331d9179cbb845e
BLAKE2b-256 88551fdd5188cc5549a9d7707d5eca5f8718fbb367c85c95c8fc8f74ade2df87

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page