'GET /api/info returns detailed info about the Hub and its API.
It is not an authenticated endpoint.
For now, it just returns the version of JupyterHub itself.'

@admin_only
def get(self):

    def _class_info(typ):
        'info    about    a    class    (Spawner    or    Authenticator)'
        info = {'class': '{mod}.{name}'.format(mod=typ.__module__, name=typ.__name__)}
        pkg = typ.__module__.split('.')[0]
        try:
            version = sys.modules[pkg].__version__
        except (KeyError, AttributeError):
            version = 'unknown'
        info['version'] = version
        return info
    data = {'version': __version__, 'python': sys.version, 'sys_executable': sys.executable, 'spawner': _class_info(self.settings['spawner_class']), 'authenticator': _class_info(self.authenticator.__class__)}
    self.finish(json.dumps(data))
