zlmdb._flatc

FlatBuffers compiler (flatc) bundled with the package.

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

Usage from command line:

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

Usage from Python:

from <package>._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"])
Note: This file is shared across WAMP ecosystem projects via wamp-cicd.

Source: wamp-cicd/scripts/flatc/_flatc.py Projects copy this file to: src/<package>/_flatc/__init__.py

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