{"id":15009930,"url":"https://github.com/argmaster/pygerber","last_synced_at":"2025-10-08T18:15:17.065Z","repository":{"id":46777765,"uuid":"396023891","full_name":"Argmaster/pygerber","owner":"Argmaster","description":"Python implementation of Gerber X3/X2 standard with 2D rendering engine.","archived":false,"fork":false,"pushed_at":"2024-04-12T21:47:34.000Z","size":47601,"stargazers_count":29,"open_issues_count":24,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-13T17:21:55.037Z","etag":null,"topics":["2d","3d-models","gerber","gerber-files","gerber-renderer","gerber-x2","gerber-x3","gerbers","pcb","pillow","python","python-3","python-library","python3"],"latest_commit_sha":null,"homepage":"https://argmaster.github.io/pygerber/latest","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Argmaster.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-08-14T13:53:54.000Z","updated_at":"2024-04-16T23:37:10.042Z","dependencies_parsed_at":"2023-10-16T13:58:34.160Z","dependency_job_id":"1aa6e36f-a69d-4c01-ab3f-24aa514ef672","html_url":"https://github.com/Argmaster/pygerber","commit_stats":{"total_commits":154,"total_committers":1,"mean_commits":154.0,"dds":0.0,"last_synced_commit":"4761a5aa60ff1d11512fb44aabd103246d9a3019"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Argmaster%2Fpygerber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Argmaster%2Fpygerber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Argmaster%2Fpygerber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Argmaster%2Fpygerber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Argmaster","download_url":"https://codeload.github.com/Argmaster/pygerber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230852614,"owners_count":18290082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d","3d-models","gerber","gerber-files","gerber-renderer","gerber-x2","gerber-x3","gerbers","pcb","pillow","python","python-3","python-library","python3"],"created_at":"2024-09-24T19:29:10.390Z","updated_at":"2025-10-08T18:15:12.046Z","avatar_url":"https://github.com/Argmaster.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n   \u003cimg width=\"400\" src=\"https://github.com/Argmaster/pygerber/assets/56170852/b7aeb3e1-cd59-4f5b-b078-c01272461367\" alt=\"\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e PyGerber \u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Argmaster/pygerber/releases/\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/Argmaster/pygerber?style=flat\" alt=\"GitHub release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Argmaster/pygerber/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release-date/Argmaster/pygerber\" alt=\"GitHub Release Date - Published_At\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/pygerber\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/pygerber?style=flat\" alt=\"PyPI release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/pygerber/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/dm/pygerber.svg?label=PyPI%20downloads\" alt=\"PyPI Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/pygerber\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/pygerber?style=flat\" alt=\"Supported Python versions\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/pygerber\"\u003e\u003cimg src=\"https://img.shields.io/pypi/implementation/pygerber?style=flat\" alt=\"Supported Python implementations\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/argmaster/pygerber/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/Argmaster/pygerber\" alt=\"license_mit\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/Argmaster/pygerber\"\u003e\u003cimg src=\"https://codecov.io/gh/Argmaster/pygerber/branch/main/graph/badge.svg?token=VM09IHO13U\" alt=\"coverage\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://img.shields.io/github/checks-status/Argmaster/pygerber/main\"\u003e\u003cimg src=\"https://img.shields.io/github/checks-status/Argmaster/pygerber/main\" alt=\"GitHub tag checks state\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Argmaster/pygerber/pulls\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr/Argmaster/pygerber?style=flat\" alt=\"Pull requests\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Argmaster/pygerber/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-raw/Argmaster/pygerber?style=flat\" alt=\"Open issues\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Argmaster/pygerber\"\u003e\u003cimg src=\"https://img.shields.io/github/repo-size/Argmaster/pygerber\" alt=\"GitHub repo size\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Argmaster/pygerber\"\u003e\u003cimg src=\"https://img.shields.io/github/languages/code-size/Argmaster/pygerber\" alt=\"GitHub code size in bytes\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Argmaster/pygerber\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/Argmaster/pygerber\" alt=\"GitHub Repo stars\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://python-poetry.org/\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json\" alt=\"Poetry\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-black-000000.svg\" alt=\"Code Style\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## 📖 Overview\n\nPyGerber is a collection of tools aimed at simplifying the use of the Gerber X3 format.\nIt is based on Ucamco's `The Gerber Layer Format Specification. Revision 2024.05`\n(Available on\n[Ucamco's webpage](https://www.ucamco.com/files/downloads/file_en/456/gerber-layer-format-specification-revision-2024-05_en.pdf).\n\nPyGerber can be used both as a executable (with command line interface) and as a Python\nlibrary.\n\nPyGerber supports modern features available in the latest version of the standard\n(2024.05). At the same time, it includes the implementation of many of outdated and\nremoved functionalities for backwards compatibility. This allows it to be used not only\nwith files compliant with the X3 standard but also with those compliant with X2,\nRS-274X, and RS-274D. Due to limited access to files in older standards and ambiguities\nwithin them, there is a risk that some older functionalities may behave incorrectly.\n\nIf you have found a bug in the PyGerber library, please file a bug report with use of\none of issue templates available on\n[Create new issue](https://github.com/Argmaster/pygerber/issues/new/choose) page in\nPyGerber repository. We will be glad to examine your report and possibly fix the\nproblem.\n\nIf you have any questions or suggestions, please open a new discussion thread in the\n[Discussions](https://github.com/Argmaster/pygerber/discussions) section of our\nrepository. We will be happy to help you and discuss your ideas.\n\n### 📦 Installation\n\nPyGerber can be installed with `pip` from PyPI:\n\n```\npip install pygerber\n```\n\nThis way only the core of PyGerber features will be installed. It will not include\nlanguage server, SVG rendering support and other optional features. If you want to\ninstall all available features, include `all` extras set in installation request, like\nthis:\n\n```\npip install pygerber[all]\n```\n\nTo install latest development version of PyGerber, you can use URL of the Github\nrepository with `git+` prefix:\n\n```\npip install git+https://github.com/Argmaster/pygerber\n```\n\n## 📚 Documentation\n\nPyGerber has a online documentation hosted on Github Pages. It will be a great starting\npoint for your journey with PyGerber.\n[You can it here](https://argmaster.github.io/pygerber/stable). If you are looking for\ndocumentation of older version of PyGerber, please use version selector dropdown\navailable next to the title in top bar menu.\n\n### 📜 License\n\nPyGerber is licensed under MIT license. You can find full text of the license in the\n[LICENSE](https://github.com/Argmaster/pygerber/blob/main/LICENSE.md) file in the root\ndirectory of the repository.\n\nSome of the testing assets may be licensed under different licenses. License files for\nthose assets are available alongside those files.\n\nSome of the example files shipped with PyGerber may be licensed under different\nlicenses. In particular, files from KiCad demo projects are licensed under\n`CC BY-SA 4.0` license. Copy of the license file is provided alongside those files.\n\n## 🛠 Tools\n\nCollection of tools available in PyGerber constantly grows. Some of the tools can be\naccessed only with API, others provide command line interface too. Below you can find\nlist of all currently available ones:\n\n- Image renderer (PNG/JPEG) `[API]` `[CLI]`\n- Code formatter `[API]` `[CLI]`\n- Code generation `[API]`\n- Language server (requires `language_server` extras)\n  ([Visual Studio Code extension available](https://marketplace.visualstudio.com/items?itemName=argmaster.gerber-x3-x2-format-support))\n  `[CLI]`\n- Pygments Gerber syntax lexer plugin (requires `pygments` extras) `[CLI]`\n\n### 🖮 PyGerber APIs\n\nPyGerber provides APIs for accessing most of its functionalities. There are selected\nmodules designed to be used as libraries, they reexport public parts of implementation\nin a convenient way. Avoid importing stuff from modules not listed below and not\nmentioned in documentation, as this may inflict suffering and damnation upon you 💀\n(Just joking, but they may get deleted/moved at any time, so you know 😼).\n\nBelow you can find list of available APIs:\n\n- `pygerber.gerber.api`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=bug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_generic_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.gerber.ast`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=bug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_generic_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.gerber.ast.nodes`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=bug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_generic_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.gerber.compiler`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=bug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_generic_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.gerber.parser`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=bug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_generic_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.gerber.formatter`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=gerber-formatter%2Cbug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=gerber_formatter_bug.md\u0026title=%5BGerber+Formatter%5D%3A+%3Cincorrect-formatting-of-such-and-such-structure%3E))\n- `pygerber.builder.gerber`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=gerber-builder%2Cbug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=builder_gerber.md\u0026title=%5BGerber+Builder%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.builder.rvmc`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=gerber-formatter%2Cbug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=gerber_formatter_bug.md\u0026title=%5BGerber+Formatter%5D%3A+%3Cincorrect-formatting-of-such-and-such-structure%3E))\n- `pygerber.vm`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=virtual-machine%2Cbug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_vm_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.vm.commands`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=virtual-machine%2Cbug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_vm_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.vm.types`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=virtual-machine%2Cbug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_vm_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.vm.pillow`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=virtual-machine%2Cbug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_vm_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n- `pygerber.vm.shapely`\n  ([open issue](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=virtual-machine%2Cbug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_vm_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E))\n\nIf you need a symbol that is not reexported from those modules, eg. some exception class\nyou need to catch, please open an issue with corresponding `open issue` link so we can\nevaluate that issue and possibly add missing reexport. Don't worry about template being\nfor bugs, we will figure that out in the process, just fill the fields in template\naccording to guidelines contained in it.\n\nIf you have found a bug in a particular part of PyGerber, please use `open issue` link\nnext to module name above to open issue submission form. Alternatively you can choose\none of the issue templates on\n[Create new issue](https://github.com/Argmaster/pygerber/issues/new/choose) page in\nPyGerber repository. Please fill the template according to guidelines contained in it to\nsimplify process of reproducing the issue for maintainers. If there is no dedicated\ntemplate, use\n[PyGerber Bug Report](https://github.com/Argmaster/pygerber/issues/new?assignees=Argmaster\u0026labels=bug%2Cwaiting-for-checkboxes\u0026projects=\u0026template=pygerber_generic_bug.md\u0026title=%5BPyGerber%5D%3A+%3Cwhen-i-am-doing-something-then-something-fails%3E)\ntemplate.\n\n### 💻 PyGerber CLI\n\nPyGerber provides non-interactive command line interface which provides means to access\nsome of its features. `pygerber` command is available after installation and can be used\nto access tools with use of subcommands.\n\nTo check version of PyGerber available in your environment, you can use:\n\n```bash\npygerber --version\n```\n\nTo convert Gerber file to PNG image you can use `pygerber gerber convert png` command.\nAssuming that your Gerber file is named `source.gbr` representing a copper layer and you\nwant to convert it to PNG image with DPMM of 600, command would look like this:\n\n```bash\npygerber gerber convert png source.gbr -o output.png -d 600 -s copper_alpha\n```\n\nThis will create `output.png` file in current working directory. Depending on your image\nsize you may need to adjust `-d` (`--dpmm`) parameter to increase or decrease the\nresolution of image.\n\nHere is an example result of converting a Gerber file to PNG image:\n\n![output](https://github.com/user-attachments/assets/0dfc4682-a284-4cb0-8a74-81136e213766)\n\nThere are more export target formats available, like JPEG, TIFF or SVG to name some of\nthem. Use `--help` flag to get list of available conversion commands:\n\n```bash\npygerber gerber convert --help\n```\n\nFor more detailed command line interface documentation please visit `Gerber` -\u003e\n`Command Line` section in [documentation](https://argmaster.github.io/pygerber/stable/).\n\n## § Language Server\n\nPyGerber provides Gerber X3/X2 Language Server conforming to\n[Language Servere Protocol](https://microsoft.github.io/language-server-protocol/)\ndefined by Microsoft. It can be enabled by installing PyGerber extras set\n`language-server` with following command:\n\n```\npip install pygerber[language-server]\n```\n\nAfterwards you can use following command to check if PyGerber correctly recognized that\nlanguage server feature should be enabled:\n\n```\npygerber is-language-server-available\n```\n\nIf you have encountered a problem with language server please report it in the\n[Issues](https://github.com/Argmaster/pygerber/issues/new/choose) section of Github\nrepository of this project.\n\nIf you have a suggestion for improvement, please open a new discussion thread in the\n[Discussions](https://github.com/Agrmaster/pygerber/discussions) section of our\nrepository.\n\nTo fully utilize power of this language server you can use Visual Studio Code extension\n[Gerber X3/X2 Format Support](https://marketplace.visualstudio.com/items?itemName=argmaster.gerber-x3-x2-format-support)\n(`argmaster.gerber-x3-x2-format-support`). Repository of this extension is available\n[here](https://github.com/Argmaster/vscode-gerber-format-support). If you encounter any\nproblems with that extension, please report them in the\n[Issues](https://github.com/Argmaster/vscode-gerber-format-support/issues/new) section\nof its repository. If you are not sure whether the problem is caused by extension or by\nlanguage server, please report it in the\n[Issues](https://github.com/Argmaster/vscode-gerber-format-support/issues/new) section\nof the extension, we will move it to PyGerber repository if necessary.\n\n## Development\n\nFor development guidelines please visit documentation `Development` section\n[here](https://argmaster.github.io/pygerber/stable).\n\n## Acknowledgments\n\nI would like to thank Professor Janusz Młodzianowski from the University of Gdańsk, who\ninspired me with the idea to implement the Gerber format at the beginning of my\nbachelor's degree. I would like to also express my gratitude to Karel Tavernier, the\nlong-time steward of the Gerber format, for his support and expert guidance during my\nwork on this project. Without them, this project would have never come to life. Finally,\nI would like to thank all the people who have contributed, are contributing and will\ncontribute to PyGerber. Your help is invaluable and I am grateful for it.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargmaster%2Fpygerber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fargmaster%2Fpygerber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargmaster%2Fpygerber/lists"}