code: def get_version():
      
      reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
      with open('requests_kerberos/__init__.py') as fd:
          matches = list(filter(lambda x: x, map(reg.match, fd)))
  
      if not matches:
          raise RuntimeError(
              'Could not find the version information for requests_kerberos'
              )
  
      return matches[0].group(1)
docs: Simple function to extract the current version using regular expressions.