chore: Logo parameter in docling CLI, prints cute ascii logo (#1294)
logo parameter in docling cli, prints cute ascii logo Signed-off-by: Maksym Lysak <mly@zurich.ibm.com> Co-authored-by: Maksym Lysak <mly@zurich.ibm.com>
This commit is contained in:
parent
14e9c0ce9a
commit
355d8dc7a6
@ -60,6 +60,44 @@ err_console = Console(stderr=True)
|
|||||||
ocr_factory_internal = get_ocr_factory(allow_external_plugins=False)
|
ocr_factory_internal = get_ocr_factory(allow_external_plugins=False)
|
||||||
ocr_engines_enum_internal = ocr_factory_internal.get_enum()
|
ocr_engines_enum_internal = ocr_factory_internal.get_enum()
|
||||||
|
|
||||||
|
DOCLING_ASCII_ART = r"""
|
||||||
|
████ ██████
|
||||||
|
███░░██░░░░░██████
|
||||||
|
████████░░░░░░░░████████████
|
||||||
|
████████░░░░░░░░░░░░░░░░░░████████
|
||||||
|
██████░░░░░░░░░░░░░░░░░░░░░░░░░░██████
|
||||||
|
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████
|
||||||
|
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████
|
||||||
|
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████
|
||||||
|
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████
|
||||||
|
██████░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░██████
|
||||||
|
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████
|
||||||
|
██████░░░░░░ ░░░░░░░░░░░░░░░ ░░░░░░██████
|
||||||
|
███▒██░░░░░ ████ ░░░░░░░░░░░░ ████ ░░░░░██▒███
|
||||||
|
███▒██░░░░░░ ████ ░░░░░░░░░░░░ ████ ░░░░░██▒████
|
||||||
|
███▒██░░░░░░ ██ ██ ░░░░░░░░░░░░ ██ ██ ░░░░░██▒▒███
|
||||||
|
███▒███░░░░░ ██ ░░░░████░░░░ ██ ░░░░░██▒▒███
|
||||||
|
████▒▒██░░░░░░ ░░░███▒▒▒▒███░░░ ░░░░░░░██▒▒████
|
||||||
|
████▒▒██░░░░░░░░░░░░░░░░░█▒▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░░░░░░███▒▒████
|
||||||
|
████▒▒▒██░░░░░░░░░░░░█████ ▒▒▒▒▒▒ ██████░░░░░░░░░░░██▒▒▒████
|
||||||
|
███▒▒▒▒██░░░░░░░░███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒███░░░░░░░░██▒▒▒▒███
|
||||||
|
███▒▒▒▒▒███░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░███▒▒▒▒▒███
|
||||||
|
████▒▒▒▒▒████░░░░░░██████████████████████░░░░░░████▒▒▒▒▒████
|
||||||
|
███▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░░░░░░░░░░░░░░████▒▒▒▒▒▒▒▒▒███
|
||||||
|
████▒▒▒▒▒▒▒▒███░░░░░████████████████████████▒▒▒▒▒▒▒▒▒████
|
||||||
|
████▒▒▒▒▒▒██░░░░░░█ █░░░░░██▒▒▒▒▒▒████
|
||||||
|
████▒▒▒▒█░░░░░░░█ D O C L I N G █░░░░░░░░██▒▒▒████
|
||||||
|
████▒▒██░░░░░░█ █░░░░░░░░░░█▒▒████
|
||||||
|
██████░░░░░░█ D O C L I N G █░░░░░░░░░░░██████
|
||||||
|
████░░░░░█ █░░░░░░░░░░░░████
|
||||||
|
█████░░█ D O C L I N G █░░░░░░░░░░░█████
|
||||||
|
█████ █░░░░░░░░████████
|
||||||
|
██ D O C L I N G █░░░░░░░░█████
|
||||||
|
█ █░░░████████
|
||||||
|
█████████████████████████████
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
app = typer.Typer(
|
app = typer.Typer(
|
||||||
name="Docling",
|
name="Docling",
|
||||||
no_args_is_help=True,
|
no_args_is_help=True,
|
||||||
@ -68,6 +106,12 @@ app = typer.Typer(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def logo_callback(value: bool):
|
||||||
|
if value:
|
||||||
|
print(DOCLING_ASCII_ART)
|
||||||
|
raise typer.Exit()
|
||||||
|
|
||||||
|
|
||||||
def version_callback(value: bool):
|
def version_callback(value: bool):
|
||||||
if value:
|
if value:
|
||||||
docling_version = importlib.metadata.version("docling")
|
docling_version = importlib.metadata.version("docling")
|
||||||
@ -356,6 +400,12 @@ def convert(
|
|||||||
device: Annotated[
|
device: Annotated[
|
||||||
AcceleratorDevice, typer.Option(..., help="Accelerator device")
|
AcceleratorDevice, typer.Option(..., help="Accelerator device")
|
||||||
] = AcceleratorDevice.AUTO,
|
] = AcceleratorDevice.AUTO,
|
||||||
|
docling_logo: Annotated[
|
||||||
|
Optional[bool],
|
||||||
|
typer.Option(
|
||||||
|
"--logo", callback=logo_callback, is_eager=True, help="Docling logo"
|
||||||
|
),
|
||||||
|
] = None,
|
||||||
):
|
):
|
||||||
if verbose == 0:
|
if verbose == 0:
|
||||||
logging.basicConfig(level=logging.WARNING)
|
logging.basicConfig(level=logging.WARNING)
|
||||||
|
Loading…
Reference in New Issue
Block a user