iris reference#

class iris.Iris(**kwargs: Any)#

Iris is a Magics class for interacting with 1010data through Jupyter (bases IPython.core.magic.Magics).

If you are a user, you do not need to instantiate this class. Load the module using:

%load_ext iris (or %reload_ext)

You may refer to the function docstrings here for descriptions of available line and cell magics commands.

The line argument of a function holds all input provided after the command name on that line. The cell argument holds all input provided on the lines following the command line. For example:

%%ten_query ...line argument (command line options)...
...
cell argument (generally, query/code text)
...
ten_clearcache(line)#

Clear cache of an active 1010data session

Parameters:

line -- Optionally contains --session-name which indicates which session's cache to clear when there are multiple active sessions.

ten_config(line)#

Configure global options.

Parameters:

line -- can contain options: --timing-output, --resizable-grid, --session-name, --xmllog

ten_dir(line)#

Print 1010data directory listing

Parameters:

line -- contains any applicable options: --session-name, --clear-cache, --dir, --tenframe, --pandas, --nrows, --byte-strings, --labels, --iframe-height, --iframe-width

Raises:

NameError -- if there are no active sessions

Returns:

HTML grid widget representing results, or TenFrame (if --tenframe is used), or pandas DataFrame (if --pandas is used)

ten_get_config(line)#

Print current values for options.

Parameters:

line -- IGNORED

ten_get_ses(line)#

Get a py1010.Session object representing an active 1010data session.

Parameters:

line -- Optionally contains a --session-name which can be used to retrieve a session by name (given through login) when there is more than one active session.

Raises:

NameError -- if there are no active sessions

Returns:

py1010.Session object

ten_help(line)#

Print command line usage

ten_iris_version(line)#

Print iris version

Parameters:

line -- IGNORED

ten_login(line)#

Start a 1010data session

Parameters:

line -- Must contain --gateway and --user. User is prompted if --password is not provided. Optionally contains --kill and --session-name, which can be used to name a session that can later be retrieved with ten_get_ses

ten_py_stream(line, cell='')#

Run a block of python code in your session's server side process.

Parameters:
  • line -- contains any applicable options: --session-name, --base, --clear-cache, --tenframe, --pandas, --nrows, --byte-strings, --labels, --iframe-height, --iframe-width

  • cell -- code to run

Raises:

NameError -- if there are no active sessions

Returns:

HTML grid widget representing results, or TenFrame (if --tenframe is used), or pandas DataFrame (if --pandas is used)

ten_query(line, cell='')#

Run a 1010data macro language query.

Parameters:
  • line -- contains any applicable options: --session-name, --base, --clear-cache, --tenframe, --pandas, --nrows, --byte-strings, --labels, --iframe-height, --iframe-width

  • cell -- query to run

Raises:

NameError -- if there are no active sessions

Returns:

HTML grid widget representing results, or TenFrame (if --tenframe is used), or pandas DataFrame (if --pandas is used)

ten_quickapp(line, cell='')#

Run a 1010data macro language quickapp.

Parameters:
  • line -- contains any applicable options: --session-name, --clear-cache, --iframe-height, --iframe-width

  • cell -- query to run

Raises:

NameError -- if there are no active sessions

Returns:

HTML object representing the quickapp

ten_r_stream(line, cell='')#

Run a block of R code in your session's server-side process.

Parameters:
  • line -- contains any applicable options: --session-name, --base, --clear-cache, --tenframe, --pandas, --nrows, --byte-strings, --labels, --iframe-height, --iframe-width

  • cell -- code to run

Raises:

NameError -- if there are no active sessions

Returns:

HTML grid widget representing results, or TenFrame (if --tenframe is used), or pandas DataFrame (if --pandas is used)

ten_save_query(line, cell='')#

Save a 1010data query to the database

Parameters:
  • line -- contains any applicable options: --path, --replace, --title, --sdesc, --ldesc, --users, --run, --session-name, --base, --clear-cache, --tenframe, --pandas, --nrows, --byte-strings, --labels, --iframe-height, --iframe-width

  • cell -- code to run

Raises:

NameError -- if there are no active sessions

Returns:

HTML grid widget representing results, or TenFrame (if --tenframe is used), or pandas DataFrame (if --pandas is used)

ten_server_py_version(line)#

Get the server-side python version.

Parameters:

line -- IGNORED

Raises:

NameError -- if there are no active sessions

Returns:

Server-side python version information as a string.

ten_server_r_version(line)#

Get the server-side R version.

Parameters:

line -- IGNORED

Raises:

NameError -- if there are no active sessions

Returns:

Server-side R version information as a string.

ten_set_ses(line)#

Set a py1010.Session object representing an active 1010data session. WARNING: will overwrite active sessions, check with %ten_get_ses first. NOTE: you can access a TenFrame's underlying session at TenFrame.session.

Parameters:

line -- Contains --session--object with the py1010.Session, and optionally contains --session-name if assigning it to a specific name when there is more than one active session.

ten_sql(line, cell='')#

Run an SQL query.

Parameters:
  • line -- contains any applicable options: --session-name, --base, --clear-cache, --tenframe, --pandas, --nrows, --byte-strings, --labels, --iframe-height, --iframe-width

  • cell -- query to run

Raises:

NameError -- if there are no active sessions

Returns:

HTML grid widget representing results, or TenFrame (if --tenframe is used), or pandas DataFrame (if --pandas is used)