'Static dataflow graph generator for Python?

I've been struggling for quite some time to find a static dataflow graph generator for Python.

This is my ideal: Given a small python script example.py, (written in Python3), return some representation of the data flow graph.

I was able to achieve this result using IBM's pyflowgraph, https://github.com/IBM/pyflowgraph which outputs data in graph.ml format, unfortunately this package only performs dynamic analysis.

I'm wondering if anyone knows of a DFG tool that could do this type of static dataflow analysis for Python?



Solution 1:[1]

I just found this open source project focused on dataflow analysis for Python. Check it out! https://github.com/SMAT-Lab/Scalpel/

It's made in Python too; haven't used it, but looks very interesting!

This is the pre-print of their paper: https://arxiv.org/pdf/2202.11840.pdf

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1