<h1>Things to remember about the flat API<aclass="headerlink"href="#things-to-remember-about-the-flat-api"title="Permalink to this headline">¶</a></h1>
<p>The flat API is a series of ‘shortcuts’ on the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> main library root (defined in
<codeclass="docutils literal notranslate"><spanclass="pre">evennia/__init__.py</span></code>). Its componentas are documented <aclass="reference internal"href="../Evennia-API.html"><spanclass="doc">as part of the auto-documentation</span></a>.</p>
<h2>To remember when importing from <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code><aclass="headerlink"href="#to-remember-when-importing-from-evennia"title="Permalink to this headline">¶</a></h2>
<p>Properties on the root of the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> package are <em>not</em> modules in their own right. They are just
shortcut properties stored in the <codeclass="docutils literal notranslate"><spanclass="pre">evennia/__init__.py</span></code> module. That means that you cannot use dot-
notation to <codeclass="docutils literal notranslate"><spanclass="pre">import</span></code> nested module-names over <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code>. The rule of thumb is that you cannot use
<codeclass="docutils literal notranslate"><spanclass="pre">import</span></code> for more than one level down. Hence you can do</p>
<p>This will give you an <codeclass="docutils literal notranslate"><spanclass="pre">ImportError</span></code> telling you that the module <codeclass="docutils literal notranslate"><spanclass="pre">default_cmds</span></code> cannot be found -
this is becasue <codeclass="docutils literal notranslate"><spanclass="pre">default_cmds</span></code> is just a <em>variable</em> stored in <codeclass="docutils literal notranslate"><spanclass="pre">evennia.__init__.py</span></code>; this cannot be
imported from. If you really want full control over which level of package you import you can always
bypass the root package and import directly from from the real location. For example
<codeclass="docutils literal notranslate"><spanclass="pre">evennia.DefaultObject</span></code> is a shortcut to <codeclass="docutils literal notranslate"><spanclass="pre">evennia.objects.objects.DefaultObject</span></code>. Using this full
path will have the import mechanism work normally. See <codeclass="docutils literal notranslate"><spanclass="pre">evennia/__init__.py</span></code> to see where the
<p><h3><ahref="../index.html">Table of Contents</a></h3>
<ul>
<li><aclass="reference internal"href="#">Things to remember about the flat API</a><ul>
<li><aclass="reference internal"href="#to-remember-when-importing-from-evennia">To remember when importing from <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code></a></li>