pydngconverter.utils

Utility functions for PyDNGConverter.

Functions

ensure_existing_dir(path)

Ensure provided path exists and is a directory.

force_async(fn)

execute sync function in ‘awaitable’ thread.

locate_program(name)

Locates program path by name.

timeit(func)

Async variant of timeit.

pydngconverter.utils.ensure_existing_dir(path)

Ensure provided path exists and is a directory.

Parameters

path (Union[str, Path]) – path to check

Returns

Path object. NoneType: If path does not exists or is not a directory

Return type

Path

pydngconverter.utils.force_async(fn)

execute sync function in ‘awaitable’ thread.

pydngconverter.utils.locate_program(name)

Locates program path by name.

Parameters

name (str) – Name of executable

Returns

Pathlike Object to Program NoneType: If no suitable path is found

Return type

pathlib.Path

pydngconverter.utils.timeit(func)

Async variant of timeit.