title: How do I get the file / key size in boto S3?
body: <p>There must be an easy way to get the file size (key size) without pulling over a whole file.  I can see it in the Properties of the AWS S3 browser.  And I think I can get it off the "Content-length" header of a "HEAD" request.  But I'm not connecting the dots about how to do this with boto.  Extra kudos if you post a link to some more comprehensive examples than are in the <a href="http://boto.cloudhackers.com/" rel="noreferrer">standard boto docs</a>.</p>
  
  <p>EDIT: So the following seems to do the trick (though from looking at source code I'm not completely sure.):</p>
  
  <pre><code>bk = conn.get_bucket('my_bucket_name')
  ky = boto.s3.key.Key(bk)
  ky.open_read()  ## This sends a GET request. 
  print ky.size
  </code></pre>
  
  <p>For now I'll leave the question open for comments, better solutions, or pointers to examples.</p>