Skip to main content

1 lazyimport

PyPI-Status PyPI-Versions Build-Status Codecov LICENCE

lazyimport lets you import python modules lazily.

from lazyimport import lazyimport
lazyimport(globals(), """
  from mypackage import submodule
  import another_package
  """
)

1.1 Installation

Install lazyimport with:

pip install lazyimport

1.2 Use

The lazyimport function taks two parameters:

  • scope - The scope into which the given imports are imported. A common use case is to provide this parameter with the global scope by assigning scope=globals().

  • text - The string giving the import code to perform lazily. For example, "from pandas import DataFrame".

Example use:

from lazyimport import lazyimport
lazyimport(globals(), """
  from mypackage import submodule
  import another_package
  """
)

1.3 Credits

Written by John Arbash Meinel, Martin von Gagern, Martin Packman and others as part of the the GNU Bazaar revision control system.

As such, lazyimport is distributed under the GNU General Public License v3, like GNU Bazzar itself.

Slightly adapted to package form by Shay Palachy.

Release files for lazyimport 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for lazyimport 0.0.4
File Interpreter ABI Platform
lazyimport-0.0.4-py3-none-any.whl Python 3 none any Details

Release files / lazyimport-0.0.4-py3-none-any.whl

Download URL lazyimport-0.0.4-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
076a7dbda122119a5ef23a2e32d08261b0c61c6e4ef74927061a19027467cdb1
BLAKE2b-256 checksum
How to use checksums
4cb07c85e795766bbed23fbbb5e9bb2ed78b8ff0b47854f958f1728a1611bd92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file

0.0.3

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page