title: How to check if a couchdb document exists using python
body: <p>I was wondering if there is a way to check if a document with a particular ID exists in couchdb using couch python library. It seems that if I do this:</p>
  
  <pre><code>server = couchdb.Server('http://localhost:5984')
  db = server['tweets']
  mytemp = db[MyDocId]
  </code></pre>
  
  <p>and the document doesn't exist, the code throws a "ResourceNotFound" exception.</p>
  
  <p>I could just catch the exception and put my code in the exception handling portion, but it seems too dirty.</p>
  
  <p>I was hoping there is a way to have an "if" statement that checks whether a document with a particular key exists or not.</p>
  
  <p>Thanks!</p>