From da72f3e77de73fdb0a87a406ba47e7650f9c87e9 Mon Sep 17 00:00:00 2001 From: Andrew Hofmann Date: Tue, 21 Apr 2026 14:09:26 -0700 Subject: [PATCH] docs: add Python API quick example to README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The README covers installation and links to docs but has no inline Python example. Add a minimal snippet showing how to load and render a Gerber file to PNG — the most common first use case. --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 4b7fa543..12fc8e40 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,31 @@ prefix: pip install git+https://github.com/Argmaster/pygerber ``` +## 🚀 Quick Example + +Render a Gerber file to PNG in a few lines: + +```python +from pygerber.gerber.api import GerberFile + +gerber = GerberFile.from_file("board-F_Cu.gbr") +image = gerber.render_with_pillow(dpmm=40) +image.save_png("front_copper.png") +``` + +Or try it immediately with a built-in example: + +```python +from pygerber.gerber.api import GerberFile +from pygerber.examples import ExamplesEnum, get_example_path + +gerber = GerberFile.from_file(get_example_path(ExamplesEnum.simple_2layer_F_Cu)) +gerber.render_with_pillow(dpmm=40).save_png("output.png") +``` + +For multi-file rendering, custom color maps, SVG output, and more, see the +[Quick Start guide](https://argmaster.github.io/pygerber/stable/40_gerber/20_quick_start/00_introduction/). + ## 📚 Documentation PyGerber has online documentation hosted on GitHub Pages. It's a great starting point