Dragonfly Analyzer is a tool that automatically compiles and generates statistical reports based on field observations of dragonflies.
It is intended to support biologists and ecologists who work with indicator species — species whose populations are particularly sensitive to environmental changes.
The program processes Excel files (sample data file) containing species data and generates a summary report.
📊 The summary report includes:
- Total number of individuals
- Count per year
- Count per grid square
- Yearly population trends
- Average temperature, cloud cover, and wind speed:
- by year
- by grid square
- yearly trends
- Predominant observed water conditions
- Water condition trends
- Predominant observed shading level
- Shading trends
The program automates routine calculations and report structure creation, allowing specialists to focus on data interpretation and enabling the use of results in more advanced analysis stages such as TWINSPAN classification.
The report can be saved in three different formats: JSON, XML, or Excel, depending on the user's choice (example output).
The project was created as a solution to a real-world problem — helping a fellow researcher speed up data preparation for their bachelor’s thesis in biology.
pandas
— for working with data tables; used to load and process Excel data.openpyxl
— for reading/writing Excel files with formatting.Pillow
— used for image handling in the graphical interface.
pathlib
— for path and file structure handling.numbers
— for checking and validating numerical types.re
— for regular expressions (e.g., filename parsing).multiprocessing
— used to parallelize GUI updates and file operations.tkinter
— for the graphical user interface.dataclasses
— used for the@dataclass
decorator inNode
classes.os
— for file system interactions.typing
— for type annotations.time
— for measuring execution time.xml
— for exporting data inXML
format.json
— for serializing and input/output of data inJSON
format.
HashTable
— a custom data structure replicatingdict
behavior. Its size increases dynamically when the load reaches 70%, ensuring efficiency with large datasets.ProcessSafeQueue
— a custom structure that mimicsmultiprocessing.Queue
. Used for data exchange between the GUI process and the file-processing process. Internally uses aLinkedList
to ensureO(1)
complexity for dequeue operations. When 1000 spent elements accumulate and the queue holds no useful data, it is cleared. Also includes a custom exceptionEmptyProcessSafeQueueError
raised when attempting to get data from an empty queue.
While the following components aren't data structures, they are essential to the program's functionality. This is not a complete list, but highlights the main parts:
DragonflyAnalyzer
— the main class responsible for compiling data, calculating results, and generating the summary.Dragonfly
— represents a single dragonfly species and stores related statistics.ErrorCollector
— collects all errors that occur during execution, aiding in debugging.UICommandHandler
— handles GUI events, validates input data, and launches the file-processing subprocess.WidgetManager
— managestkinter
widgets, organizing layout and interface structure.Tooltip
— a custom tkinter widget that replicates the behavior of the HTMLtitle
attribute.StyleManager
— loads styles from aJSON
file and converts them into attk.Style
object.FileWriter
,JsonWriter
,XmlWriter
— classes responsible for outputting data toJSON
andXML
files.
- Install dependencies:
pip install -r requirements.txt
- Launch the program using the command line:
python app/main.py
- A graphical interface built with tkinter will open.
- The interface includes the following features:
- Select output file format (Excel, XML, JSON)
- Add Excel files
- Start analysis
- View logs for progress and errors
- After execution, the program processes the files and saves the results to the user-selected location on the computer.
-
Click on
windows_run.bat
-
The batch script will:
- Check if Python is installed and verify its version
- Check for required dependencies and install them if needed
-
If all checks succeed, the graphical interface will open automatically!
This project is licensed under the MIT License – see the LICENSE file for details.