--- id: kfactory version: "3.0.4" license: unclear license_treatment: unclear maintenance: active --- # kfactory — KLayout API implementation of gdsfactory License: unclear · Maintenance: active · Downloads: 242.9K/mo ## What it is and what it does KFactory is a Python framework for designing photonic and electronic chip layouts, built on KLayout's C++ geometry engine. It abstracts chip design into parametric cells that can be cached and reused, provides routing algorithms for optical and electrical paths, and supports cross-section definitions for waveguide profiles. The framework integrates schematic-driven workflows with netlist extraction and layout-vs-schematic verification, allowing designers to move between logical schematics and physical layouts. The package works with both integer (DBU) and floating-point (µm) coordinate systems, includes Jupyter integration for live preview in KLayout, and bundles a PDK system for packaging technology definitions. It requires Python 3.12 or later and depends on 18 runtime packages spanning geometry (scipy, rectangle-packer), configuration (pydantic, ruamel-yaml), and version management (semver). No known security vulnerabilities are reported. Use it for: - Design parametric photonic circuits with automatic cell deduplication and caching - Route optical waveguides and electrical traces with Manhattan and all-angle primitives - Define reusable cross-sections and automatically generate cladding layers via Minkowski sums - Extract netlists from physical layouts and verify consistency with schematics - Develop technology PDKs that bundle layers, factories, and design rules for reuse - Interactively preview and edit chip layouts in Jupyter notebooks with KLive integration ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. KFactory is a Python framework for designing photonic and electronic chip layouts, providing parametric cells, routing primitives, cross-section definitions, and schematic-driven design with layout verification on top of KLayout's geometry engine. Yes, if you are designing photonic or electronic chips and want a Python-native parametric layout framework. The active maintenance, low install friction, and rich feature set (routing, schematics, verification) make it a solid choice for chip design workflows. Verify the license treatment before use in proprietary contexts, and confirm klayout system dependencies match your environment. ## Install pip install kfactory uv add kfactory poetry add kfactory ## Installing kfactory Before you install: Low friction; pure Python wheel with 18 runtime dependencies including well-maintained packages like pydantic, loguru, and scipy. Active maintenance with a release 18 days ago. Requires Python 3.12 or later. License in practice: License treatment is unclear in the fact sheet; the description excerpt mentions MIT licensing, but the metadata does not confirm this. Verify the actual license before adopting in a commercial or restricted context. Quickstart: pip install kfactory import kfactory as kf @kf.cell def my_waveguide() -> kf.KCell: return kf.KCell(name="waveguide") Requires Python 3.12 or later; klayout system dependency may need separate installation depending on your platform. Verify before relying: - Whether the MIT license mentioned in the description excerpt is the authoritative license for this version - Whether klayout requires system-level installation or is bundled with the package - Performance characteristics and scalability limits for large chip designs - Compatibility guarantees with specific KLayout versions ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 242.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags photonic chip layout design, parametric cell generation, optical waveguide routing, GDS layout framework, schematic-driven chip design, KLayout Python API, electronic circuit layout, netlist extraction verification, chip-design, photonics, parametric-layout [View on SkillFed](https://skillfed.io/packages/kfactory) · [View on PyPI](https://pypi.org/project/kfactory/)