Files
Investidor-V2/outputs/investmoz-audit-current-20261012/line12-pdf-tools/pypdfium2/_lazy.py
T
nala c13f250b87
tests / ci (push) Canceled after 0s
versao compilada
2026-10-15 17:37:00 +02:00

29 lines
843 B
Python

# SPDX-FileCopyrightText: 2026 geisserml <geisserml@gmail.com>
# SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
# see https://gist.github.com/mara004/6915e904797916b961e9c53b4fc874ec for alternative approaches to deferred imports
import logging
from pypdfium2_cfg.stl import cached_property
logger = logging.getLogger(__name__)
class _LazyClass:
@cached_property
def PIL_Image(self):
logger.debug("Evaluating lazy import 'PIL.Image' ...")
import PIL.Image; return PIL.Image
@cached_property
def numpy(self):
logger.debug("Evaluating lazy import 'numpy' ...")
import numpy; return numpy
@cached_property
def tabulate(self):
# logger.debug("Evaluating lazy import 'tabulate' ...")
from tabulate import tabulate; return tabulate
Lazy = _LazyClass()