title: Import functions directly from Python 3 modules
body: <p>I have the following folder structure for a Python 3 project where <code>vehicle.py</code> is the main script and the folder <code>stats</code> is treated as a package containing several modules:</p>
  
  <p><a href="https://i.stack.imgur.com/ohzSm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ohzSm.png" alt="enter image description here"></a></p>
  
  <p>The <code>cars</code> module defines the following functions:</p>
  
  <pre><code>def neon():
      print('Neon')
      print('mpg = 32')
  
  
  def mustang():
      print('Mustang')
      print('mpg = 27')
  </code></pre>
  
  <p>Using Python 3, I can access the functions in each module from within <code>vehicle.py</code> as follows:</p>
  
  <pre><code>import stats.cars as c
  
  c.mustang()
  </code></pre>
  
  <p>However, I would like to access the functions defined in each module directly, but I receive an error when doing this:</p>
  
  <pre><code>import stats as st
  
  st.mustang()
  # AttributeError: 'module' object has no attribute 'mustang'
  </code></pre>
  
  <p>I also tried placing an <code>__init__.py</code> file in the <code>stats</code> folder with the following code:</p>
  
  <pre><code>from cars import *
  from trucks import *
  </code></pre>
  
  <p>but I still receive an error:</p>
  
  <pre><code>import stats as st
  
  st.mustang()
  # ImportError: No module named 'cars'
  </code></pre>
  
  <p>I'm trying to use the same approach as NumPy such as:</p>
  
  <pre><code>import numpy as np
  
  np.arange(10)
  # prints array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
  </code></pre>
  
  <p>How can I create a package like NumPy in Python 3 to access functions directly in modules?</p>