laylight
laylight is a Python toolkit for photonic layout design. Devices are Python classes; the library builds the Laylight IR from them, and the Laylight compiler, the laylight command line, turns the IR into GDSII.
laylight is a sub-product of PhotonStack, focused on making photonic design more programmable, composable, and easier to explore.
Why laylight
Photonic layout work often mixes device geometry, parameter sweeps, custom scripts, and visualization. laylight provides a Python-first way to:
- define photonic structures with reusable, parameterized devices
- chain devices port to port with
Placer - write layouts that carry their cells' parameters, ports and connections, through the same compiler as the Laylight DSL
Documentation and tools
- Documentation: laylight.photonstack.io
- Playground: laylight.photonstack.io/playground
- VS Code extension: PhotonStack/laylight-vscode-extension
Installation
pip install laylight
This installs the laylight command line too (the laylight-cli package). PNG previews and KLayout PCells need KLayout:
pip install "laylight[klayout]"
Simple example
import laylight
from laylight.render import new_layout
from laylight.structure.wg import WGStraight
layout, top, tech = new_layout("DEMO")
device = WGStraight(
length=200,
width=0.5,
layout=layout,
tech=tech,
)
laylight.Placer(device).into(top)
layout.write("demo.gds")
This creates a straight waveguide and writes the result to demo.gds. layout.to_ir() returns the Laylight IR, and layout.write("demo.lyir") writes it to a file that Laylight DSL code can import.
Learn more
For guided examples, API usage, and browser-based experiments, start with the documentation site and the online playground.
Metadata
Release files for laylight 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| laylight-0.2.2.tar.gz | 57.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| laylight-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 131.8 kB
Release files / laylight-0.2.2.tar.gz
| Download URL | laylight-0.2.2.tar.gz |
|---|---|
| Size | 57.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b1728dd3eba3167bd6be8a724186e570ed160bac27608185ad2fff1aa496ce7
|
|
BLAKE2b-256 checksum How to use checksums |
e5f61760984033675553296bf45d9091e72af5333276ccbc18b11a0e7c328402
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / laylight-0.2.2-py3-none-any.whl
| Download URL | laylight-0.2.2-py3-none-any.whl |
|---|---|
| Size | 74.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3512f4266680b4ecca0dd2ee5a37f1632cc5e92019b142d79e94914418534d3
|
|
BLAKE2b-256 checksum How to use checksums |
5c827a09307a3950ee9fc7ba273f9a3c11abbe4dfe2ee94914937e6e71913463
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for laylight 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.