Skip to main content

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

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.post1.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.post1-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nemtus_catparser-3.2.0.post1.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.post1.tar.gz
Algorithm Hash digest
SHA256 d4d99d2a4832fe23f0fb53eb37f9d1aa3e94bf0a1ba4d978b1d1e86b089cc570
MD5 5c900bc73c59e95e34922d9bbc970839
BLAKE2b-256 8e2afd35f25f674aedc74ae0c8d5561db0ba755274e2356902bef3b069236b2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemtus_catparser-3.2.0.post1.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.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for nemtus_catparser-3.2.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 fec85151c99ad15296634cefbf786f93b898255749734f5ceeb397651718df5f
MD5 4a028d49f073a1187c734c912555a462
BLAKE2b-256 b452682276f9025856a22ae7720a6c0ba8cf6ccf1c2bc5a90f9d4a8ca5cb4e85

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemtus_catparser-3.2.0.post1-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.

Release history Release notifications | RSS feed

This release

3.2.0.post1 This release

2 files

3.2.0

2 files

Supported by

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