Skip to main content

Symbol Catbuffer Parser

Project description

Note (nemtus mirror): This package is a content mirror of the catbuffer parser from symbol/symbol (catbuffer/parser, upstream PyPI name catparser). nemtus republishes it on PyPI as nemtus-catparser; the only change from upstream is the published distribution name. The import module name is unchanged — you still import catparser. For the canonical project, see symbol/symbol.

catbuffer-parser

Build Status

This project is the reference parser implementation for the CATS (Compact 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 deserialization 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.7

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
  -g GENERATOR, --generator GENERATOR
                        generator class to use to produce output files (defaults to YAML output)
  -q, --quiet           do not print type descriptors to console

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:

# parse but don't output anything
python3 -m catparser --schema ../schemas/symbol/transfer/transfer.cats --include ../schemas/symbol --quiet

# parse and output the AST
python3 -m catparser --schema ../schemas/symbol/transfer/transfer.cats --include ../schemas/symbol

# parse and generate code using the specified generator (`generator.Generator`)
python3 -m catparser --schema ../schemas/symbol/transfer/transfer.cats --include ../schemas/symbol --generator generator.Generator

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

nemtus_catparser-3.2.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nemtus_catparser-3.2.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file nemtus_catparser-3.2.0.tar.gz.

File metadata

  • Download URL: nemtus_catparser-3.2.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for nemtus_catparser-3.2.0.tar.gz
Algorithm Hash digest
SHA256 5e2226cc9d48f5fad4133d7a6ce0977da4c3f9db4ab0e459ba57a7f089e08658
MD5 bc2864d6377a3b4ee177fe28f5713945
BLAKE2b-256 a9b24302a89222cf627436c8a07a9280298599d6119e090deeb3ce27a47d682d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemtus_catparser-3.2.0.tar.gz:

Publisher: pypi-catparser-publish.yml on nemtus/symbol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nemtus_catparser-3.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nemtus_catparser-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 833ce4c134c576be8cd73105ec31579cbba0403c44fbb8073ee52875aaa31a41
MD5 b7bdb2327b43d36b8d73f6fbd2a238a3
BLAKE2b-256 dc7ec760fab5ab256928e844ccca51ff77dce386949707d4b2083b478326fdd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemtus_catparser-3.2.0-py3-none-any.whl:

Publisher: pypi-catparser-publish.yml on nemtus/symbol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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