Teradata Package for Python Function Reference on VantageCloud Lake - list_user_envs - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference on VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Package for Python
Release Number
20.00.00.03
Published
December 2024
ft:locale
en-US
ft:lastEdition
2024-12-19
dita:id
TeradataPython_FxRef_Lake_2000
Product Category
Teradata Vantage
teradataml.scriptmgmt.lls_utils.list_user_envs = list_user_envs(env_name=None, **kwargs)
DESCRIPTION:
    Lists the Python OR R environments created by the session user in
    Open Analytics Framework.
 
PARAMETERS:
    env_name:
        Optional Argument.
        Specifies the string or regular expression to filter name of the environment.
        Types: str
 
    base_env:
        Optional Argument.
        Specifies the string or regular expression to filter the base Python environment.
        Types: str
 
    desc:
        Optional Argument.
        Specifies the string or regular expression to filter the description
        about the environment.
        Types: str
    
    case:
        Optional Argument.
        Specifies whether filtering operation should be case sensitive or not.
        Default Value: False
        Types: boolean
 
    conda_env:
        Optional Argument.
        Specifies the boolean value to filter the conda environment(s).
        When set to True, all conda environments are listed.
        When set to False, all non-conda environments are listed.
        If not specified, all user environments are listed.
        Types: bool
 
    regex:
        Optional Argument.
        Specifies whether string passed to "env_name", "base_env", and "desc"
        should be treated as regular expression or a literal.
        When set to True, string is considered as a regular expression pattern,
        otherwise treats it as literal string.
        Default Value: True
        Types: boolean
    
    flags:
        Optional Argument.
        Specifies flags to pass for regular expressions in filtering.
        For example
            re.IGNORECASE.
        Default Value: 0
        Types: int
 
RETURNS:
    Pandas DataFrame.
    Function returns remote user environments and their details in a Pandas dataframe.
    Function will help user find environments created, version of Python language used
    in the environment and description of each environment if provided at the time of
    environment creation.
 
RAISES:
    TeradataMlException.
 
EXAMPLES:
    # Create example environments.
    >>> create_env('Fraud_Detection',
    ...            'python_3.7.13',
    ...            'Fraud detection through time matching')
        User environment 'Fraud_detection' created.
    >>> create_env('Lie_Detection',
    ...            'python_3.7.13',
    ...            'Lie detection through time matching')
        User environment 'Lie_Detection' created.
    >>> create_env('Lie_Detection_ML',
    ...            'python_3.8.13',
    ...            'Detect lie through machine learning.')
        User environment 'Lie_Detection_ML' created.
    >>> create_env('Sales_env',
    ...            'python_3.9.13',
    ...            'Sales team environment.')
        User environment 'Sales_env' created.
    >>> create_env('Customer_Trends',
    ...            'r_4.1.3',
    ...            'Analyse customer trends.')
    User environment 'Customer_Trends' created.
    >>> create_env('Carbon_Credits',
    ...            'r_3.6.3',
    ...            'Prediction of carbon credits consumption.')
    User environment 'Carbon_Credits' created.
    >>> create_env('Sales_cond_env',
    ...            'python_3.9',
    ...            'Sales team environment.',
    ...            conda_env=True)
    Conda environment creation initiated
    User environment 'Sales_cond_env' created.
 
    # Example 1: List all available user environments.
    >>> list_user_envs()
               env_name                           env_description  base_env_name language  conda
    0    Carbon_Credits  Prediction of carbon credits consumption        r_3.6.3        R  False
    1   Customer_Trends                   Analyse customer trends        r_4.1.3        R  False
    2   Fraud_Detection     Fraud detection through time matching  python_3.7.13   Python  False
    3     Lie_Detection       Lie detection through time matching  python_3.7.13   Python  False
    4  Lie_Detection_ML      Detect lie through machine learning.  python_3.8.13   Python  False
    5         Sales_env                   Sales team environment.  python_3.9.13   Python  False
    6    Sales_cond_env                   Sales team environment.     python_3.9   Python  True
 
 
    # Example 2: List all user environments with environment name containing string
    #            "Detection" and description that contains string "."(period).
    >>> list_user_envs(env_name="Detection", desc=".", regex=False)
               env_name                       env_description base_env_name language  conda
    2  Lie_Detection_ML  Detect lie through machine learning. python_3.8.13   Python  False
    >>>
 
    # Example 3: List all user environments with description that contains string "lie"
    #            and is case sensitive. 
    >>> list_user_envs(desc="lie", case=True)
               env_name                       env_description  base_env_name language  conda
    4  Lie_Detection_ML  Detect lie through machine learning.  python_3.8.13   Python  False
    >>>
 
    # Example 4: List all user environments with base environment version containing string
    #            "3.".
    >>> list_user_envs(base_env="3.")
               env_name                           env_description  base_env_name language  conda
    0    Carbon_Credits  Prediction of carbon credits consumption        r_3.6.3        R  False
    2   Fraud_Detection     Fraud detection through time matching  python_3.7.13   Python  False
    3     Lie_Detection       Lie detection through time matching  python_3.7.13   Python  False
    4  Lie_Detection_ML      Detect lie through machine learning.  python_3.8.13   Python  False
    5         Sales_env                   Sales team environment.  python_3.9.13   Python  False
    6   Sales_conda_env                   Sales team environment.     python_3.9   Python  True
 
    >>>
 
    # Example 5: List all user environments with environment name contains string "detection",
    #            description containing string "fraud" and base environment containing string "3.7".
    >>> list_user_envs("detection", desc="fraud", base_env="3.7")
              env_name                        env_description  base_env_name language  conda
    2  Fraud_Detection  Fraud detection through time matching  python_3.7.13   Python  False
    >>>
 
    # Example 6: List all user environments with environment name that ends with "detection".
    >>> list_user_envs("detection$")
              env_name                        env_description  base_env_name language  conda
    2  Fraud_Detection  Fraud detection through time matching  python_3.7.13   Python  False
    3    Lie_Detection    Lie detection through time matching  python_3.7.13   Python  False
    >>>
 
    # Example 7: List all user environments with description that has either "lie" or "sale".
    #            Use re.VERBOSE flag to add inline comment.
    >>> list_user_envs(desc="lie|sale # Search for lie or sale.", flags=re.VERBOSE)
               env_name                       env_description  base_env_name language  conda
    3     Lie_Detection   Lie detection through time matching  python_3.7.13   Python  False
    4  Lie_Detection_ML  Detect lie through machine learning.  python_3.8.13   Python  False
    5         Sales_env               Sales team environment.  python_3.9.13   Python  False
    6   Sales_conda_env               Sales team environment.     python_3.9   Python  True
    >>>
 
    # Example 8: List all user environments where python 3 environment release version has 
    #            odd number. For e.g. python_3.7.x. 
    >>> list_user_envs(base_env="\.\d*[13579]\.")
              env_name                        env_description  base_env_name language
    1  Customer_Trends                Analyse customer trends        r_4.1.3        R
    2  Fraud_Detection  Fraud detection through time matching  python_3.7.13   Python
    3    Lie_Detection    Lie detection through time matching  python_3.7.13   Python
    5        Sales_env                Sales team environment.  python_3.9.13   Python
    >>>
 
    # Example 9: List all conda environments.
    >>> list_user_envs(conda_env=True)
              env_name          env_description base_env_name language  conda
    6  Sales_conda_env  Sales team environment.    python_3.9   Python   True
    >>>
    # Remove example environments.
    remove_env("Fraud_Detection")
    remove_env("Lie_Detection")
    remove_env("Lie_Detection_ML")
    remove_env("Sales_env")
    remove_env("Carbon_Credits")
    remove_env("Customer_Trends")
    remove_env("Sales_conda_env")