title: Dump data from malformed SQLite in Python
body: <p>I have a malformed database. When I try to get records from any of two tables, it throws an exception:</p>
  
  <blockquote>
    <p>DatabaseError: database disk image is malformed</p>
  </blockquote>
  
  <p>I know that through commandline I can do this:</p>
  
  <pre><code>sqlite3 ".dump" base.db | sqlite3 new.db
  </code></pre>
  
  <p>Can I do something like this from within Python?</p>