### Get Help for mdp_decoder.py Example Script Source: https://github.com/tfgm/sbedecoder/blob/master/README.md This command shows how to display the command-line help and usage options for the included example script, mdp_decoder.py, which demonstrates processing CME Group MDP 3.0 messages from a pcap file. ```Shell mdp_decoder.py --help ``` -------------------------------- ### Get Help for mdp_book_builder.py (Command Line) Source: https://github.com/tfgm/sbedecoder/blob/master/README.md Shows how to display the help message for the mdp_book_builder.py script, detailing its usage and available options for building limit order books. ```Shell mdp_book_builder.py --help ``` -------------------------------- ### Install sbedecoder via pip Source: https://github.com/tfgm/sbedecoder/blob/master/README.md This command demonstrates the standard way to install the sbedecoder package using the Python package installer, pip. This fetches the package from PyPI. ```Shell pip install sbedecoder ``` -------------------------------- ### Install sbedecoder from Source Source: https://github.com/tfgm/sbedecoder/blob/master/README.md This command shows how to install the sbedecoder package directly from its source code distribution. This is typically used when installing from a cloned repository. ```Shell python setup.py install ``` -------------------------------- ### Parsing Single SBE Message in Python Source: https://github.com/tfgm/sbedecoder/blob/master/README.md This example shows how to parse a single SBE encoded message from a buffer using a previously parsed schema. The optional 'offset' parameter specifies the starting position of the message within the buffer. ```Python from sbedecoder import SBEMessage message = SBEMessage.parse_message(schema, msg_buffer, offset=0) ``` -------------------------------- ### Get Help for sbe_class_generator.py (Command Line) Source: https://github.com/tfgm/sbedecoder/blob/master/README.md Shows how to display the help message for the sbe_class_generator.py script, detailing its usage and options for generating Python classes from an SBE schema file. ```Shell sbe_class_generator.py --help ``` -------------------------------- ### Install sbedecoder Dependencies with PyPy (Command Line) Source: https://github.com/tfgm/sbedecoder/blob/master/README.md Commands to install necessary Python packages (lxml, dpkt) and the sbedecoder package itself using a PyPy interpreter, assuming PyPy is installed in /opt/pypy. This is suggested for improved performance. ```Shell /opt/pypy/bin/pip install lxml ``` ```Shell /opt/pypy/bin/pip install dpkt ``` ```Shell /opt/pypy/bin/pypy setup.py install ``` -------------------------------- ### Generate Python Classes from SBE Schema (Command Line) Source: https://github.com/tfgm/sbedecoder/blob/master/README.md Example command demonstrating how to use sbe_class_generator.py to generate a Python file (generated.py) containing class definitions based on a provided SBE schema (schema.xml) and a template file (sbe_message.tmpl). ```Shell /sbe_class_generator.py --schema schema.xml --output generated.py --template ./sbe_message.tmpl ``` -------------------------------- ### Load Generated Classes or Parse Schema (Python) Source: https://github.com/tfgm/sbedecoder/blob/master/README.md Demonstrates how to attempt loading pre-generated message classes from 'sbedecoder.generated'. If the generated classes are not available (e.g., due to an import error), it falls back to dynamically parsing the schema file using the SBESchema.parse method. ```Python try: from sbedecoder.generated import __messages__ as generated_messages mdp_schema.load(generated_messages) except: mdp_schema.parse(args.schema) ``` -------------------------------- ### Parsing SBE Schema in Python Source: https://github.com/tfgm/sbedecoder/blob/master/README.md This snippet demonstrates how to initialize the SBESchema class and parse an SBE schema definition from an XML file. The parsed schema is then used by the decoder to understand the binary data structure. ```Python from sbedecoder import SBESchema schema = SBESchema() schema.parse('path/to/schema.xml') ``` -------------------------------- ### Parsing Framed Messages (MDP 3.0) in Python Source: https://github.com/tfgm/sbedecoder/blob/master/README.md This snippet illustrates how to use the MDP-specific helper classes (MDPSchema, MDPMessageFactory, SBEParser) to iterate and parse multiple framed SBE messages from a data packet, such as those found in CME Group MDP 3.0. ```Python from sbedecoder import MDPSchema from sbedecoder import MDPMessageFactory from sbedecoder import SBEParser schema = SBESchema() schema.parse('path/to/schema.xml') message_factory = MDPMessageFactory(schema) message_parser = SBEParser(message_factory) for packet in SOME_DATASOURCE: for message in message_parser.parse(packet, offset=12): process(message) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.