INNER CODE UNIT · Python

_resolve_format

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

def _resolve_format(args: argparse.Namespace) -> str:
    """Resolve the canonical export format, inferring it from the output extension if needed

    Args:
        args: the parsed command-line arguments

    Returns:
        one of 'json', 'txt', 'md', 'adoc', 'html', 'xml'
    """
    if args.format is not None:
        return FORMAT_ALIASES[args.format.strip().lower()]
    return SUFFIX_ALIASES.get(Path(args.output).suffix.lower(), "json")


def _load_document(args: argparse.Namespace) -> list[np.ndarray]:
    """Load every input into a single list of pages

    Args:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…