Convert PrusaSlicer ASCII .gcode into an Excel workbook (.xlsx) with per-move and per-layer metrics, computed legends, and Excel-native charts.
-
Moves (optional; see
--per-layer-only)- distance, estimated time, speed (mm/s)
- extrusion (mm of filament), volumetric flow (mm³/s)
- fan (%), hotend/bed/chamber setpoints
- feature type (from slicer comments like
;TYPE:...)
-
Layers
- layer Z and computed layer height
- total time, distance, extrusion per layer
- average speed, average volumetric flow, average fan per layer
- last-known hotend/bed/chamber setpoints per layer
-
Legend_Speed, Legend_Flow_mm3s, Legend_Fan_pct, Legend_Temp_C, Legend_Bed_C, Legend_LayerHeight_mm
- min/max, equal-width bins, and bin counts (useful for histograms)
-
Legend_FeatureType
- PrusaSlicer-style feature breakdown per feature type: time, percentage of total time, used filament (m) and estimated mass (g)
-
Top_Slowest_Layers
- top-N layers ranked by
time_s(also charted)
- top-N layers ranked by
The Dashboard (the first sheet) includes:
- Time per layer (line)
- Average speed per layer (line)
- Average volumetric flow per layer (line)
- Extrusion per layer (line)
- Average fan per layer (line)
- Temperature setpoints per layer (line: hotend/bed/chamber)
- Layer height per layer (column)
- Speed histogram (column, from
Legend_Speedbin counts) - Flow histogram (column, from
Legend_Flow_mm3sbin counts) - Top-N slowest layers (column)
- Feature type time-share (pie)
- Feature type table (top 10): time, percentage, used filament (m) and estimated mass (g)
- Feature type legend table (top feature types: Time / % / Used filament)
- The dashboard uses a two-column grid with extra horizontal separation to avoid chart overlap.
- X-axis labels on layer-based charts are automatically down-sampled (skip most labels) and rotated for readability.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtpython gcode_to_excel.py path/to/print.gcodeOutput:
path/to/print.xlsx
python gcode_to_excel.py print.gcode --bins 12 --filament-diameter 1.75 --top-n-slowest 25Flags:
--output out.xlsx: override output path--config config.ini: optional PrusaSlicer config.ini (key=value) to improve defaults and chart scaling--bins N: number of legend bins used for histograms--filament-diameter D: filament diameter (mm) used for volumetric flow--filament-density R: filament density (g/cm³) used for Used filament (g) estimates (default: 1.24)--no-legends: skipLegend_*sheets (histogram charts will be skipped)--per-layer-only: skip per-move rows for smaller files--top-n-slowest N: how many slowest layers to list and chart--layout compact|wide: dashboard layout (compact packs charts tighter; wide uses larger charts/spacing)
You can pass a PrusaSlicer-exported config.ini to make the workbook more comparable to what you see in PrusaSlicer:
- Uses
filament_diameter/filament_densityas defaults (unless you override via CLI) - Uses
filament_max_volumetric_speedandmax_print_speedto:- set nicer chart Y-axis ranges
- add constant reference-line series on the Speed and Flow charts
- set histogram / legend ranges to match your configured limits
- Uses
min_layer_height/max_layer_heightto scale the Layer Height chart and bins - Adds conditional formatting in the
Layerssheet to highlight:- average flow above
filament_max_volumetric_speed - average speed above
max_print_speed - layer heights outside
min_layer_height/max_layer_height
- average flow above
Example:
python gcode_to_excel.py print.gcode --config config.iniThis tool expects ASCII .gcode. If you have Prusa binary .bgcode, convert it first in PrusaSlicer:
- File → Convert →
.bgcode→.gcode
Then run the script on the resulting .gcode.
- Move timing is estimated from feedrate and distance (acceleration is not modeled).
- Feature types rely on slicer comments like
;TYPE:....
MIT