title: How to structure python packages without repeating top level name for import
body: <p>I'm brand new at python package management, and surely have done something wrong.  I was encouraged to create a directory structure as follows:</p>
  
  <pre><code>bagoftricks
  ├── bagoftricks
  │   ├── bagoftricks
  │   │   ├── __init__.py
  │   │   └── bagoftricks.py
  │   └── __init__.py
  ├── README.md
  └── setup.py
  </code></pre>
  
  <p>bagoftricks.py contains two functions, <code>levenshtein()</code> and <code>geofind()</code>.</p>
  
  <p>I would like to call these as:</p>
  
  <pre><code>import bagoftricks
  
  x = bagoftricks.levenshtein(arg1,arg2) 
  </code></pre>
  
  <p>Instead, I find I have to do this:</p>
  
  <pre><code>import bagoftricks
  
  x = bagoftricks.bagoftricks.levenshtein(arg1,arg2) 
  </code></pre>
  
  <p>Is there a better way to organize my packages in the first place, without the naming redundancy?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>So, I followed Avichal Badaya's instructions below, and removed one level of nesting.  That is, I now have...</p>
  
  <pre><code>bagoftricks
  ├── bagoftricks
  │   ├── __init__.py
  │   └── bagoftricks.py
  ├── README.md
  └── setup.py
  </code></pre>
  
  <p>However, to call this package, I still have...</p>
  
  <pre><code>from bagoftricks.bagoftricks import geofind()
  </code></pre>
  
  <p>or</p>
  
  <pre><code>import bagoftricks
  </code></pre>
  
  <p>then</p>
  
  <pre><code>&gt;&gt;&gt; bagoftricks.bagoftricks.geofind()
  </code></pre>
  
  <p>Rather than the desired....</p>
  
  <pre><code>from bagoftricks import geofind()
  </code></pre>
  
  <p>or</p>
  
  <pre><code>import bagoftricks
  
  &gt;&gt;&gt; bagoftricks.geofind()
  </code></pre>
  
  <p>I cannot remove that extra layer of nesting.  When I try, by analogy, to remove one more level of nesting, so that my module is flat, as:</p>
  
  <pre><code>bagoftricks
  ├── __init__.py
  ├── bagoftricks.py
  ├── README.md
  └── setup.py
  </code></pre>
  
  <p>I cannot build the package at all...</p>
  
  <pre><code>$ python setup.py build
  running build
  running build_py
  error: package directory 'bagoftricks' does not exist
  </code></pre>
  
  <p>What's the secret for natural imports like standard packages use, without redundant top-level name imports?</p>