Metadata-Version: 2.1
Name: proto-parser-ng
Version: 1.0.1
Summary: A package for parsing proto3 files
Home-page: https://github.com/Aaqua-live/protoparser-ng
Author: avac74
Author-email: andre.cruz@aaqua.live
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lark-parser (>=0.8.6)
Requires-Dist: numpy (>=1.14.0)

# Protoparser-ng
A package for parsing proto3 files
## Introduction
The purpose of this package is to parse the .proto file (version 3) into a
Python data structure. We use it for code generation or other operations where
analysing the structure of the schema is the goal. This project is a fork of
https://github.com/khadgarmage/protoparser by xiaochun.liu with the following
features/fixes:

- Parse oneof definitions
- Parse comments without crashing

## How to Use
```
pip install proto-parser-ng
```
Output format is as following:
```json

{
  "messages": {
    "MessageItem": {
      "comment": {
        "content": "",
        "tags": {}
      },
      "name": "MessageItem",
      "fields": [
        {
          "comment": {
            "content": "",
            "tags": {}
          },
          "type": "string",
          "key_type": "string",
          "val_type": "string",
          "name": "Title",
          "number": 1
        }
      ],
      "messages": {},
      "enums": {}
    },
    "Player": {
      "comment": {
        "content": "//@entry\n//@schema\n",
        "tags": {
          "entry": true,
          "schema": true
        }
      },
      "name": "Player",
      "fields": [
        {
          "comment": {
            "content": "//@fmt=date\n//@desc=Player's birthday\n",
            "tags": {
              "fmt": "date",
              "desc": "Player's birthday"
            }
          },
          "type": "string",
          "key_type": "string",
          "val_type": "string",
          "name": "Birthday",
          "number": 5
        },
        {
          "comment": {
            "content": "//@required\n",
            "tags": {
              "required": true
            }
          },
          "type": "PlayerType",
          "key_type": "PlayerType",
          "val_type": "PlayerType",
          "name": "Type",
          "number": 6
        },
        {
          "comment": {
            "content": "// @title App version history\n",
            "tags": {}
          },
          "type": "repeated",
          "key_type": "string",
          "val_type": "string",
          "name": "AppVerHistory",
          "number": 7
        },
        {
          "comment": {
            "content": "",
            "tags": {}
          },
          "type": "repeated",
          "key_type": "MessageItem",
          "val_type": "MessageItem",
          "name": "MessageBox",
          "number": 8
        },
        {
          "comment": {
            "content": "//@ title =Warehouse\n",
            "tags": {
              "title": "Warehouse"
            }
          },
          "type": "map",
          "key_type": "uint64",
          "val_type": "StoreItem",
          "name": "Storage",
          "number": 9
        },
        {
          "comment": {
            "content": "//@pattern=^(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]$\n",
            "tags": {
              "pattern": "^(https?|ftp|file)://[-A-Za-z0-9+&",
              "#/%?": "~_|!:,.;]+[-A-Za-z0-9+&",
              "#/%": "~_|]$"
            }
          },
          "type": "string",
          "key_type": "string",
          "val_type": "string",
          "name": "HomePage",
          "number": 11
        }
      ],
      "messages": {
        "StoreItem": {
          "comment": {
            "content": "",
            "tags": {}
          },
          "name": "StoreItem",
          "fields": [
            {
              "comment": {
                "content": "",
                "tags": {}
              },
              "type": "uint32",
              "key_type": "uint32",
              "val_type": "uint32",
              "name": "Num",
              "number": 1
            }
          ],
          "messages": {},
          "enums": {}
        }
      },
      "enums": {
        "InnerType": {
          "comment": {
            "content": "",
            "tags": {}
          },
          "name": "InnerType",
          "fields": [
            {
              "comment": {
                "content": "",
                "tags": {}
              },
              "type": "enum",
              "key_type": "enum",
              "val_type": "enum",
              "name": "TEST",
              "number": "0"
            }
          ]
        }
      }
    }
  },
  "enums": {
    "PlayerType": {
      "comment": {
        "content": "",
        "tags": {}
      },
      "name": "PlayerType",
      "fields": [
        {
          "comment": {
            "content": "//normal player\n",
            "tags": {}
          },
          "type": "enum",
          "key_type": "enum",
          "val_type": "enum",
          "name": "NORMAL",
          "number": "0"
        },
        {
          "comment": {
            "content": "//cheater\n",
            "tags": {}
          },
          "type": "enum",
          "key_type": "enum",
          "val_type": "enum",
          "name": "CHEATER",
          "number": "1"
        }
      ]
    }
  },
  "services": {
    "JobFileService": {
      "name": "JobFileService",
      "functions": [
        {
          "name": "GDriveFileList",
          "in_type": "msg.GDriveFileListReq",
          "out_type": "msg.FileListRep",
          "uri": "/api/files/gdrive"
        }
      ]
    }
  }
}
```


