'Calculate an etag-suitable hash for document content or a section'

def calculate_etag(self, section_id=None):

    if (not section_id):
        content = self.html
    else:
        content = self.extract.section(self.html, section_id)
    return ('"%s"' % hashlib.sha1(content.encode('utf8')).hexdigest())
