title: parsing SQL with python to find specific statements
body: <p>I am using sqlparse to try and find specific statements.</p>
  
  <p>code:</p>
  
  <pre><code>import sqlparse
  
  text = 'SELECT * FROM dbo.table'
  parse = sqlparse.parse(text)
  pizza = [t for t in parse[0].tokens if t.ttype in (sqlparse.tokens.Keyword)]
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>[&lt;DML 'SELECT' at 0x9f12318&gt;, &lt;Keyword 'FROM' at 0x9f12548&gt;]
  </code></pre>
  
  <p>but what I really want is to return the table name:</p>
  
  <pre><code>dbo.table
  </code></pre>
  
  <p>how can I do that?
  My end goal is to parse through folders of sql scripts and find references and other details.   </p>