title: How to import external library in Python custom class
body: <p>I'm new to Python and I'm struggling with importing external modules / packages inside a custom class.
  I did not found answers (probably because the terms I used are not the good ones) so I post here. It's basically a newbie question dealing with Python global understanding</p>
  
  <p>I've the following class:</p>
  
  <pre><code>class MyCustomClass:
    import openpyxl as xl
    from fuzzywuzzy import fuzz
    from fuzzywuzzy import process
    import time
  
    def __init__(self, file_path):
      self.file = xl.load_workbook(file_path)
  
     def some_method(self):
       start = time.time()
       process.extractOne(#calling args)
  </code></pre>
  
  <p>When I create an instance with this class structure I got `NameError: name 'xl' is not defined``</p>
  
  <p>It worked when using <code>self.xl</code> and self.time.
  Here are my questions:</p>
  
  <p>1) What is the good way to import module or packages in my class?</p>
  
  <p>2) Can I avoid to make them instance variables?</p>
  
  <p>Thanks for your help,</p>