• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

dpp-name/protobuf-json: Protocol Buffers serialization to JSON for python

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

dpp-name/protobuf-json

开源软件地址:

https://github.com/dpp-name/protobuf-json

开源编程语言:

Python 94.8%

开源软件介绍:

protobuf-json

Moved from http://code.google.com/p/protobuf-json

Provide serialization and de-serialization of Google's protobuf Messages into/from JSON format. protobuf-json is written in python and depends on Google's protobuf compiler for python.

Quick Example

Using .proto file like this:

 message Person {
   required int32 id = 1;
   required string name = 2;
   optional string email = 3;
 }

You can encode and decode it to/from json:

 {
  "id": 123,
  "name": "person name",
  "email": "[email protected]"
 }

More complex example:

 message Book {
   required string title = 1;
   optional float price = 2;
   repeated Person authors = 3;
 }
 {
  "title": "Book example",
  "price": 12.7,
  "authors": [
   {
    "id": 123,
    "name": "person name",
    "email": "[email protected]"
   },
   {
    "id": 456,
    "name": "another person",
   }
  ]
 }

Todo

From version 2.3.0 protobuf protoc supports a plugin system for code generators. Plugins can generate code for new languages.

TODO: write JavaScript code generator




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
HexarA/Json2Pojo: IntelliJ plugin that allows for easy creation of Java POJOs fr ...发布时间:2022-07-09
下一篇:
circlecell/jsoncompare.com发布时间:2022-07-09
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap