This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: html.services.sessions.sessionmanager

A base class session manager.

1 Class

class IPython.html.services.sessions.sessionmanager.SessionManager(**kwargs)

Bases: IPython.config.configurable.LoggingConfigurable


Start a database connection

create_session(path=None, kernel_name=None)

Creates a session and returns its model


Start a cursor and create a database called ‘session’


Deletes the row in the session database with given session_id


Returns the model for a particular session.

Takes a keyword argument and searches for the value in the session database, then returns the rest of the session’s info.


**kwargs : keyword argument

must be given one of the keywords and values from the session database (i.e. session_id, path, kernel_id)


model : dict

returns a dictionary that includes all the information from the session described by the kwarg.


Returns a list of dictionaries containing all the information from the session database


Create a uuid for a new session


Takes sqlite database session row and turns it into a dictionary

save_session(session_id, path=None, kernel_id=None)

Saves the items for the session with the given session_id

Given a session_id (and any other of the arguments), this method creates a row in the sqlite session database that holds the information for a session.


session_id : str

uuid for the session; this method must be given a session_id

path : str

the path for the given notebook

kernel_id : str

a uuid for the kernel associated with this session


model : dict

a dictionary of the session model


Check to see if the session for a given notebook exists

update_session(session_id, **kwargs)

Updates the values in the session database.

Changes the values of the session with the given session_id with the values from the keyword arguments.


session_id : str

a uuid that identifies a session in the sqlite3 database

**kwargs : str

the key must correspond to a column title in session database, and the value replaces the current value in the session with session_id.