title: Refactoring a python project that has a lot libraries that have "from smthng import *"
body: <p>I start a python project that continues developing. It has 10 local libraries. Each of them call each other &quot;from name import *&quot;. For a example from main:</p>
  <pre><code>from name3 import *
  from name2 import *
  from general_functions import *
  from messages import *
  from network import *
  from keyboard_functions import *
  from process_functions import *
  from name4 import *
  from settings import *  # settings
  </code></pre>
  <p>According to zen of python, explicit is better than implicit. Also due to understanding and debugging project, i need explicit the importing methods and variables.</p>
  <p>Also other libraries use the same import methods. I feel all libraries import all libraries by the &quot;*&quot;.</p>
  <p>I try to refactoring by the hand</p>
  <pre><code>from debug_functions import (print_log, print_log2, debug_functions_initilizer, debug_prints_abbrev, print_setting_info,
                               print_error, print_warn, print_error_warning_count_of_this_process, print_debug,
                               print_performance_report)
  </code></pre>
  <p>like this.</p>
  <p>But i stopped when i see deep.</p>
  <p>For example a.py import exp1 library. In the b.py, it call <code>from a.py import *</code>. So in the b.py, exp1 library can be used without import exp1. So in the b.py, if i convert <code>from a.py import *</code> to explicit form, <code>from a.py import something</code>, there occury errors that depend on exp1 library. There are a lot of example like that.</p>
  <p>How do I solve the problem?</p>
  <p><strong>UPDATE</strong></p>
  <p>What did I?
  I import libraries with their own methods, variables to each library.
  For example I have a.py, b.py and c.py libraries.
  I import a.py and b.py with their own all methods to c.py. Like that,</p>
  <p><code>from a import foo, bar</code>
  <code>from b import exp, solv</code></p>
  <p>In b.py, in the same way,
  <code>from a import foo, bar</code>
  <code>from c import sa, as</code></p>
  <p>After that for now, libraries have necessary methods from real owner, not a 3rd library.</p>
  <p>In the end, I delete unused methods in libraries.</p>