Skip to main content

Symbol Catbuffer Parser

Project description

catbuffer

Build Status

The catbuffer library defines the protocol to serialize and deserialize Symbol entities. Code generators from the catbuffer-generators project can then produce the leanest code necessary to serialize and deserialize those entities.

Using catbuffer-generators, developers can generate builder classes for a given set of programming languages. For example, the Symbol SDKs use the generated code to interact with the entities in binary form before announcing them to the network.

The schemas folder contains definitions for each entity's data structure. These definitions are always kept up to date and in sync with the catapult server code.

Requirements

  • Python >= 3.6

Installation

  1. Clone the catbuffer-parser repository:
git clone https://github.com/symbol/catbuffer-parser
  1. (optional) Install lint requirements:
pip3 install -r lint_requirements.txt

Usage

python3 -m catparser [OPTIONS]
Option Description Default
-s, --schema TEXT Input CATS file
-o, --output TEXT Output directory _generated
-i, --include TEXT Schema root directory ./schemas
-g, --generator TEXT Generator to use to produce output files (see the available generators).
-c, --copyright TEXT File containing copyright data to use with output files. ../HEADER.inc

Examples

In order to produce any output file, the catbuffer-generators project is needed. Please see this project's usage examples.

However, catbuffer-parser can still be used on its own to parse input files and check their validity:

git clone --depth 1 --branch v2.0.0a https://github.com/symbol/catbuffer-schemas.git
python3 -m catparser --schema ../catbuffer-schemas/symbol/transfer/transfer.cats --include ../catbuffer-schemas/symbol

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

catparser-2.0.0a164.tar.gz (10.4 kB view hashes)

Uploaded Source

Built Distribution

catparser-2.0.0a164-py3-none-any.whl (14.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page