INNER CODE UNIT · Python

_export_kwargs

mindee/doctr · doctr/cli/main.py:239

def _export_kwargs(fmt: str, args: argparse.Namespace) -> dict[str, Any]:
    """Build the keyword arguments accepted by the exporter of the requested format

    Args:
        fmt: the canonical export format
        args: the parsed command-line arguments

    Returns:
        the keyword arguments to pass to `Document.export_as`
    """
    kwargs: dict[str, Any] = {}
    if fmt in {"json", "xml"}:
        kwargs["reading_order"] = args.reading_order
    if fmt == "xml":
        kwargs["file_title"] = args.file_title
    if fmt in {"txt", "md", "adoc", "html", "xml"}:
        kwargs["direction"] = args.direction
    if fmt in {"md", "adoc"}:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…