Python script to extract cura settings from cura gcode files

Hello,

while looking for problems in my gcode I found out that cura integrates slicing settings into the gcode.
I made a python script to extract these informations to make them better readable. It helps me to debug my prints.

It can be used to create cura profile files, too.

Example:

readConfigFromCuragcode.py -i ./SA350_New_Fine_(slynold)_2011041021_3DBenchy.gcode
#global_quality
[general]
version = 4
name = New Fine (slynold)
definition = custom

[metadata]
type = quality_changes
quality_type = normal
setting_version = 15

[values]
acceleration_enabled = False
adhesion_type = skirt
bridge_settings_enabled = True
layer_height = 0.08
layer_height_0 = 0.16
retraction_combing = noskin

#extruder_quality 0
[general]
version = 4
name = New Fine (slynold)
definition = custom

[metadata]
type = quality_changes
quality_type = normal
setting_version = 15
intent_category = default
position = 0

[values]
acceleration_print = 750
acceleration_travel = 1000
retraction_combing_max_distance = 0.1
skirt_line_count = 4
speed_print = 24
travel_avoid_supports = True
z_seam_type = back
z_seam_x = 0
z_seam_y = 0

Here’s the script. Maybe it helps.

readConfigFromCuragcode.py.zip (643 Bytes)

4 Likes

Hi, while running the script i get below error

readConfigFromCuragcode.py -i D:/test.gcode"
SyntaxError: invalid syntax