Frequently Used Python SWAT Classes for CAS in SAS Viya
The SAS Viya SWAT (SAS Scripting Wrapper for Analytics Transfer) package provides Python classes for interacting with CAS (Cloud Analytic Services). The most frequently used classes are CASResults, which contains the output of CAS actions, and CASTable, which represents an in-memory table on the CAS server.
CASResults
To introduce the classes that are part of SWAT, put the results of the serverStatus action in a variable and display the type:

As shown, the class is CASResults. The class is a subclass of Python's dictionary. One aspect of the serverStatus action is that the results include a table that is named Server. That table shows the number of actions that were run. The following figure shows how you can access that table from the result and display it:

This is an introduction to the CASResults class. There are more examples that demonstrate how to work with results in this document.
CASTable
The CASTable class represents an in-memory table in SAS Cloud Analytic Services.
A simple way to work with a CASTable is to use the upload_file method that can download a file from a website, transfer it to the server, and then import it.

CASTable objects can accept the name of an action, such as table.columnInfo. Your session can then run the action on the table.

Because the purpose of the server is to analyze data, the CASTable class is designed to provide a syntactic shortcut for running actions. The following two programming snippets are functionally equivalent.
Using a CASTable Object to Run an Action
titanic3.table.columnInfo()
Running an Action and Specifying the Table Parameter
s.table.columnInfo(table="titanic3")
You can use a CASTable object to run an action and then save the result in a CASResults instance.

In the preceding example, the SummaryResults variable is a CASResults object. In many cases, an action produces many tabular results in the CASResults object. These tabular results are SASDataFrame objects. They are a subclass of Pandas DataFrame with SAS metadata such as labels, titles, and columns. Otherwise, they are equivalent.

Additional Classes
See the API reference for the SWAT package to learn more about the CASResults class, the CASTable class, and additional classes.