Overview of Python Scripting Support¶

While Model Query Language (MQL) provides an easy and convenient approach for structured model querying and manipulation, scripting is the ultimate solution to extend the Tool to meet your customization requirements. This feature enables users to inject custom process or plug –in custom functions for sophisticated model manipulation in the Tool environment. More specifically, users can
- Script a custom process to create or manipulate models, such as, creating a model from various sources, performing network reduction, or merging external network models, etc. The process, however, must be executed in the Tool environment.
- Extend the existing Tool functionalities by plugging-in the script-based functions, for example, for validation, reporting, or transformation, etc.
- Build standalone scripting application outside of the Tool environment by taking full advantage of the services/functionalities of the Tool. The standalone scripting support is released under an evaluation license.
There are many scripting languages available. Python was selected because of the following:
- Python is a high-level English-like scripting language that requires very gentle leaning curves. Many users have developed Python skills.
- Python is powerful, supporting almost all of the programming models, ranging from object-oriented programming to declarative functional programming.
- Python is interoperable with C++ (the programming language used for the server application). There are strong 3rd-party supports.
To support user-driven scripting, a selected set of model query and manipulation APIs are wrapped and exposed in Python. To help users get started, a rich set of sample scripts are provided. These sample scripts and the detailed explanations in the related documentation show users how to build script-based applications, assuming users have little experience with Python programming. These scripts can be found under folder \CIMSpy\scripting. The documents in this section will use these samples as examples to tutor users how to build script-based applications.
Before working on any details of scripting, users must setup their Python environments and understand the fundamental of scripting support.