{ } Raw JSON

bundles / jupyter_client latest / jupyter_client / session / Session / __init__

function

jupyter_client.session:Session.__init__

source: /jupyter_client/session.py:537

Signature

def __init__(self, **kwargs: t.Any) → None

Summary

create a Session object

Parameters

debug : bool

whether to trigger extra debugging statements

packer/unpacker : str : 'orjson', 'json', 'pickle', 'msgpack' or import_string

importstrings for methods to serialize message parts. If just 'json' or 'pickle', predefined JSON and pickle packers will be used. Otherwise, the entire importstring must be used.

The functions must accept at least valid JSON input, and output bytes.

For example, to use msgpack: packer = 'msgpack.packb', unpacker='msgpack.unpackb'

pack/unpack : callables

You can also set the pack/unpack callables for serialization directly.

session : unicode (must be ascii)

the ID of this Session object. The default is to generate a new UUID.

bsession : bytes

The session as bytes

username : unicode

username added to message headers. The default is to ask the OS.

key : bytes

The key used to initialize an HMAC signature. If unset, messages will not be signed or checked.

signature_scheme : str

The message digest scheme. Currently must be of the form 'hmac-HASH', where 'HASH' is a hashing function available in Python's hashlib. The default is 'hmac-sha256'. This is ignored if 'key' is empty.

keyfile : filepath

The file containing a key. If this is set, key will be initialized to the contents of the file.

Aliases

  • jupyter_client.channels.Session.__init__