gdsfactory is a Python library for generating GDS layouts, primarily used in photonics and electronics design. It provides a robust framework for creating parametric cells, routing, and packaging complex circuits into GDSII format. The current version is 9.40.1, and it maintains a rapid release cadence with frequent updates and new features.
pip install gdsfactoryVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a basic GDSFactory component, add a standard straight waveguide, and export it to a GDSII file. Ensure you have GDSFactory installed before running.
Ensure your environment has `pydantic>=2.0.0,<3.0.0` installed. If you have custom Pydantic models, they might need migration to Pydantic v2 syntax.
Replace `c.add_ref(my_component)` with `c << my_component` for cleaner and more Pythonic code.
Install Klayout (a free GDS viewer) and add its executable directory to your system's PATH. Alternatively, set an environment variable `GDSFACTORY_KLAYOUT_PATH` to the full path of the Klayout executable.
Install the package using pip: `pip install gdsfactory`. Ensure your IDE or script uses the correct Python interpreter where it's installed.
Change `from gdsfactory.component import Component` to `from gdsfactory import Component` or, more commonly, use `import gdsfactory as gf` and access it via `gf.Component`.
Upgrade Pydantic to version 2: `pip install "pydantic>=2.0.0,<3.0.0"`. Verify that any custom Pydantic models you use are compatible with Pydantic v2.
No dependency data recorded yet.