The basic usage of the Gerber Formatter is to utilize format and formats functions
available in pygerber.gerber.formatter module. Please have look at the following
example:
Please note that to format the code, we first had to parse it, and only then could the
abstract syntax tree be passed to the formatter. format function writes formatted code
directly to file-like object, while formats function returns formatted code as a
string.
The formatter can be configured using Options object. The object can be passed to
format and formats functions as a optional options argument. You can find full
option reference here.