PKG-INFO 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. Metadata-Version: 1.1
  2. Name: thriftpy
  3. Version: 0.3.9
  4. Summary: Pure python implementation of Apache Thrift.
  5. Home-page: https://thriftpy.readthedocs.org/
  6. Author: Lx Yu
  7. Author-email: i@lxyu.net
  8. License: MIT
  9. Description: ========
  10. ThriftPy
  11. ========
  12. .. image:: http://img.shields.io/travis/eleme/thriftpy/develop.svg?style=flat
  13. :target: https://travis-ci.org/eleme/thriftpy
  14. .. image:: http://img.shields.io/github/release/eleme/thriftpy.svg?style=flat
  15. :target: https://github.com/eleme/thriftpy/releases
  16. .. image:: http://img.shields.io/pypi/v/thriftpy.svg?style=flat
  17. :target: https://pypi.python.org/pypi/thriftpy
  18. .. image:: http://img.shields.io/pypi/dm/thriftpy.svg?style=flat
  19. :target: https://pypi.python.org/pypi/thriftpy
  20. ThriftPy is a pure python implementation of
  21. `Apache Thrift <http://thrift.apache.org/>`_ in a pythonic way.
  22. Documentation: https://thriftpy.readthedocs.org/
  23. Installation
  24. ============
  25. Install with pip.
  26. .. code:: bash
  27. $ pip install thriftpy
  28. You may also install cython first to build cython extension locally.
  29. .. code:: bash
  30. $ pip install cython thriftpy
  31. Code Demo
  32. =========
  33. ThriftPy make it super easy to write server/client code with thrift. Let's
  34. checkout this simple pingpong service demo.
  35. We need a 'pingpong.thrift' file:
  36. ::
  37. service PingPong {
  38. string ping(),
  39. }
  40. Then we can make a server:
  41. .. code:: python
  42. import thriftpy
  43. pingpong_thrift = thriftpy.load("pingpong.thrift", module_name="pingpong_thrift")
  44. from thriftpy.rpc import make_server
  45. class Dispatcher(object):
  46. def ping(self):
  47. return "pong"
  48. server = make_server(pingpong_thrift.PingPong, Dispatcher(), '127.0.0.1', 6000)
  49. server.serve()
  50. And a client:
  51. .. code:: python
  52. import thriftpy
  53. pingpong_thrift = thriftpy.load("pingpong.thrift", module_name="pingpong_thrift")
  54. from thriftpy.rpc import make_client
  55. client = make_client(pingpong_thrift.PingPong, '127.0.0.1', 6000)
  56. print(client.ping())
  57. See, it's that easy!
  58. You can refer to 'examples' and 'tests' directory in source code for more
  59. usage examples.
  60. Features
  61. ========
  62. Currently ThriftPy have these features (also advantages over the upstream
  63. python lib):
  64. - Supports python2.6+, python3.3+, pypy and pypy3.
  65. - Pure python implementation. No longer need to compile & install the 'thrift'
  66. package. All you need is thriftpy and thrift file.
  67. - Compatible with Apache Thrift. You can use ThriftPy together with the
  68. official implementation servers and clients, such as a upstream server with
  69. a thriftpy client or the opposite.
  70. Currently implemented protocols and transports:
  71. * binary protocol (python and cython)
  72. * compact protocol (python and cython)
  73. * json protocol
  74. * buffered transport (python & cython)
  75. * framed transport
  76. * tornado server and client (with tornado 4.0)
  77. - Can directly load thrift file as module, the sdk code will be generated on
  78. the fly.
  79. For example, ``pingpong_thrift = thriftpy.load("pingpong.thrift", module_name="pingpong_thrift")``
  80. will load 'pingpong.thrift' as 'pingpong_thrift' module.
  81. Or, when import hook enabled by ``thriftpy.install_import_hook()``, you can
  82. directly use ``import pingpong_thrift`` to import the 'pingpong.thrift' file
  83. as module, you may also use ``from pingpong_thrift import PingService`` to
  84. import specific object from the thrift module.
  85. - Easy RPC server/client setup.
  86. Contribute
  87. ==========
  88. 1. Fork the repo and make changes.
  89. 2. Write a test which shows a bug was fixed or the feature works as expected.
  90. 3. Make sure ``travis-ci`` or ``tox`` tests succeed.
  91. 4. Send pull request.
  92. Contributors
  93. ============
  94. https://github.com/eleme/thriftpy/graphs/contributors
  95. Changelog
  96. =========
  97. https://github.com/eleme/thriftpy/blob/master/CHANGES.rst
  98. Keywords: thrift python thriftpy
  99. Platform: UNKNOWN
  100. Classifier: Topic :: Software Development
  101. Classifier: Development Status :: 4 - Beta
  102. Classifier: Intended Audience :: Developers
  103. Classifier: License :: OSI Approved :: MIT License
  104. Classifier: Programming Language :: Python :: 2.6
  105. Classifier: Programming Language :: Python :: 2.7
  106. Classifier: Programming Language :: Python :: 3.3
  107. Classifier: Programming Language :: Python :: 3.4
  108. Classifier: Programming Language :: Python :: 3.5
  109. Classifier: Programming Language :: Python :: Implementation :: CPython
  110. Classifier: Programming Language :: Python :: Implementation :: PyPy