Is there a Python client library for interacting with Minerva?

Options

I would like to automate some tasks in Minerva using Python scripting. Is this possible?

Tagged:

Best Answer

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 218
    First Answer First Comment 5 Likes First Anniversary
    Answer ✓
    Options

    Once you install the Minerva Transfer Client on your machine (in Minerva click on your initials in the upper-right corner > Tools > Application Launcher), you will have access to the Minerva SDK, which can be accessed in Python as follows:

    MinervaPath = r'C:\Program Files\Ansys Inc\Application Launcher\TransferClient'
    import sys
    import clr
    if not MinervaPath in sys.path:
        sys.path.append(MinervaPath)
    clr.AddReference("Ansys.Minerva.Sdk")
    import Ansys.Minerva.Sdk as minerva 
    

    Here is sample code to connect to instance of Minerva:

    connection = minerva.HttpConnection("https://cdcwisdom1.win.ansys.com/AnsysMinerva")
    connection.LoginAsync(minerva.BrowserLogin())
    

Answers

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 218
    First Answer First Comment 5 Likes First Anniversary
    Options

    How to connect with username and password:

    try: creds = minerva.ExplicitCredentials("db_name","login_name",minerva.SecureToken("password")[0]) #IPython?
    except: creds = minerva.ExplicitCredentials("db_name","login_name",minerva.SecureToken("password")) #CPython?
    connection.Login(creds)