googleapi客户端生成器
google-apis-client-generator的Python项目详细描述
#版权所有2011谷歌公司 γ #根据apache许可证2.0版(以下简称“许可证”)授权; #除非符合许可证,否则您不能使用此文件。 #你可以在 γ #http://www.apache.org/licenses/LICENSE-2.0 γ #除非适用法律要求或书面同意,否则软件 #根据许可证分发是按“原样”分发的, #无任何明示或默示的保证或条件。 #有关管理权限的特定语言和 #许可下的限制。
googleapi代码生成器 https://github.com/google/apis-client-generator/
2019年1月29日
简介
This is a tool for generating client libraries from Google APIs Discovery documents. It builds a rich (but language neutral) model of the API and then invokes a language specific backend to emit the library. The language generators are template driven, so it is easy for a developer knowning language X to write templates for code in X, without having to learn much Python.
The generator currently has templates for Java, C++, CSharp, GWT, PHP and Dart. There may be multiple variations of each language. For each, the variant used by default (typically also named “default”) matches the head of the respective base client libraries.
- 警告:
- 本项目作为志愿者工作进行维护。没有全职工作 人员配备。
安装
Python2.7是必需的。不支持python3。
任何东西都可以通过简易安装或pip快速安装。例如:
pip install google-apis-client-generator
将安装以下依赖项:
- django - https://www.djangoproject.com/ - version 1.8 - we only use the templating package, not the web serving features.
- google-apputils - https://github.com/google/google-apputils/
- google-api-python-client - https://github.com/google/google-api-python-client
- python-gflags - https://github.com/google/python-gflags/
- httplib2 - https://github.com/httplib2/httplib2/
用法
要运行库生成器,请使用“generate_library”脚本。这是 通常你想做什么。例如:
- generate_library
- –input=src/googleapis/codegen/testdata/moderator.v1.json –language=java –output_dir=/tmp/generated
若要展开任意模板,“展开模板”脚本也可用:
- expand_templates
- –discovery=src/googleapis/codegen/testdata/moderator.v1.json –language=any –templates=discovery_check –output_dir=/tmp/generated
联系人
Tony Aiuto (aiuto@google.com) Jacob Smullyan (smulloni@google.com)