Python Analyzer#

The Python Analyzer is a Perl script provided with the Lattix installation that allows you to import Python 2 source code into Lattix. The Python Analyzer’s input is the output of snakefood. Snakefood is an open-source dependency parser. You will first analyze your Python 2 source code with snakewood. Then you will take the snakewood output and input that into the Lattix Python Analyzer which will generate a LDI file that can be imported into Lattix using the Python module. Follow these steps to generate LDI:

Generate snakefood output file#

Use snakefood to generate a file that contains the dependency information between Python files. Typically, snakefood output files are of the form:

(('/myproject', 'pack2/'), ('/myproject', 'pack1/'))
(('/myproject', 'pack1/'), ('/myproject', 'pack1/'))
(('source_package_root', ''), ('None', 'None'))

Generate LDI file#

Run the perl script to generate the LDI file. The perl script is located in the tools/scripts/python-snakefood directory. Note that you must have perl installed in order to run the script.

perl snakefood-output-file > output.ldi.xml

The generated ldi file can then be loaded into Lattix.