Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

automodinit + X

Project Description

This package extends the the py-package ‘automodinit’ with the option also to import classes and functions inside a module.

If classes/functions have the same name as modules they will override them. This is useful if the ‘one class/function per file’ principle is used

autoXinit is listed in the Python Package Index. You can install it typing ‘pip install autoxinit’.

To init your package with autoXinit add the following to your

__all__ = []
# Don't modify the line above, or this line!
from autoxinit import autoxinit
autoxinit(__name__, __file__, globals())
del autoxinit

autoXinit also provides a test package. Importing this module via:

from autoxinit import test
  1. Execute the test environment
  2. Imports all modules AND all included (dummy) functions/classes. If a function/class share the same same with its parent module calling the modules name leeds to the function/class.

File structure of the test package:

    • class testClass
    • def testFunction
    • class testModuleClass
    • def testModuleFunction

Instead of typing:

from test.testClass import testClass
from test.testFunction import testFunction

You can import your classes/functions directly via:

from test import testClass
from test import testFunction

As written before the imported names are only overridden if the name of a class/function is identical to the name of the module. That’s why you can still access:

from test import testModule
from testModule import testModuleClass
from testModule import testModuleFunction

Release History

This version
History Node


History Node


History Node


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
(6.6 kB) Copy SHA256 Hash SHA256
Wheel 2.7 May 11, 2014
(3.9 kB) Copy SHA256 Hash SHA256
Source None May 11, 2014

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers