PageRenderTime 14ms CodeModel.GetById 8ms RepoModel.GetById 1ms app.codeStats 0ms

Plain Text | 100 lines | 70 code | 30 blank | 0 comment | 0 complexity | ec19461329a6c9941fb6d05e5b48f7fb MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, GPL-3.0, GPL-2.0
  1. Protocol Buffers - Google's data interchange format
  2. Copyright 2008 Google Inc.
  3. This directory contains the Python Protocol Buffers runtime library.
  4. Normally, this directory comes as part of the protobuf package, available
  5. from:
  7. The complete package includes the C++ source code, which includes the
  8. Protocol Compiler (protoc). If you downloaded this package from PyPI
  9. or some other Python-specific source, you may have received only the
  10. Python part of the code. In this case, you will need to obtain the
  11. Protocol Compiler from some other source before you can use this
  12. package.
  13. Development Warning
  14. ===================
  15. The Python implementation of Protocol Buffers is not as mature as the C++
  16. and Java implementations. It may be more buggy, and it is known to be
  17. pretty slow at this time. If you would like to help fix these issues,
  18. join the Protocol Buffers discussion list and let us know!
  19. Installation
  20. ============
  21. 1) Make sure you have Python 2.4 or newer. If in doubt, run:
  22. $ python -V
  23. 2) If you do not have setuptools installed, note that it will be
  24. downloaded and installed automatically as soon as you run
  25. If you would rather install it manually, you may do so by following
  26. the instructions on this page:
  28. 3) Build the C++ code, or install a binary distribution of protoc. If
  29. you install a binary distribution, make sure that it is the same
  30. version as this package. If in doubt, run:
  31. $ protoc --version
  32. 4) Run the tests:
  33. $ python test
  34. If some tests fail, this library may not work correctly on your
  35. system. Continue at your own risk.
  36. Please note that there is a known problem with some versions of
  37. Python on Cygwin which causes the tests to fail after printing the
  38. error: "sem_init: Resource temporarily unavailable". This appears
  39. to be a bug either in Cygwin or in Python:
  41. We do not know if or when it might me fixed. We also do not know
  42. how likely it is that this bug will affect users in practice.
  43. 5) Install:
  44. $ python install
  45. This step may require superuser privileges.
  46. NOTE: To use C++ implementation, you need to install C++ protobuf runtime
  47. library of the same version and export the environment variable before this
  48. step. See the "C++ Implementation" section below for more details.
  49. Usage
  50. =====
  51. The complete documentation for Protocol Buffers is available via the
  52. web at:
  54. C++ Implementation
  55. ==================
  56. WARNING: This is EXPERIMENTAL and only available for CPython platforms.
  57. The C++ implementation for Python messages is built as a Python extension to
  58. improve the overall protobuf Python performance.
  59. To use the C++ implementation, you need to:
  60. 1) Install the C++ protobuf runtime library, please see instructions in the
  61. parent directory.
  62. 2) Export an environment variable:
  64. You need to export this variable before running script to build and
  65. install the extension. You must also set the variable at runtime, otherwise
  66. the pure-Python implementation will be used. In a future release, we will
  67. change the default so that C++ implementation is used whenever it is available.
  68. It is strongly recommended to run `python test` after setting the
  69. variable to "cpp", so the tests will be against C++ implemented Python
  70. messages.