code: def get_version():
      
      with open('sj.py') as source:
          for node in ast.walk(ast.parse(source.read(), 'sj.py')):
              if node.__class__.__name__ == 'Assign' and \
                 node.targets[0].__class__.__name__ == 'Name' and \
                 node.targets[0].id == '__version__':
                  return node.value.s
docs: Get the version from the source, but without importing.