jupyterhub-client

Client for JupyterHub REST API


License
BSD-3-Clause
Install
pip install jupyterhub-client==0.1.0

Documentation

jupyterhub-client

Build Status

Example Python client(s) for the JupyterHub REST API. There's a synchronous client implemented with Requests, and an async client using tornado coroutines.

sync example

export JPY_API_TOKEN=`jupyterhub token`
import os
from jupyterhub_client import JupyterHubClient

hub = JupyterHubClient(os.environ['JPY_API_TOKEN'])
users = hub.list_users()

async example

export JPY_API_TOKEN=`jupyterhub token`
import os
from jupyterhub_client.async import AsyncJupyterHubClient
from tornado import gen

@gen.coroutine
def stuff():
    hub = AsyncJupyterHubClient(os.environ['JPY_API_TOKEN'])
    users = yield hub.list_users()
    yield hub.stop_server('bonk')