for k in dir(constants):
    if k.startswith('_'):
        continue
setattr(sys.modules[package_name], k, getattr(constants, k))
Python: How to import all methods and attributes from a module dynamically