This module is used for importing the KLayout Python API (pya).

Without this module, the API would need to be imported using import pya for usage in KLayout Editor and using import klayout.db for usage with standalone klayout package. To make it simple to create a python module for both use cases, this module automatically imports the correct module and exposes it as pya.

It also contains convenience functions to find the KLayout executable and the running session type.


from kqcircuits.pya_resolver import pya


Returns the KLayout executable command’s full path in the current OS. Or None if it is not found.