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) → NoneSummary
create a Session object
Parameters
debug: boolwhether to trigger extra debugging statements
packer/unpacker: str : 'orjson', 'json', 'pickle', 'msgpack' or import_stringimportstrings 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: callablesYou 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: bytesThe session as bytes
username: unicodeusername added to message headers. The default is to ask the OS.
key: bytesThe key used to initialize an HMAC signature. If unset, messages will not be signed or checked.
signature_scheme: strThe 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: filepathThe file containing a key. If this is set, key will be initialized to the contents of the file.
Aliases
jupyter_client.channels.Session.__init__