MI Scripting Toolkit and PyAnsys
Last update: 16.07.2025New PyAnsys packages for Granta MI
The PyAnsys initiative at Ansys has driven a move towards a more modular, open-source approach to Python APIs. This is in contrast to the MI Scripting Toolkit, which is a monolithic, closed-source Python package with binary dependencies. PyAnsys packages are hosted directly on PyPI, streamlining the process of installing, upgrading, and issuing new releases. This modular approach in particular means only the packages and dependencies required for a particular use case are required, resulting in a cleaner and more manageable environment.
The PyAnsys packages currently available for Granta MI can be seen here.
Interoperability between PyAnsys packages and MI Scripting Toolkit
The Granta MI PyAnsys packages are designed both to embrace modern Python concepts and to be easily extensible and interoperable amongst each other. As a result, objects created in PyAnsys packages are not directly interoperable with MI Scripting Toolkit. Furthermore, since MI Scripting Toolkit is a closed-source, C++ based Python package, PyAnsys packages cannot interact directly with MI Scripting Toolkit objects. Instead, methods will be added to MI Scripting Toolkit to enable interoperability with PyAnsys packages as required. Example notebooks will also be provided to demonstrate the use of these methods.
There are currently two notebooks that demonstrate this interoperability:
More examples will be added as additional PyAnsys packages are released.
MI Scripting Toolkit third-party dependencies
An additional reason for formally separating the new PyAnsys packages from the existing MI Scripting Toolkit is based on the different backends used to communicate with Granta MI. The new PyAnsys packages are REST API clients and use a combination of autogenerated client code and the third-party requests package to communicate with the server. This is contrasted with MI Scripting Toolkit, which instead uses closed-source binaries. To avoid MI Scripting Toolkit depending on both the requests package and closed-source code, the PyAnsys packages packages are packaged and distributed separately.