.. _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.git
Create 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/
Raw data
{
"_id": null,
"home_page": "https://github.com/googleapis/gapic-generator-python",
"name": "gapic-generator",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Google LLC",
"author_email": "googleapis-packages@google.com",
"download_url": "https://files.pythonhosted.org/packages/89/dd/f3e74b681bc51948b51f2ab1a96bee84cd868f72900e4178587ac2b6acbb/gapic-generator-1.18.0.tar.gz",
"platform": "Posix; MacOS X",
"description": ".. _codingstyle:\n\nAPI Client Generator for Python\n===============================\n\n|release level| |pypi| |versions|\n\n A generator for protocol buffer described APIs for and in Python 3.\n\nThis is a generator for API client libraries for APIs\nspecified by `protocol buffers`_, such as those inside Google.\nIt takes a protocol buffer (with particular annotations) and uses it\nto generate a client library.\n\n.. _protocol buffers: https://developers.google.com/protocol-buffers/\n\nPurpose\n-------\n\nThis library replaces the `monolithic generator`_\nwith some improvements:\n\n- An explicit normalized format for specifying APIs.\n- Light weight, in-language code generators.\n\n.. _monolithic generator: https://github.com/googleapis/gapic-generator\n\n\nBazel\n-------------\nThis generator can be called from Bazel, which is a recommended way of using it inside a continuous integration build or any other automated pipeline.\n\nClone the googleapis repository\n$ git clone https://github.com/googleapis/googleapis.git\n\nCreate the targets\n------------------\nYou need to add the following targets to your BUILD.bazel file.\n\n.. code-block:: c\n\n load(\n \"@gapic_generator_python//rules_python_gapic:py_gapic.bzl\",\n \"py_gapic_library\"\n )\n\n load(\n \"@gapic_generator_python//rules_python_gapic:py_gapic_pkg.bzl\",\n \"py_gapic_assembly_pkg\"\n )\n\n py_gapic_library(\n name = \"documentai_py_gapic\",\n srcs = [\":documentai_proto\"],\n )\n\n py_gapic_assembly_pkg(\n name = \"documentai-v1beta2-py\",\n deps = [\n \":documentai_py_gapic\",\n ],\n )\n\n\nCompiling an API\n----------------\n\nUsing Bazel:\n\n.. code-block:: c\n\n bazel build //google/cloud/documentai/v1beta2:documentai-v1beta2-py\n\nUsing Protoc:\n\n.. code-block:: c\n\n # This is assumed to be in the `googleapis` project root.\n $ protoc google/cloud/vision/v1/*.proto \\\n --python_gapic_out=/dest/\n\nDevelopment\n-------------\n`Development`_\n\n.. _Development: https://github.com/googleapis/gapic-generator-python/blob/main/DEVELOPMENT.md\n\nContributing\n-------------\nIf you are looking to contribute to the project, please see `Contributing`_\nfor guidlines.\n\n.. _Contributing: https://github.com/googleapis/gapic-generator-python/blob/main/CONTRIBUTING.md\n\nDocumentation\n-------------\n\nSee the `documentation`_.\n\n.. _documentation: https://googleapis.dev/python/gapic-generator-python/latest\n\n.. |release level| image:: https://img.shields.io/badge/support-stable-gold.svg\n :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability\n.. |pypi| image:: https://img.shields.io/pypi/v/gapic-generator.svg\n :target: https://pypi.org/project/gapic-generator/\n.. |versions| image:: https://img.shields.io/pypi/pyversions/gapic-generator.svg\n :target: https://pypi.org/project/gapic-generator/\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Google API Client Generator for Python",
"version": "1.18.0",
"project_urls": {
"Homepage": "https://github.com/googleapis/gapic-generator-python"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2fd145c0bddd6585759c33abbed1e4d523cf09763806a4fe73f00d58720438e4",
"md5": "981c524b7b1e513257f3c99d85dcedad",
"sha256": "105b41f63632617f230ea105b3b110ca5945d6048dcee10320332b23b06c19d7"
},
"downloads": -1,
"filename": "gapic_generator-1.18.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "981c524b7b1e513257f3c99d85dcedad",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 1537275,
"upload_time": "2024-05-08T22:18:46",
"upload_time_iso_8601": "2024-05-08T22:18:46.633271Z",
"url": "https://files.pythonhosted.org/packages/2f/d1/45c0bddd6585759c33abbed1e4d523cf09763806a4fe73f00d58720438e4/gapic_generator-1.18.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "89ddf3e74b681bc51948b51f2ab1a96bee84cd868f72900e4178587ac2b6acbb",
"md5": "80feeac950190f02433eb9a0ee9a0c6f",
"sha256": "7093506db90032e8c7855d3da30f04e89bb78756d13a20a531caad3ee7e54907"
},
"downloads": -1,
"filename": "gapic-generator-1.18.0.tar.gz",
"has_sig": false,
"md5_digest": "80feeac950190f02433eb9a0ee9a0c6f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 1021645,
"upload_time": "2024-05-08T22:18:51",
"upload_time_iso_8601": "2024-05-08T22:18:51.064273Z",
"url": "https://files.pythonhosted.org/packages/89/dd/f3e74b681bc51948b51f2ab1a96bee84cd868f72900e4178587ac2b6acbb/gapic-generator-1.18.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-08 22:18:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "googleapis",
"github_project": "gapic-generator-python",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "gapic-generator"
}