Namespace packages
The Zen of Python, which you can read by writing import this
in the interpreter session, says the following about namespaces:
Namespaces are one honking great idea—let's do more of those!
And this can be understood in at least two ways. The first is a namespace in the context of the language. We all use namespaces without even knowing:
- The global namespace of a module
- The local namespace of the function or method invocation
- The built-in name's namespace
The other kind of namespaces can be provided at packaging levels. These are namespaced packages. This is often an overlooked feature that can be very useful in structuring the package ecosystem in your organization or in a very large project.
Why is it useful?
Namespace packages can be understood as a way of grouping related packages or modules higher than a meta-package level, where each of these packages can be installed independently.
Namespace packages are especially useful if you have your application components...