kqcircuits.pya_resolver

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.

Usage:

from kqcircuits.pya_resolver import pya

kqcircuits.pya_resolver.is_standalone_session()[source]
kqcircuits.pya_resolver.klayout_executable_command()[source]

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

../_images/kqcircuits.pya_resolver.png