Basics to get started

Xsession(): login to an Object Analytics Instance and init a Xsession instance

from xplain import Xsession
s = Xsession(url="http://myhost:8080", user="me",password="secret1")

Xsession.startup(file_name): load a XView (xstartup) file to setup a new xplain session

from xplain import Xsession

s = Xsession(url="http://myhost:8080", user="me",
password="secret1")
s.startup("myXview")

If you use the xplain python package locally in your python environment, then you do need to setup a startup. If you use the xplain python package at XOE in ObjectExplorer, then you do not need to setup a startup.

Xsession.load_from_session_id(session_id): load xplain session by given exisiting session id, in order to enable shared session between python and Object Analytics

get the session id from Object Analytics

Xsession.execute_query(): execute a query

Xsession.open_query(): execute an open query

Xsession.run(): To run a xplain method

perform xplain web api method and broadcast the change to other client sharing with same session id, if Python session is sharing the same session with Object Analytics, Object Analytics will be get updated.

Xession.perform(): Send POST request against entry point /xplainsession with payload as json, returns results as JSON

Xsession.get_result(query_name): get the result of a given query name as data frame.

3 different ways to perform a query

Following example shows how to count Items grouped by Item Type where Item Category = 10.0 in 3 different ways

References:

xplain.Query_config

Last updated