DEVELOPMENT.md raw

Development Guide for neotoma-py

Prerequisites

  • Rust (latest stable)
  • Python 3.8+
  • maturin (pip install maturin)

Building

To build the Python bindings in development mode:

maturin build

Or manually:

maturin develop

Testing

Building Wheels

To build distributable wheels:

maturin build --release

Architecture

The Python bindings expose the core neotoma grammar functionality:

  • Grammar: Python wrapper around the Rust Grammar type
  • parse_with_grammar(): One-shot parsing function

Error Handling

The bindings convert Rust errors to appropriate Python exceptions:

  • Parse errors become ValueError
  • IO errors become IOError

Performance

The bindings use PyO3’s efficient data exchange between Python and Rust. Large parsing operations should have minimal overhead compared to pure Rust usage.