Skip to main content

A library to write Gerber files

Project description

Purpose

A Python library for writing Gerber files.

  • No need to read the 200 page Gerber format specification.

  • API much simpler than the Gerber format specification - 8 pages vs 200.

  • All common pad shapes built-in.

  • User-defined pad special shapes

  • 100% compliance with the specification, rev 2022.02.

  • Conservative, robust output files.

  • Risky constructs that fail in some buggy implementations are not used.

  • Include standardized meta information needed for fabrication, such as which pads are vias.

  • Verify whether the input parameters comply with the Gerber spec.

  • Stateless input (the gerber_writer takes care of the Gerber states).

Example:

from gerber_writer import DataLayer, Circle, RoundedRectangle

trace_width = 0.127
via_pad = Circle(0.508, 'ViaPad')
IC17_toe = RoundedRectangle(1.257, 2.286, 0.254, 'SMDPad,CuDef')
toe_point = (0, 2.54)
via_point = (5.08, 0)

top = DataLayer('Copper,L1,Top,Signal')

top.add_pad(IC17_toe, toe_point, angle=45)
top.add_trace_line(toe_point, (2.54, 0), trace_width, 'Conductor')
top.add_trace_line((2.54, 0), via_point, trace_width, 'Conductor')
top.add_pad(via_pad, via_point)

with open('gerbers\gerber_writer_example_small.gbr', 'w') as outfile:
    top.dump_gerber(outfile
https://github.com/Karel-Tavernier/gerber_writer/blob/main/docs/_images/example_small.png?raw=true

Installation

$ py -m pip install gerber_writer

Requirements

  • Python 3.10 or higher

  • Standard library only.

  • OS independent.

License

Apache 2.0 license

Contact

karel_tavernier@hotmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gerber_writer-0.4.1.2.tar.gz (24.5 kB view hashes)

Uploaded Source

Built Distribution

gerber_writer-0.4.1.2-py3-none-any.whl (25.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page