Python Code Analysis in XML Using FNQUERY

Home / Project

Image Image Image

Python Code Analysis in XML Using FNQUERY

The structured analysis and transformation of Python source code is often complex and typically requires advanced programming knowledge.

  • Problem: Developers and researchers face challenges when trying to examine existing Python projects for structural issues, inheritance hierarchies, or recursive methods — especially in the context of refactoring, code reviews, or automated code transformation.

    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.

  • Solution:

    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:

    • identifying inheritance hierarchies
    • examining class relationships
    • detecting recursive methods

    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.

Visit Website

Let's do more together

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Get In Touch!