Skip to main content

Generates dynamic bindings for module imports

Project description

A small python utility for auto-completing __all__ and binding sub-modules in __init__.py files.

How to Use

Add these lines to the top of your __init__.py.

import allset
allset.set_all_submodules(globals())
allset.bind_all_submodules(globals())
del allset

Now you can reference any sub-module with import mysubmodule or from mysubmodule import SubModClassDef. Additionally, the from mymodule import * will work as though you specified all sub-modules in __all__ manually.

What’s it do?

  • set_all_submodules sets up you __all__ variable by auto-detecting the files and sub-modules in the current directory.
  • bind_all_submodules takes the submodules found in set_all_submodules and applies them to the current namespace.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
allset-1.0.1.zip (5.6 kB) Copy SHA256 hash SHA256 Source None Apr 1, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page