title: packaging common python namespaces
body: <p>I'm looking to package and upload a library I have to PyPI in the next few days, but I'm a little unsure about my approach to the namespace.</p>
  
  <p>I have a few otherwise unrelated projects with a similar approach and wanted to give them all the same namespace. For example:</p>
  
  <ul>
  <li>Library 1 namespace:  <code>abc.seo</code></li>
  <li>Library 2 namespace:  <code>abc.ajax</code></li>
  <li>Library 3 namespace:  <code>abc.ecommerce</code></li>
  <li>etc</li>
  </ul>
  
  <p>The problem is that I'm not sure if it's possible for two separate packages (eg eggs) to co-exist with the same parent namespace. Is this approach problematic, or is there a way around it? What's the best approach?</p>
  
  <p>The libraries should not be packaged together, they are too unrelated. I would like to get it right before uploading so as to avoid painful namespace changes after making an "official" release.</p>
  
  <p><sup>(NB <code>abc</code> is not the real name, I wanted my question to be free from advertising)</sup></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I went with the following, to be nice to the people without setuptools installed:</p>
  
  <pre><code>try:
      __import__('pkg_resources').declare_namespace(__name__)
  except ImportError:
      __path__ = __import__('pkgutil').extend_path(__path__, __name__)
  </code></pre>
  
  <p>With the following in <code>setup.py</code>:</p>
  
  <pre><code>setup(
      ...
      namespace_packages = ['rollyourown'],
      ...
  </code></pre>