Skip to content

Introduction

Overview

This is a beginning of quick start guide for PyGerber. It uses a dedicated API which exposes limited set of functionalities of PyGerber in very convenient way. It should suite your needs if you are only looking for a quick way to render or format Gerber file(s) with basic customization.

If you need to do something more complicated, you should check out Advanced Guide to understand how PyGerber works and what can be achieved with its more complicated interfaces.

pygerber.gerber.api module

PyGerber exposes a simple API for accessing limited subset of its functionalities in form of pygerber.gerber.api module. This interface is especially useful for one time use, scripting and use from interactive shell. Most of the functionality has been included in the GerberFile class and Project class. Additionally, there is a FileTypeEnum containing recognized file types and some less important utility objects.

__all__ = ['CompositeImage',
 'CompositePillowImage',
 'CompositeView',
 'DEFAULT_ALPHA_COLOR_MAP',
 'DEFAULT_COLOR_MAP',
 'DesignRules',
 'FilesAttributes',
 'FileTypeEnum',
 'GeneralSpecs',
 'GenerationSoftware',
 'GerberFile',
 'GerberJobFile',
 'Header',
 'Image',
 'ImageSpace',
 'MaterialStackup',
 'PathToGerberJobProjectNotDefinedError',
 'PillowImage',
 'ProjectId',
 'ShapelyImage',
 'Size',
 'Style',
 'Color',
 'Units',
 'Options']

For guide on how to use GerberFile class, check out Single file guide.

For guide on how to use Project class, check out Multi file project guide.

Most of code examples (those with file name at the top of code frame) can be directly copied and pasted into Python file, interactive shell or Jupyter notebook and executed.