zlmdb._flatc

FlatBuffers compiler (flatc) bundled with zlmdb.

This module provides access to the flatc binary that is bundled with zlmdb, ensuring version compatibility with the vendored FlatBuffers runtime.

Usage from command line:

flatc --version
flatc --python -o output/ schema.fbs

Usage from Python:

from zlmdb._flatc import get_flatc_path, run_flatc

# Get path to flatc binary
flatc_path = get_flatc_path()

# Run flatc with arguments
returncode = run_flatc(["--version"])

Functions

get_flatc_path(→ pathlib.Path)

Get the path to the bundled flatc executable.

main(→ None)

Entry point for the flatc console script.

run_flatc(→ int)

Run the bundled flatc with the given arguments.

Package Contents

get_flatc_path() pathlib.Path[source]

Get the path to the bundled flatc executable.

Returns:

Path to the flatc binary

Raises:

FileNotFoundError – If flatc binary is not found

main() None[source]

Entry point for the flatc console script.

Forwards all CLI arguments to the bundled flatc binary.

run_flatc(args: List[str], cwd: str | None = None) int[source]

Run the bundled flatc with the given arguments.

Parameters:
  • args – Command line arguments to pass to flatc

  • cwd – Working directory for flatc execution

Returns:

Return code from flatc