Skip to main content

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.

Release files for allset 1.0.1

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

Source distribution (sdist)

Source distribution for allset 1.0.1
File Size Uploaded
allset-1.0.1.zip 5.6 kB Details

Release files / allset-1.0.1.zip

Download URL allset-1.0.1.zip
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fe2d72f4e8ea3c151c399e4953a70acacdfc6c5f502aa756b555196420c0e746
BLAKE2b-256 checksum
How to use checksums
dccf3236a0dd131e4615e9ef9ff30c2a75a37ae2bc15dfab3562bfe20b1e1311
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0.0

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