Skip to main content

Import objects dynamically, lazily, "weakly", and more.

Project description

Need to import an object when all you’ve got is its name? Need to lazily import modules, such that they don’t actually get loaded until you use them? Want to have some code in a module that only gets run if another module is imported? Then you need the “Importing” toolkit.

Installing the toolkit (using "easy_install Importing" or "setup.py install") allows you to access the peak.util.imports module. This module was previously bundled for years inside of the general PEAK distribution, but is now available as a standalone module for your convenience.

The “Importing” toolkit does not install or use any special import hooks, and is compatible with zipfile imports, py2exe, etc. Lazy and weak imports should be compatible with almost any import hooks or hacks, as long as they have reasonable support for the reload() builtin. The dynamic import utilities, however, require only that __import__() work correctly, and so should work anywhere that normal Python imports work.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Importing-1.9.1.zip (14.6 kB view hashes)

Uploaded Source

Built Distributions

Importing-1.9.1-py2.4.egg (11.1 kB view hashes)

Uploaded Source

Importing-1.9.1-py2.3.egg (27.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page