3.2. grbl Support Library

The grbl support library provides host-side Python scripting which communicates over a serial port with an Arduino running the grbl firmware for Arduino CNC motion.

exception grbl.parser.GCodeError(value)[source]
class grbl.parser.GrblBlock(line=None)[source]

Representation of a single line of G-code.


Return a list of all numeric values from words containing a G command code.


Returns true if the block has no meaningful content.


Return a list of all numeric values from words containing a M command code.

class grbl.parser.GrblParser(args)[source]

Representation of a g-code interpreter for parsing and checking g-code streams for the grbl G-code interpreter. This class tracks the expected internal state of the interpreter and can apply code transformations and regenerate clean output.


Interpret a property dictionary representing a single line of G-code and update the internal interpreter state to reflect the execution effects.


Parse an entire G-code file into a list of block property objects, one per meaningful block.