Protocol Buffers - Google's data interchange format
===================================================
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython%2Fcontinuous) [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python_compatibility.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython_compatibility%2Fcontinuous) [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython_cpp%2Fcontinuous) [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython%2Fcontinuous) [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython_cpp%2Fcontinuous) [![Compat check PyPI](https://python-compatibility-tools.appspot.com/one_badge_image?package=protobuf)](https://python-compatibility-tools.appspot.com/one_badge_target?package=protobuf)
Copyright 2008 Google Inc.
This directory contains the Python Protocol Buffers runtime library.
Normally, this directory comes as part of the protobuf package, available
from:
https://developers.google.com/protocol-buffers/
The complete package includes the C++ source code, which includes the
Protocol Compiler (protoc). If you downloaded this package from PyPI
or some other Python-specific source, you may have received only the
Python part of the code. In this case, you will need to obtain the
Protocol Compiler from some other source before you can use this
package.
Development Warning
===================
The pure python performance is slow. For better performance please
use python c++ implementation.
Installation
============
1) Make sure you have Python 2.7 or newer. If in doubt, run:
$ python -V
2) If you do not have setuptools installed, note that it will be
downloaded and installed automatically as soon as you run `setup.py`.
If you would rather install it manually, you may do so by following
the instructions on [this page](https://packaging.python.org/en/latest/installing.html#setup-for-installing-packages).
3) Build the C++ code, or install a binary distribution of `protoc`. If
you install a binary distribution, make sure that it is the same
version as this package. If in doubt, run:
$ protoc --version
4) Build and run the tests:
$ python setup.py build
$ python setup.py test
To build, test, and use the C++ implementation, you must first compile
`libprotobuf.so`:
$ (cd .. && make)
On OS X:
If you are running a Homebrew-provided Python, you must make sure another
version of protobuf is not already installed, as Homebrew's Python will
search `/usr/local/lib` for `libprotobuf.so` before it searches
`../src/.libs`.
You can either unlink Homebrew's protobuf or install the `libprotobuf` you
built earlier:
$ brew unlink protobuf
or
$ (cd .. && make install)
On other *nix:
You must make `libprotobuf.so` dynamically available. You can either
install libprotobuf you built earlier, or set `LD_LIBRARY_PATH`:
$ export LD_LIBRARY_PATH=../src/.libs
or
$ (cd .. && make install)
To build the C++ implementation run:
$ python setup.py build --cpp_implementation
Then run the tests like so:
$ python setup.py test --cpp_implementation
If some tests fail, this library may not work correctly on your
system. Continue at your own risk.
Please note that there is a known problem with some versions of
Python on Cygwin which causes the tests to fail after printing the
error: `sem_init: Resource temporarily unavailable`. This appears
to be a [bug either in Cygwin or in
Python](http://www.cygwin.com/ml/cygwin/2005-07/msg01378.html).
We do not know if or when it might be fixed. We also do not know
how likely it is that this bug will affect users in practice.
5) Install:
$ python setup.py install
or:
$ (cd .. && make install)
$ python setup.py install --cpp_implementation
This step may require superuser privileges.
NOTE: To use C++ implementation, you need to export an environment
variable before running your program. See the "C++ Implementation"
section below for more details.
Usage
=====
The complete documentation for Protocol Buffers is available via the
web at:
https://developers.google.com/protocol-buffers/
C++ Implementation
==================
The C++ implementation for Python messages is built as a Python extension to
improve the overall protobuf Python performance.
To use the C++ implementation, you need to install the C++ protobuf runtime
library, please see instructions in the parent directory.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共87个文件
py:46个
h:16个
cc:15个
资源分类:Python库 所属语言:Python 资源全名:protobuf-3.15.0rc2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
protobuf-3.15.0rc2.tar.gz (87个子文件)
protobuf-3.15.0rc2
MANIFEST.in 483B
PKG-INFO 944B
protobuf.egg-info
PKG-INFO 944B
requires.txt 9B
SOURCES.txt 3KB
top_level.txt 7B
namespace_packages.txt 7B
dependency_links.txt 1B
setup.cfg 67B
google
__init__.py 150B
protobuf
timestamp_pb2.py 3KB
type_pb2.py 25KB
service_reflection.py 11KB
empty_pb2.py 2KB
pyext
message.cc 104KB
message.h 14KB
descriptor_pool.cc 27KB
repeated_scalar_container.cc 26KB
unknown_fields.h 3KB
message_factory.cc 11KB
descriptor_containers.cc 53KB
descriptor.cc 71KB
__init__.py 0B
extension_dict.cc 18KB
safe_numerics.h 6KB
descriptor_database.h 3KB
message_module.cc 5KB
descriptor_database.cc 7KB
descriptor_containers.h 4KB
unknown_fields.cc 13KB
message_factory.h 4KB
scoped_pyobject_ptr.h 4KB
field.cc 6KB
descriptor_pool.h 5KB
repeated_scalar_container.h 3KB
map_container.cc 36KB
cpp_message.py 3KB
field.h 2KB
repeated_composite_container.h 4KB
repeated_composite_container.cc 21KB
descriptor.h 5KB
extension_dict.h 3KB
map_container.h 3KB
descriptor_database.py 7KB
message.py 14KB
symbol_database.py 7KB
any_pb2.py 3KB
internal
extension_dict.py 8KB
encoder.py 28KB
well_known_types.py 29KB
enum_type_wrapper.py 4KB
__init__.py 2KB
python_message.py 57KB
containers.py 25KB
api_implementation.cc 4KB
python_protobuf.cc 3KB
type_checkers.py 16KB
message_listener.py 3KB
api_implementation.py 7KB
wire_format.py 8KB
decoder.py 38KB
duration_pb2.py 3KB
python_protobuf.h 2KB
reflection.py 4KB
descriptor_pool.py 45KB
api_pb2.py 12KB
field_mask_pb2.py 2KB
wrappers_pb2.py 12KB
json_format.py 32KB
proto_builder.py 5KB
service.py 9KB
__init__.py 2KB
struct_pb2.py 11KB
text_format.py 60KB
proto_api.h 6KB
compiler
plugin_pb2.py 13KB
__init__.py 0B
descriptor_pb2.py 99KB
text_encoding.py 5KB
util
json_format_pb2.py 39KB
json_format_proto3_pb2.py 91KB
__init__.py 0B
descriptor.py 43KB
message_factory.py 7KB
source_context_pb2.py 2KB
setup.py 12KB
README.md 5KB
共 87 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 12w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功