A modular C++23+ project for parsing, validating, visualizing, and exporting SVG (Scalable Vector Graphics) structures into CSV tables.
Includes CLI, Qt6, GTKmm4, and PySide6 graphical frontends — plus Python interoperability via shared library bindings.
Designed for clarity, modularity, and minimal dependencies.
| Module / Component | Description |
|---|---|
| svg_reader | Loads SVG files from disk. |
| string_utils | Cleans and tokenizes SVG text into structured tags. |
| tree_utils | Builds and manages a hierarchical tree representation of the SVG. |
| csv_exporter | Converts the tree into a CSV table for data analysis. |
| svg_handler | Orchestrates all modules into a single processing pipeline. |
| cli | Command-line interface for running the full pipeline or partial validation. |
| gui_qt6 | Qt6 desktop interface for SVG visualization and CSV export. |
| gui_gtkmm4 | GTKmm4 GUI with hierarchical view and export support. |
| gui_pyside6 | Python-based GUI using PySide6 (Qt for Python). |
| python bindings | Shared C++ library for use via ctypes or future pybind11. |
-
C++ Standard: C++23 or newer
-
CMake: Version 3.25 or higher
-
Compiler: GCC 15 or Clang 18+
-
Optional GUI Frameworks:
sudo apt install qt6-base-dev libgtkmm-4.0-dev python3-pyside6# Clone repository
git clone <repository_url>
cd SVG_Handler
# Configure and build
cmake -B build
cmake --build build./build/cli/svg_handler_cli resources/sample.svg output/sample.csv./build/cli/svg_handler_cli --validate resources/sample.svg./build/cli/svg_handler_cli --view resources/sample.svgcmake --build build --target run_gtkmmor run manually:
./build/gui_gtk/svg_handler_gtkcmake --build build --target run_qtguior run manually:
./build/gui_qt/svg_handler_qtAutomatically packaged with shared library and resources:
cmake --build build --target run_pyside6This creates:
gui_pyside6/
├── cli_py3/svg_handler.py
├── gui_pyside6/main.py
├── gui_pyside6/mainwindow.py
├── lib/libsvg_handler_py.so
└── resources/sample.svg
The shared library libsvg_handler_py.so provides direct access to C++ functions through Python’s ctypes.
You can use the adapter script:
python3 python/cli_py3/svg_handler.py --exampleOr integrate it into your own Python GUI or web application.
Run the unified test suite:
./build/tests/svg_handler_cli_test test=0Or run individual module tests:
./build/tests/test_run_tree_utilsproject/
├── include/
│ ├── svg_core.hpp
│ ├── svg_reader.hpp
│ ├── string_utils.hpp
│ ├── tree_utils.hpp
│ ├── csv_exporter.hpp
│ └── svg_handler.hpp
├── src/
│ ├── svg_reader.cpp
│ ├── string_utils.cpp
│ ├── tree_utils.cpp
│ ├── csv_exporter.cpp
│ └── svg_handler.cpp
├── cli/
│ └── main.cpp
├── gui_qt6/
│ ├── main.cpp
│ ├── mainwindow.cpp
│ ├── mainwindow.h
│ └── mainwindow.ui
├── gui_gtkmm4/
│ ├── main.cpp
│ ├── mainwindow.cpp
│ └── mainwindow.hpp
├── python/
│ ├── cli_py3/
│ │ └── svg_handler.py
│ └── gui_pyside6/
│ ├── main.py
│ └── mainwindow.py
├── lib/
│ ├── libsvg_handler.so
│ └── libsvg_handler_py.so
├── resources/
│ └── sample.svg
└── tests/
└── test.cpp
This project is distributed for educational and research purposes under the MIT License.
