EuroSciPy logo

EuroSciPy 2013

Brussels, Belgium - August 21-24 2013

Proposing an efficient report generation procedure based on Python modules and Latex

Mehmet Kunt


In many disciplines, including engineering, frequent document production may be performed in an inefficient manner. If documents are produced in a routine manner, the process may benefit from automation of the content creation. While several tools are available for allowing people to generate reports, most of them are being developed with a specific purpose. Thus, extending those tools' abilities may be difficult. Python language, with vast repository of modules may provide the best environment for overcoming the limitations of these tools. The aim of this research is to use Python language to develop a framework to generate reports in a flexible manner that will allow the use of both historical and Python-generated real-time information. For this research, recent efforts in using Python for similar purposes were carefully evaluated to develop a framework that results in an improvement. The idea is to use a script to guide Python interpreter for carefully blending reference information, algorithm I/O such as figures, tables, modeling of data and statistical analysis to obtain reports that are informative and easier to read. This approach provides a scalable reference information database by utilizing sqlite3, numerical data processing with Numpy and Scipy, generating plots with matplotlib and pylab, modeling and analysis of data with Scipy and sklearn and performing network analysis with Networkx modules. The framework relies on properly organized data files, built-in and user-defined functions and developed algorithm to glue all of these components. The algorithm outputs in tex format for final processing in LaTeX environment. The latex commands which include equation, table and figure numbering are being generated in the Python algorithm. Finally, the implementation and benefits of this approach will be presented through the application of the framework in Transportation Engineering field. This framework can be easily implemented in other disciplines with similar needs.