{"id":182001,"date":"2024-04-01T13:20:08","date_gmt":"2024-04-01T13:20:08","guid":{"rendered":"\/knowledge\/forums\/topic\/ansys-scade-api-tools-simplifies-python-api-access\/"},"modified":"2025-02-26T17:07:20","modified_gmt":"2025-02-26T17:07:20","slug":"ansys-scade-api-tools-simplifies-python-api-access","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/ansys-scade-api-tools-simplifies-python-api-access\/","title":{"rendered":"Ansys SCADE API Tools simplifies Python API access"},"content":{"rendered":"<p>In this article, we&#8217;ll take a look at <strong>Ansys SCADE API Tools<\/strong> (<a href=\"https:\/\/apitools.scade.docs.pyansys.com\/version\/stable\/index.html\">documentation link<\/a>), designed to simplify usage of the SCADE Python APIs.<\/p>\n<h3  id=\"THE-VANILLA-SCADE-PYTHON-API\">The vanilla SCADE Python API<\/h3>\n<p>Most Ansys products come packaged with Python APIs (as part of the <a href=\"https:\/\/developer.ansys.com\/pyansys\">PyAnsys<\/a> initiative). These open-source libraries allow engineers to interact programmatically with Ansys products, integrating them into their workflows.<\/p>\n<p>Ansys SCADE is no exception. Its Python API allows users to:<\/p>\n<ul>\n<li>Walk through SCADE models and modify them using code<\/li>\n<li>Access generated artefacts (mapping files, test results, model coverage&#8230;)<\/li>\n<\/ul>\n<p>If you&#8217;re interested in using the SCADE Python API, we&#8217;ve already written an article on <a href=\"\/knowledge\/forums\/topic\/using-the-scade-python-apis-from-your-favorite-ide\/\">getting started<\/a> with your favorite IDE.<\/p>\n<h3  id=\"INTRODUCING-ANSYS-SCADE-APITOOLS\">Introducing <code>ansys-scade-apitools<\/code><\/h3>\n<p>We are pleased to announce the release of <code>ansys-scade-apitools<\/code>, a Python package that extends the standard SCADE Python API.<\/p>\n<p>Its goal is to make the SCADE API easier to use by adding a collection of high-level functions that accomplish complex operations without exposing low-level concepts to the user.<\/p>\n<p>Key benefits are:<\/p>\n<ul>\n<li>Simplified configuration to run Python code from your preferred IDE.<\/li>\n<li>High-level, Pythonic APIs allow creating models, automatically handling intermediate elements and their consistency.<\/li>\n<\/ul>\n<p>The package is structured into five modules:<\/p>\n<ul>\n<li><code>create<\/code>: collection of functions for creating or updating SCADE models. This includes creating types, operators, interfaces and other constructs.<\/li>\n<li><code>expr<\/code>: collection of functions for accessing expressions. This covers walking through a model&#8217;s operators and expressions.<\/li>\n<li><code>info<\/code>: provides information on the current version of SCADE.<\/li>\n<li><code>prop<\/code>: collection of functions for the storage of settings and properties.<\/li>\n<li><code>query<\/code>: collection of queries about SCADE Suite types.<\/li>\n<\/ul>\n<h4  id=\"SOME-EXAMPLES\">Some examples<\/h4>\n<p>The images below illustrate a couple of the numerous functions exposed by API Tools.<\/p>\n<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/04\/scade-010-expr-example.png\" style=\"max-height: 500px !important\" \/><br \/>\n    <em>Example: accessing an If expression with a Python script (<\/em><a href=\"https:\/\/apitools.scade.docs.pyansys.com\/version\/stable\/_examples\/expr_access.html\">link<\/a><em>)<\/em>\n<\/p>\n<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/04\/scade-010-info-example.png\" style=\"max-height: 500px !important\" \/><br \/>\n    <em>Example: printing SCADE version properties with a Python script (<\/em><a href=\"https:\/\/apitools.scade.docs.pyansys.com\/version\/stable\/_examples\/info.html\">link<\/a><em>)<\/em>\n<\/p>\n<p>The library has many more functions than illustrated in this short article. You may find them described in the <a href=\"https:\/\/apitools.scade.docs.pyansys.com\/version\/stable\/examples\/create.html\">Examples section<\/a> of our online docs.<\/p>\n<h3  id=\"READY-TO-TRY-IT-OUT\">Ready to try it out?<\/h3>\n<p>If you&#8217;re interested in using Ansys SCADE API Tools, our <a href=\"https:\/\/apitools.scade.docs.pyansys.com\/version\/stable\/index.html\">online docs<\/a> are a great starting point. The package is published on PyPI (Python Package Index) as <a href=\"https:\/\/pypi.org\/project\/ansys-scade-apitools\/\">ansys-scade-apitools<\/a>.<\/p>\n<p>If you wish to look under the hood and\/or contribute, sources are available on the dedicated Ansys GitHub <a href=\"https:\/\/github.com\/ansys\/scade-apitools\">repository<\/a>.<\/p>\n<h3  id=\"ABOUT-THE-AUTHOR\">About the author<\/h3>\n<table style=\"border: none !important\">\n<tr>\n<td style=\"border: none !important\">\n<p style=\"text-align: center\">\n    <img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/knowledge\/wp-content\/uploads\/sites\/4\/2024\/09\/scade-francois-couadau.png\" style=\"max-height: 200px !important\" \/>\n        <\/td>\n<td style=\"border: none !important\">\n<p><strong>Fran\u00e7ois Couadau<\/strong> (<a href=\"https:\/\/www.linkedin.com\/in\/fcouadau\/\">LinkedIn<\/a>) is a Senior Product Manager at Ansys. He works on embedded HMI software aspects in the SCADE and Scade One products. His past experience includes distributed systems and telecommunications.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n","protected":false},"template":"","class_list":["post-182001","topic","type-topic","status-publish","hentry","topic-tag-api","topic-tag-github","topic-tag-pypi","topic-tag-python","topic-tag-scade"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_btv_view_count":["1356"],"_bbp_likes_count":["11"],"_bbp_engagement":[""],"_bbp_reply_count":[""],"_bbp_reply_count_hidden":[""],"_bbp_last_active_time":["3\/12\/2024 20:20"],"_bbp_last_active_id":[""],"_bbp_last_reply_id":[""],"_bbp_author_ip":[""],"_bbp_topic_id":["196303"],"_bbp_forum_id":["27825"],"_bbp_voice_count":[""],"_wp_desired_post_slug":[""],"_edit_lock":["1740589737:1769"],"_edit_last":["1769"],"filter_by_optics_product":["Lumerical"],"_filter_by_optics_product":["field_64fb192ba3121"],"application_name":[""],"_application_name":["field_64a80903c8e15"],"family":[""],"_family":["field_64a809229a857"],"siebel_km_number":[""],"_siebel_km_number":["field_63ecbffce60db"],"salesforce_km_number":[""],"_salesforce_km_number":["field_63ecc018e60dc"],"km_published_date":[""],"_km_published_date":["field_64c77704499dd"],"product_version":[""],"_product_version":["field_64c776cb4fd2e"],"_yoast_wpseo_content_score":["60"],"_yoast_wpseo_estimated-reading-time-minutes":["2"],"_yoast_wpseo_wordproof_timestamp":[""],"_aioseo_title":[null],"_aioseo_description":[null],"_aioseo_keywords":["a:0:{}"],"_aioseo_og_title":[null],"_aioseo_og_description":[null],"_aioseo_og_article_section":[""],"_aioseo_og_article_tags":["a:0:{}"],"_aioseo_twitter_title":[null],"_aioseo_twitter_description":[null]},"test":"solution"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/182001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":6,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/182001\/revisions"}],"predecessor-version":[{"id":196303,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/182001\/revisions\/196303"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=182001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}