The structured analysis and transformation of Python source code is often complex and typically requires advanced programming knowledge.
Additionally, there is a lack of user-friendly tools that convert Python code into a standardized, machine-readable format such as XML, which is essential for structured querying and advanced analysis. Traditional tools often provide limited insight or are too complex for non-experts.
This project introduced a novel approach for converting Python source code into an XML format, using Python's Abstract Syntax Tree (AST) module as the foundation. A key outcome of the work was the development of an interface called PythonML, which enables Python code to be represented in a structured XML format — even for users without deep Python expertise.
For analyzing the XML structure, the tool FNQUERY was integrated. FNQUERY allows XPath-like queries to inspect the structure of the code. With this tool, advanced structural analyses such as:
were made possible. By combining PythonML and FNQUERY, the project delivered a powerful analysis tool that provides real value for developers and researchers in the areas of code quality, maintainability, and refactoring.