Python Inspect
# Inspect the modules in the package and loop through them. members = inspect.getmembers(sys.modules[package_name], inspect.ismodule) for name, data in members: if name == 'models.py': data.MyClass.run_function()