Skip to content

Generate Python API client libraries from Protocol Buffers.

License

Notifications You must be signed in to change notification settings

ankiaga/gapic-generator-python

This branch is 167 commits behind googleapis/gapic-generator-python:main.

Folders and files

NameName
Last commit message
Last commit date
Oct 19, 2022
Dec 14, 2023
Dec 1, 2023
Sep 6, 2022
Nov 20, 2023
Nov 9, 2023
Nov 10, 2023
Nov 20, 2023
Dec 14, 2023
Sep 9, 2022
Mar 17, 2020
Dec 4, 2018
Feb 24, 2019
May 27, 2021
Sep 6, 2022
May 5, 2022
Jul 17, 2023
Aug 14, 2023
Nov 29, 2023
Mar 25, 2021
Jul 13, 2021
Apr 20, 2022
Dec 8, 2023
Apr 18, 2018
Nov 28, 2018
Aug 10, 2023
Apr 27, 2021
Dec 14, 2023
Aug 17, 2022
Oct 28, 2019
May 4, 2020
Sep 6, 2022
Nov 10, 2023
Dec 5, 2022
May 4, 2020
Jan 4, 2023
Aug 14, 2023
Aug 10, 2023
Dec 14, 2023
Nov 29, 2023

Repository files navigation

API Client Generator for Python

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.

About

Generate Python API client libraries from Protocol Buffers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 88.6%
  • Jinja 10.6%
  • Other 0.8%