Symbol Catbuffer Parser
Project description
catbuffer-parser
This project is the reference parser implementation for the CATS (Concise Affinitized Transfer Schema) DSL that is used by the Symbol blockchain. The parser converts a CATS file or files into an AST that can be used by a generator to produce serialization and deserialzation code for defined objects.
- A reference to the DSL format can be found here.
- For a sampling of real world schemas, those used by the Symbol blockchain can be found here.
Requirements
- Python >= 3.6
Installation
git clone https://github.com/symbol/catbuffer-parser
pip3 install -r requirements.txt
pip3 install -r lint_requirements.txt # optional
Usage
usage: python -m catparser [-h] -s SCHEMA -i INCLUDE [-o OUTPUT]
CATS code generator
optional arguments:
-h, --help show this help message and exit
-s SCHEMA, --schema SCHEMA
input CATS file
-i INCLUDE, --include INCLUDE
schema root directory
-o OUTPUT, --output OUTPUT
yaml output file
Examples
catparser can be used on its own to parse input files, check their validity and optionally output a YAML file containing the parsed type descriptors:
git clone --depth 1 --branch v3.0.0 https://github.com/symbol/catbuffer-schemas.git
# parse but don't output anything
python3 -m catparser --schema ../catbuffer-schemas/symbol/transfer/transfer.cats --include ../catbuffer-schemas/symbol
# parse and output a YAML file (deprecated)
python3 -m catparser --schema ../catbuffer-schemas/symbol/transfer/transfer.cats --include ../catbuffer-schemas/symbol --output ../catbuffer-schemas/all.yaml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file catparser-3.1.0.tar.gz.
File metadata
- Download URL: catparser-3.1.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2c6baf27453b2d350c0c536e11791c78f482779f78e79e1235abc04e1618e8c
|
|
| MD5 |
5c442345bcac9f8ec575ecf5cbdcd846
|
|
| BLAKE2b-256 |
5582e7f2eb27019b4210c31d6961fa4be4ccb51fbd79741574a3bb7e4cbf3b13
|
File details
Details for the file catparser-3.1.0-py3-none-any.whl.
File metadata
- Download URL: catparser-3.1.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37cbfb45e32c2ac8c75b3c33c2a4c196399e948d867d5836716d699378fedb31
|
|
| MD5 |
047bab9505e5e0aeec5e7d95c4542fa4
|
|
| BLAKE2b-256 |
f6c81889c5bb57f23bf8f65c9541d1302ecaf53734beb7cf03d486ae88bdcb40
|