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.4

Installation

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

Usage

python3 -m catbuffer_parser [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 v1.0.0 https://github.com/nemtech/catbuffer-schemas.git
python3 -m catbuffer_parser --schema catbuffer-schemas/schemas/transfer/transfer.cats --include catbuffer-schemas/schemas

There is also a script in the scripts folder to parse and validate all schemas:

scripts/generate_all.sh

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

catbuffer-parser-1.0.0a1.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

catbuffer_parser-1.0.0a1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file catbuffer-parser-1.0.0a1.tar.gz.

File metadata

  • Download URL: catbuffer-parser-1.0.0a1.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.7

File hashes

Hashes for catbuffer-parser-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 ff08a43f2212c283e9da5c523630a01047e5dc2261a9af3813f335f95d0b654a
MD5 3eb7fa03fa84b209422e9ec78a4acc9f
BLAKE2b-256 8066ca4819564ead4f8fd246fef314cd34596515ca20dc295b3c27429fb295fa

See more details on using hashes here.

File details

Details for the file catbuffer_parser-1.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: catbuffer_parser-1.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.7

File hashes

Hashes for catbuffer_parser-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7664b52d0d53a08b18a8ea9ab23070f1613e8028edf33a692031f22d2c49c82
MD5 2fc153602be4987756dfe4cb29e00800
BLAKE2b-256 d0fd5c9ebd461132759c00323a2157bc6a2406526963e145e6e980b4b07d3625

See more details on using hashes here.

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