title: SQLAlchemy and pylint
body: <p>SQLAlchemy seems to give me a ton of errors on pylint that I can't resolve.</p>
  
  <p>The first problem is that each table must be defined as a new class.</p>
  
  <p>Example:</p>
  
  <pre><code>class Person(BASE):
      """Person Table Definition"""
      __tablename__ = 'person'
      id = Column(Integer, primary_key=True)
      name = Column(String(30))
  </code></pre>
  
  <p>...causes these errors <strong><em>for each table</em></strong> I define:</p>
  
  <pre><code>W: 20, 0: Class has no __init__ method (no-init)
  R: 20, 0: Too few public methods (0/2) (too-few-public-methods)
  </code></pre>
  
  <p>The second problem is using a global variable for the SQLAlchemy <code>engine</code> and <code>BASE</code> constructs. I'm not sure how I can refactor this code to make these variables not global, since the parameter <code>BASE</code> must be passed into the table class definitions above.</p>
  
  <pre><code>BASE = sqlalchemy.ext.declarative.declarative_base()
  global engine
  ...
  def create_sqla_engine():
      """Create the SQLA engine"""
      global engine
      engine = create_engine('mysql+mysqlconnector://root:@127.0.0.1:3306/sqlalchemy_example')
  </code></pre>
  
  <p>I'm new to python but this seems ugly. pylint complains about it, too:</p>
  
  <pre><code>C: 51, 0: Invalid constant name "engine" (invalid-name)
  </code></pre>
  
  <p>Finally, pylint thinks I'm not using the imports that I am clearly using in this code.</p>
  
  <pre><code>W: 15, 0: Unused declarative_base imported from sqlalchemy.ext.declarative (unused-import)
  W: 16, 0: Unused sessionmaker imported from sqlalchemy.orm (unused-import)
  </code></pre>
  
  <p>...why? Is pylint not compatible with python3? Should I be importing the modules I need within the methods they are used, instead of at the top of the file?</p>