Command reference#

This section contains a list of line magic and cell magic commands for iris.

Line magic commands#

%ten_advanced_settings#

Invoke the Advanced Settings dialog in the 1010data GUI.

%ten_clearcache#

Delete the server-side subprocesses and the cache of the main process associated with your session.

%ten_clearcache --session-name MYSESSION

--session-name SESSION

Optional name of the session created in %ten_login.

%ten_company_manager#

Invoke the Company Manager dialog in the 1010data GUI.

%ten_config#

Configure global options.

%ten_config --timing-output False --xmllog logfile.txt --session-name mysession --sub-variables True

--timing-output [TRUE|FALSE]

Set to True to enable timing output, and False to disable timing output. The default value is True.

--resizable-grid [TRUE|FALSE]

Set to True to enable the resizable grid, and False to disable the resizable grid. The default value is False.

--session-name SESSION

The session name created in %ten_login.

--xmllog XMLLOG

Set the name of the transaction log file.

--sub-variables [TRUE|FALSE]

Set to True to enable simple Python variables in queries, and False to disable variables. To use variables in queries, enclose in braces: {variable}. For quoted values, use quotes around the braces.

%ten_dir#

List objects (directories, tables, queries). If no directory is specified using --dir, the root directory is listed by default. Throws a NameError if there are no active sessions.

%ten_dir --dir MYDIR

--session-name SESSION

Optional name of the session created in %ten_login.

--clear-cache or -J

Clear the session cache before running the query.

--dir DIR

Set the directory when running the query.

--tenframe TENFRAME

Assign results of the query as a TenFrame.

--pandas PANDAS

Assign results of the query as a pandas DataFrame.

--nrows NROWS or -n ROWS

Use with --pandas to get the number of rows to download as a pandas DataFrame. The default number of rows is 10.

--byte-strings

Use with --pandas to get string data as bytes.

--labels or -H

Use with --pandas to get labels instead of names when returning query results.

--iframe-height IFRAME_HEIGHT

Specify the HTML <iframe> height to use when rendering your QuickApp.

--iframe-width IFRAME_WIDTH

Specify the HTML <iframe> width to use when rendering your QuickApp.

%ten_filter_manager#

Invoke the Filter Manager dialog in the 1010data GUI.

%ten_get_config#

Display current values for configuration options, including timing output (True or False), resizable grid (True or False), allow variable substitution (True or False), and the name of the transaction log file, if there is one.

%ten_get_ses#

Access a session created through %ten_login. Throws a NameError if there are no active sessions.

--session-name SESSION

Optional name of the session created in %ten_login.

%ten_group_manager#

Invoke the Group Manager dialog in the 1010data GUI.

%ten_help#

Output command line help.

%ten_iris_version#

Return information about the iris version.

%ten_login#

Log in to 1010data to start a session.

%ten_login -g https://www2.corp.1010data.com/beta-latest/gw -u USERNAME --possess --xmllog log.txt

--gateway GATEWAY or -g GATEWAY

The gateway of the 1010data Insights Platform to connect to, such as https://www2.1010data.com/gw.

--user USER or -u USER

The user name.

--password PASSWORD or -p PASSWORD

Optional password. If not supplied, iris prompts for a password.

--kill or -k

Option to end an existing active session and start a new session.

--possess or -K

Option to possess a session if it exists.

--xmllog XMLLOG or -x XMLLOG

Option to write a transaction log.

--session-name SESSION

Option to provide a session name for the session.

%ten_role_manager#

Invoke the Role Manager dialog in the 1010data GUI.

%ten_scheduler#

Invoke the 1010data Scheduler in the 1010data GUI.

%ten_server_py_version#

Return the server-side Python version.

%ten_server_r_version#

Return the server-side R version.

%ten_set_ses#

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

Warning

%ten_set_ses will overwrite active sessions. Check the session with %ten_get_ses first.

--session-object SESSION_OBJECT

Provide an active py1010.Session object to use in this notebook/lab.

--session-name SESSION

Assign the session object to a specific session when there is more than one active session.

%ten_user_manager#

Invoke the User Manager dialog in the 1010data GUI.

%ten_user_profile#

Invoke the User Profile dialog in the 1010data GUI.

Cell magic commands#

%%ten_py_stream#

Run a block of python code in your session's server-side process. Returns an HTML grid widget representing results, or a TenFrame if --tenframe is used, or a pandas DataFrame if --pandas is used. Throws a NameError if there are no active sessions.

%%ten_py_stream --session-name mysession
...
PYTHON CODE
...

--session-name SESSION

Option to provide a session name for the session.

--base BASE

Name of the table to return.

--clear-cache or -J

Clear the session cache before running the query.

--tenframe TENFRAME

Assign results of the query as a TenFrame.

--pandas PANDAS

Assign results of the query as a pandas DataFrame.

--nrows NROWS or -n NROWS

Use with --pandas to get the number of rows to download as a pandas DataFrame. The default number of rows is 10.

--byte-strings

Use with --pandas to get string data as bytes.

--labels or -H

Use with --pandas to get labels instead of names when returning query results.

--iframe-height IFRAME_HEIGHT

Specify the HTML <iframe> height to use when rendering your QuickApp.

--iframe-width IFRAME_WIDTH

Specify the HTML <iframe> width to use when rendering your QuickApp.

%ten_query or %%ten_query#

Run a 1010data Macro Language query.

To run a simple query:

%ten_query --session-name mysession --base pub.demo.retail.item

To run a longer query:

%%ten_query --session-name mysession
...
MACRO LANGUAGE CODE
...

--session-name SESSION

Optional name of the session created in %ten_login.

--base BASE

Name of the table to return.

--clear-cache or -J

Clear the session cache.

--tenframe TENFRAME

The name of the TenFrame in which to save the results of the query.

--pandas PANDAS

The name of the DataFrame in which to save the results of the query.

--nrows NROWS or -n NROWS

The number of rows to download as a pandas DataFrame. The default number of rows is 10.

--byte-strings

Use with --pandas to get string data as bytes.

--labels or -H

Use with --pandas to get labels instead of names when returning query results.

--iframe-height IFRAME_HEIGHT

Specify the HTML <iframe> height to use when rendering your QuickApp.

--iframe-width IFRAME_WIDTH

Specify the HTML <iframe> width to use when rendering your QuickApp.

%%ten_quickapp#

Run a 1010data Macro Language QuickApp. Throws a NameError if there are no active sessions.

%%ten_quickapp --session-name mysession
...
QUICKAPP CODE
...

--session-name SESSION

Optional name of the session created in %ten_login.

--clear-cache or -J

Clear the session cache.

--iframe-height IFRAME_HEIGHT

Specify the HTML <iframe> height to use when rendering your QuickApp.

--iframe-width IFRAME_WIDTH

Specify the HTML <iframe> width to use when rendering your QuickApp.

%%ten_r_stream#

Run a block of R code in your session's server-side process. Returns an HTML grid widget representing results, or a TenFrame if --tenframe is used, or a pandas DataFrame if --pandas is used. Throws a NameError if there are no active sessions.

%%ten_r_stream --session-name mysession
...
R CODE
...

--session-name SESSION

Option to provide a session name for the session.

--base BASE

Name of the table to return.

--clear-cache or -J

Clear the session cache before running the query.

--tenframe TENFRAME

Assign results of the query as a TenFrame.

--pandas PANDAS

Assign results of the query as a pandas DataFrame.

--nrows NROWS or n NROWS

Use with --pandas to get the number of rows to download as a pandas DataFrame. The default number of rows is 10.

--byte-strings

Use with --pandas to get string data as bytes.

--labels or -H

Use with --pandas to get labels instead of names when returning query results.

--iframe-height IFRAME_HEIGHT

Specify the HTML <iframe> height to use when rendering your QuickApp.

--iframe-width IFRAME_WIDTH

Specify the HTML <iframe> width to use when rendering your QuickApp.

%%ten_save_query#

Save a 1010data Macro Language query as a Quick Query to the database.

%%ten_save_query --path mypath
...
MACRO LANGUAGE CODE
...

--path PATH

The 1010data database path at which to save the query.

--replace

If a Quick Query already exist at PATH, replace it with this query.

--title TITLE

The title of the saved Quick Query.

--sdesc SDESC

The short description of the saved Quick Query.

--ldesc LDESC

The long description of the saved Quick Query.

--users USERS

The authorized users for the saved Quick Query. Options are "inherit", "private", or a comma-separated list of users.

--run

Run the Quick Query being saved.

--session-name SESSION

Optional name of the session created in %ten_login.

--base BASE

Name of the table to return.

--clear-cache or -J

Clear the session cache.

--tenframe TENFRAME

The name of the TenFrame in which to save the results of the query.

--pandas PANDAS

The name of the DataFrame in which to save the results of the query.

--nrows NROWS or -n NROWS

The number of rows to download as a pandas DataFrame. The default number of rows is 10.

--byte-strings

Use with --pandas to get string data as bytes.

--labels or -H

Use with --pandas to get labels instead of names when returning query results.

--iframe-height IFRAME_HEIGHT

Specify the HTML <iframe> height to use when rendering your QuickApp.

--iframe-width IFRAME_WIDTH

Specify the HTML <iframe> width to use when rendering your QuickApp.

%%ten_sql#

Run a SQL query. Returns an HTML grid widget representing results, or a TenFrame if --tenframe is used, or a pandas DataFrame if --pandas is used. Throws a NameError if there are no active sessions.

%%ten_sql --session-name mysession
...
SQL CODE
...

--session-name SESSION

Option to provide a session name for the session.

--base BASE

Name of the table to return.

--clear-cache or -J

Clear the session cache before running the query.

--tenframe TENFRAME

Assign results of the query as a TenFrame.

--pandas PANDAS

Assign results of the query as a pandas DataFrame.

--nrows NROWS or -n NROWS

Use with --pandas to get the number of rows to download as a pandas DataFrame. The default number of rows is 10.

--byte-strings

Use with --pandas to get string data as bytes.

--labels or -H

Use with --pandas to get labels instead of names when returning query results.

--iframe-height IFRAME_HEIGHT

Specify the HTML <iframe> height to use when rendering your QuickApp.

--iframe-width IFRAME_WIDTH

Specify the HTML <iframe> width to use when rendering your QuickApp.

%%ten_uploader#

Invoke the Table Uploader GUI application.