Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/googleapis/gapic-generator-python
Generate Python API client libraries from Protocol Buffers.
https://github.com/googleapis/gapic-generator-python
code-generation gapic protobuf python
Last synced: 5 days ago
JSON representation
Generate Python API client libraries from Protocol Buffers.
- Host: GitHub
- URL: https://github.com/googleapis/gapic-generator-python
- Owner: googleapis
- License: apache-2.0
- Created: 2018-04-16T21:47:04.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-12-20T18:11:56.000Z (13 days ago)
- Last Synced: 2024-12-20T18:22:09.156Z (13 days ago)
- Topics: code-generation, gapic, protobuf, python
- Language: Python
- Homepage:
- Size: 13.1 MB
- Stars: 124
- Watchers: 54
- Forks: 69
- Open Issues: 284
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
.. _codingstyle:
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... _protocol buffers: https://developers.google.com/protocol-buffers/
Purpose
-------This library replaces the `monolithic generator`_
with some improvements:- An explicit normalized format for specifying APIs.
- Light weight, in-language code generators... _monolithic generator: https://github.com/googleapis/gapic-generator
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.gitCreate the targets
------------------
You need to add the following targets to your BUILD.bazel file... code-block:: c
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:
.. code-block:: c
bazel build //google/cloud/documentai/v1beta2:documentai-v1beta2-py
Using Protoc:
.. code-block:: c
# This is assumed to be in the `googleapis` project root.
$ protoc google/cloud/vision/v1/*.proto \
--python_gapic_out=/dest/Development
-------------
`Development`_.. _Development: https://github.com/googleapis/gapic-generator-python/blob/main/DEVELOPMENT.md
Contributing
-------------
If you are looking to contribute to the project, please see `Contributing`_
for guidlines... _Contributing: https://github.com/googleapis/gapic-generator-python/blob/main/CONTRIBUTING.md
Documentation
-------------See the `documentation`_.
.. _documentation: https://googleapis.dev/python/gapic-generator-python/latest
.. |release level| image:: https://img.shields.io/badge/support-stable-gold.svg
:target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability
.. |pypi| image:: https://img.shields.io/pypi/v/gapic-generator.svg
:target: https://pypi.org/project/gapic-generator/
.. |versions| image:: https://img.shields.io/pypi/pyversions/gapic-generator.svg
:target: https://pypi.org/project/gapic-generator/