Populate library namespace without incurring immediate import costs
lazy-loader makes it easy to load subpackages and functions on demand. Motivation Allow subpackages to be made visible to users without incurring import costs. Allow external libraries to be imported only when used, improving import times. For a more detailed discussion, see the SPEC. Installation pip install -U lazy-loader Usage Lazily load subpackages Consider the __init__.py from scikit-image: subpackages = [ …, ‘filters’, … ] import lazy_loader as lazy __getattr__, __dir__, _
Read more