Make Amazing GDS Files with Few Lines of Python
PyGDSdesign is a powerful Python library for generating GDS (Graphic Database System) files through intuitive Python scripts. Built on the foundation of GDSpy, a widely-used open-source toolkit for layout design, PyGDSdesign leverages the Clipper library to execute precise boolean operations, making it an essential tool for researchers and engineers working in microelectronics, quantum computing, and nanofabrication.
- Simple Python API: Create complex GDS layouts with minimal code
- Built on GDSpy: Inherits robust layout design and manipulation capabilities
- Precise Boolean Operations: Powered by Clipper library for accurate geometric operations
- Specialized for Microwave Circuits: Optimized for designing spiral resonators, CPW resonators, and other RF components
- Active Development: Regular updates and improvements
First, ensure you have the required dependencies:
conda install numpy scipy tqdmThen install PyGDSdesign:
pip install pygdsdesignSince PyGDSdesign incorporates C++ code that requires compilation (Clipper library), you'll need a C++ compiler installed on your system before installation.
- Download from: https://visualstudio.microsoft.com/downloads/
- Downloads the community version
- Download "Build Tools for Visual Studio 2022" (or latest version)
- Run the installer
- Select "Desktop development with C++" workload
- Click Install (requires ~7GB disk space)
Once you have a C++ compiler installed:
-
Clone the repository:
git clone https://github.com/edumur/pygdsdesign.git cd pygdsdesign -
Install in standard mode:
pip install . -
Or install in development/editable mode (for contributors):
pip install -e .
PyGDSdesign makes it easy to create complex layouts with just a few lines of code. Here's a simple example:
import pygdsdesign as gds
# Create a new library
lib = gds.GdsLibrary()
# Create a cell
cell = lib.new_cell('MY_DESIGN')
# Add shapes
rect = gds.Rectangle((0, 0), (10, 5))
cell.add(rect)
# Save to file
lib.write_gds('output.gds')A beautifully designed spiral resonator showcasing the library's ability to create intricate curved structures with precise control.
Coplanar waveguide (CPW) resonators demonstrating the library's capability for designing transmission line structures commonly used in quantum computing and microwave applications.
The repository includes numerous example scripts in the examples/ folder demonstrating various use cases.
To explore the examples:
cd examples/
python spiral_resonator.py- Python: 76.2% (Main API and high-level functionality)
- C++: 23.6% (Clipper library for boolean operations)
- CMake: 0.2% (Build configuration)
- numpy: Numerical computing and array operations
- scipy: Scientific computing functions
- tqdm: Progress bars for long operations
- Python: 3.11+
- Operating Systems: Windows
- License: Boost Software License 1.0 (BSL-1.0)
Contributions are welcome! Whether it's bug reports, feature requests, or code contributions, we appreciate community involvement.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For a detailed list of changes, improvements, and bug fixes in each version, please refer to CHANGELOG.md.
PyGDSdesign is released under the Boost Software License 1.0 (BSL-1.0). This is a permissive open-source license that allows for both commercial and non-commercial use.
See LICENSE.txt for the full license text.
- Γtienne Dumur - Original author and primary maintainer
- Sacha Wos - Python 3.8 to 3.11+ compatibility
This library incorporates significant code and inspiration from:
- GDSPY by Lucas H. Gabrielli - Core layout functionality and GDS file handling
- Clipper by Angus Johnson - Robust boolean operations on polygons
We are grateful to the open-source community for these foundational tools that make PyGDSdesign possible.
If you use PyGDSdesign in your research, please consider citing it:
Dumur, Γ., & Wos, S. (2024). PyGDSdesign: A Python library for GDS layout design.
GitHub repository: https://github.com/edumur/pygdsdesign
- GDSpy: The underlying library for GDS operations
- KLayout: Popular GDS viewer and editor
- gdstk: Another Python library for GDS manipulation
- Qiskit Metal: Framework for quantum device design
For questions, suggestions, or collaboration opportunities:

