Package: mappersession
mappersessionSession management tools in python for the libmapper signal mapping frameworkInstallationSimply runpip install mappersessionin your python environment of choice.UsageUsage from the command-lineusage:
mappersession --load PATH [PATH ...] [--interactive] [--wait] [--persist] [--clear]
mappersession --unload PATH [PATH ...]
mappersession --save PATH [--description DESCRIPTION]
mappersession --print_session_tags

options:
-h, --help                  Show the help message and exit
--load PATH [PATH ...]      Mapping session JSON file(s) to load
--unload PATH [PATH ...]    Mapper session JSON file(s) to unload
--save PATH                 Save mapping session as JSON file
--interactive               Create libmapper signals for managing file
                            loading and unloading.
--wait                      Set if session should wait for missing
                            devices and signals and connected them as
                            they appear during session load
--persist                   Remain active during session load and
                            (re)create maps as they appear.
--clear                     Set if maps should be cleared after saving
                            and/or before load. Warning – this will
                            clear all maps regardless of session tag!
--print_session_tags        Print a list of active session tags
--description DESCRIPTION   Description of session, used when savingExamples:Load a session file and wait for needed signals to appear:python -m mappersession --load mysession.json --waitUnload a session file:python -m mappersession --unload mysession.jsonReplace a running session with anotherpython -m mappersession --unload sesh1.json --load sesh2.jsonStart an interactive session with libmapper control signals for loading/unloading each file:python -m mappersession --load session1.json session2.json --interactiveSave the current session and provide a description:python -m mappersession --save mysession.json --description "This session does something cool"Usage as a Python moduleImporting the moduleimport mappersession as sessionSaving a mapping session filesession.save(filename="", description="", values=[],
             viewName="", views=[], graph=None)paramfilename: The name of the file to saveoptional paramdescription: A short description of the current sessionoptional paramvalues: Array of {name, value} pairs for signals to set on session loadoptional paramviewName: Name of the GUI that's adding metadataoptional paramviews: GUI related object for recreating the sessionoptional paramgraph: A previously-allocated libmapper Graph object to use. If not provided one will be allocated internally.return: The session JSON objectLoading a mapping session filesession.load(filename, interactive=False, wait=False, persist=False, background=False, device_map=None, graph=None)loads session files and optionally waits for signals. Maps will be tagged with the filename using a property namedsession.paramfilename(String or List): The session file(s) to loadoptional paraminteractive(Boolean): Starts an interactive session for managing multiple session files. A libmapper control signal is created for corresponding to each file; setting the control signal value to a non-zero value loads the file, and setting it to zero unloads the file.optional paramwait(Boolean): Wait for missing signals during session load and create maps once they appear, defaultFalseoptional parampersist(Boolean): Continue running after creating maps in session, and recreate them as matching signals (re)appear, default Falseoptional parambackground(Boolean): True if waiting for signals should happen in a background thread, default Falseoptional paramdevice_map(Dict): A dictionary specifying correspondences between device names stored in a session file and names of devices active on the network.optional paramgraph: A previously-allocated libmapper Graph object to use. If not provided one will be allocated internally.return (Dict): visual session information relevant to GUIsUnloading a mapping session filesession.unload(filename, graph=None)loads session files and optionally waits for signals. Maps will be tagged with the filename using a property namedsession.paramfilename(String or List): The session file(s) to unloadoptional paramgraph: A previously-allocated libmapper Graph object to use. If not provided one will be allocated internally.return (None)Loading JSON-formatted session datasession.load_json(session_json, name=None, wait=False, persist=False, background=False, device_map=None, graph=None)loads a session JSON Dict with options for staging and clearingparam session_json (Dict): A session JSON Dict to loadoptional paramname(String): A name for the session; any maps created by this session will be tagged with the name.optional paramwait(Boolean): Wait for missing signals during session load and create maps once they appear, defaultFalseoptional parampersist(Boolean): Continue running after creating maps in session, and recreate them as matching signals (re)appear, default Falseoptional parambackground(Boolean): True if waiting for signals should happen in a background thread, default Falseoptional paramdevice_map(Dict): A dictionary specifying correspondences between device names stored in a session file and names of devices active on the network.optional paramgraph: A previously-allocated libmapper graph object to use. If not provided one will be allocated internally.return (Dict): visual session information relevant to GUIsGet a list of active session tagssession.tags(graph=None)optional paramgraph: A previously-allocated libmapper graph object to use. If not provided one will be allocated internally.return (List): a list of active session tags