{"id":15131060,"url":"https://github.com/thriftpy/thriftpy","last_synced_at":"2025-09-28T21:30:55.329Z","repository":{"id":14025652,"uuid":"16727684","full_name":"Thriftpy/thriftpy","owner":"Thriftpy","description":"Thriftpy has been deprecated, please migrate to https://github.com/Thriftpy/thriftpy2","archived":true,"fork":false,"pushed_at":"2018-12-09T14:45:17.000Z","size":806,"stargazers_count":1152,"open_issues_count":72,"forks_count":286,"subscribers_count":78,"default_branch":"develop","last_synced_at":"2024-10-30T01:02:02.970Z","etag":null,"topics":["python","rpc","serialization","thrift"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Thriftpy.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-11T10:41:45.000Z","updated_at":"2024-10-25T16:27:14.000Z","dependencies_parsed_at":"2022-08-28T10:51:07.714Z","dependency_job_id":null,"html_url":"https://github.com/Thriftpy/thriftpy","commit_stats":null,"previous_names":["eleme/thriftpy"],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thriftpy%2Fthriftpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thriftpy%2Fthriftpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thriftpy%2Fthriftpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thriftpy%2Fthriftpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thriftpy","download_url":"https://codeload.github.com/Thriftpy/thriftpy/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234563140,"owners_count":18853060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","rpc","serialization","thrift"],"created_at":"2024-09-26T03:22:23.690Z","updated_at":"2025-09-28T21:30:54.736Z","avatar_url":"https://github.com/Thriftpy.png","language":"Python","readme":"========\nThriftPy\n========\n\n**Thriftpy has been deprecated, please migrate to** `thriftpy2 \u003chttps://github.com/Thriftpy/thriftpy2\u003e`_\n\n\n.. image:: http://img.shields.io/travis/eleme/thriftpy/develop.svg?style=flat\n   :target: https://travis-ci.org/eleme/thriftpy\n\n.. image:: http://img.shields.io/github/release/eleme/thriftpy.svg?style=flat\n   :target: https://github.com/eleme/thriftpy/releases\n\n.. image:: http://img.shields.io/pypi/v/thriftpy.svg?style=flat\n   :target: https://pypi.python.org/pypi/thriftpy\n\n.. image:: http://img.shields.io/pypi/dm/thriftpy.svg?style=flat\n   :target: https://pypi.python.org/pypi/thriftpy\n\nThriftPy is a pure python implementation of\n`Apache Thrift \u003chttp://thrift.apache.org/\u003e`_ in a pythonic way.\n\nDocumentation: https://thriftpy.readthedocs.org/\n\n\nInstallation\n============\n\nInstall with pip.\n\n.. code:: bash\n\n    $ pip install thriftpy\n\nYou may also install cython first to build cython extension locally.\n\n.. code:: bash\n\n    $ pip install cython thriftpy\n\n\nCode Demo\n=========\n\nThriftPy make it super easy to write server/client code with thrift. Let's\ncheckout this simple pingpong service demo.\n\nWe need a 'pingpong.thrift' file:\n\n::\n\n    service PingPong {\n        string ping(),\n    }\n\nThen we can make a server:\n\n.. code:: python\n\n    import thriftpy\n    pingpong_thrift = thriftpy.load(\"pingpong.thrift\", module_name=\"pingpong_thrift\")\n\n    from thriftpy.rpc import make_server\n\n    class Dispatcher(object):\n        def ping(self):\n            return \"pong\"\n\n    server = make_server(pingpong_thrift.PingPong, Dispatcher(), '127.0.0.1', 6000)\n    server.serve()\n\nAnd a client:\n\n.. code:: python\n\n    import thriftpy\n    pingpong_thrift = thriftpy.load(\"pingpong.thrift\", module_name=\"pingpong_thrift\")\n\n    from thriftpy.rpc import make_client\n\n    client = make_client(pingpong_thrift.PingPong, '127.0.0.1', 6000)\n    print(client.ping())\n\nSee, it's that easy!\n\nYou can refer to 'examples' and 'tests' directory in source code for more\nusage examples.\n\n\n\nFeatures\n========\n\nCurrently ThriftPy have these features (also advantages over the upstream\npython lib):\n\n- Supports Python 2.7, Python 3.4+, PyPy and PyPy3.\n\n- Pure python implementation. No longer need to compile \u0026 install the 'thrift'\n  package. All you need is thriftpy and thrift file.\n\n- Compatible with Apache Thrift. You can use ThriftPy together with the\n  official implementation servers and clients, such as a upstream server with\n  a thriftpy client or the opposite.\n\n  Currently implemented protocols and transports:\n\n  * binary protocol (python and cython)\n\n  * compact protocol (python and cython)\n\n  * json protocol\n\n  * buffered transport (python \u0026 cython)\n\n  * framed transport\n\n  * tornado server and client (with tornado 4.0)\n\n  * http server and client\n\n- Can directly load thrift file as module, the sdk code will be generated on\n  the fly.\n\n  For example, ``pingpong_thrift = thriftpy.load(\"pingpong.thrift\", module_name=\"pingpong_thrift\")``\n  will load 'pingpong.thrift' as 'pingpong_thrift' module.\n\n  Or, when import hook enabled by ``thriftpy.install_import_hook()``, you can\n  directly use ``import pingpong_thrift`` to import the 'pingpong.thrift' file\n  as module, you may also use ``from pingpong_thrift import PingService`` to\n  import specific object from the thrift module.\n\n- Easy RPC server/client setup.\n\n\n\nContribute\n==========\n\n1. Fork the repo and make changes.\n\n2. Write a test which shows a bug was fixed or the feature works as expected.\n\n3. Make sure ``travis-ci`` or ``tox`` tests succeed.\n\n4. Send pull request.\n\n\nContributors\n============\n\nhttps://github.com/eleme/thriftpy/graphs/contributors\n\n\nChangelog\n=========\n\nhttps://github.com/eleme/thriftpy/blob/master/CHANGES.rst\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthriftpy%2Fthriftpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthriftpy%2Fthriftpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthriftpy%2Fthriftpy/lists"}