Metadata-Version: 2.4
Name: kfactory
Version: 3.0.0rc1
Summary: KLayout API implementation of gdsfactory
Author-email: gdsfactory community <contact@gdsfactory.com>
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aenum<4,>=3.1.17
Requires-Dist: cachetools<7.2,>=7.1.1
Requires-Dist: kfnetlist>=0.1.3
Requires-Dist: klayout<0.31,>=0.30.8
Requires-Dist: loguru<0.8,>=0.7.3
Requires-Dist: pydantic<2.14,>=2.13.3
Requires-Dist: pydantic-extra-types<2.12,>=2.11.1
Requires-Dist: pydantic-settings<3,>=2.14.0
Requires-Dist: pygit2<2,>=1.19.2
Requires-Dist: rapidfuzz<4,>=3.14.5
Requires-Dist: rectangle-packer<3,>=2.1.0
Requires-Dist: requests<3,>=2.33.1
Requires-Dist: ruamel.yaml<0.20,>=0.19.1
Requires-Dist: ruamel.yaml.string<0.2,>=0.1.1
Requires-Dist: semver<4,>=3.0.4
Requires-Dist: scipy<2,>=1.17.1
Requires-Dist: toolz<2,>=1.1.0
Requires-Dist: typer<0.26,>=0.25.1
Provides-Extra: dev
Requires-Dist: kfactory[ci]; extra == "dev"
Requires-Dist: mypy<1.21,>=1.20.2; extra == "dev"
Requires-Dist: pre-commit<4.7,>=4.6.0; extra == "dev"
Requires-Dist: pylsp-mypy<0.8,>=0.7.1; extra == "dev"
Requires-Dist: python-lsp-server[all]<1.15,>=1.14.0; extra == "dev"
Requires-Dist: ruff<0.16,>=0.15.12; extra == "dev"
Requires-Dist: ty<0.1,>=0.0.34; extra == "dev"
Requires-Dist: rust-just<1.51,>=1.50.0; extra == "dev"
Requires-Dist: tbump<6.12,>=6.11.0; extra == "dev"
Requires-Dist: types-cachetools<7.1,>=7.0.0.20260503; extra == "dev"
Requires-Dist: types-docutils<0.23,>=0.22.3.20260408; extra == "dev"
Requires-Dist: types-pygments<2.21,>=2.20.0.20260408; extra == "dev"
Requires-Dist: types-requests<2.34,>=2.33.0.20260503; extra == "dev"
Requires-Dist: types-setuptools<82.1,>=82.0.0.20260408; extra == "dev"
Requires-Dist: scipy-stubs<1.18,>=1.17.1.4; extra == "dev"
Provides-Extra: docs
Requires-Dist: kfactory[notebooks]; extra == "docs"
Requires-Dist: erdantic<1.3,>=1.2.1; extra == "docs"
Requires-Dist: zensical<0.1,>=0.0.40; extra == "docs"
Requires-Dist: mkdocs-literate-nav<0.7,>=0.6.3; extra == "docs"
Requires-Dist: mkdocs-video<1.6,>=1.5.0; extra == "docs"
Requires-Dist: mkdocstrings[python]<1.1,>=1.0.4; extra == "docs"
Requires-Dist: pymdown-extensions<10.22,>=10.21.2; extra == "docs"
Requires-Dist: griffe-pydantic<1.4,>=1.3.1; extra == "docs"
Requires-Dist: griffe-inherited-docstrings<1.2,>=1.1.3; extra == "docs"
Requires-Dist: griffe-warnings-deprecated<1.2,>=1.1.1; extra == "docs"
Requires-Dist: ruff<0.16,>=0.15.12; extra == "docs"
Provides-Extra: ci
Requires-Dist: pytest<9.1,>=9.0.3; extra == "ci"
Requires-Dist: pytest-cov<7.2,>=7.1.0; extra == "ci"
Requires-Dist: pytest-randomly<4.2,>=4.1.0; extra == "ci"
Requires-Dist: pytest-regressions<2.11,>=2.10.0; extra == "ci"
Requires-Dist: pytest-xdist<3.9,>=3.8.0; extra == "ci"
Requires-Dist: pytest-datadir<1.9,>=1.8.0; extra == "ci"
Requires-Dist: types-cachetools<7.1,>=7.0.0.20260503; extra == "ci"
Requires-Dist: types-requests<2.34,>=2.33.0.20260503; extra == "ci"
Requires-Dist: uv<0.12,>=0.11.9; extra == "ci"
Provides-Extra: ipy
Requires-Dist: ipyevents<2.1,>=2.0.4; extra == "ipy"
Requires-Dist: ipython<9.14,>=9.13.0; extra == "ipy"
Requires-Dist: ipytree<0.3,>=0.2.2; extra == "ipy"
Requires-Dist: ipywidgets<8.2,>=8.1.8; extra == "ipy"
Provides-Extra: notebooks
Requires-Dist: kfactory[ipy]; extra == "notebooks"
Requires-Dist: jupytext<1.20,>=1.19.1; extra == "notebooks"
Requires-Dist: nbconvert<7.18,>=7.17.1; extra == "notebooks"
Requires-Dist: ipykernel<7.3,>=7.2.0; extra == "notebooks"
Dynamic: license-file

# KFactory 3.0.0rc1

[![codecov](https://codecov.io/gh/gdsfactory/kfactory/graph/badge.svg?token=dArcfnQE4w)](https://codecov.io/gh/gdsfactory/kfactory)

Kfactory is the backend for [gdsfactory](https://github.com/gdsfactory/gdsfactory). It is built upon [KLayout](https://klayout.de).
It offers basic operations like gdsfactory, so it can be used on its own as a layout tool as well.

It is recommended to pin the version of KFactory in `requirements.txt` or `pyproject.toml` with `kfactory==3.0.0rc1` for example.

Features similar to gdsfactory:

- [x] Cells & decorator for caching & storing cells
- [x] Simple routing (point to point and simpl bundle routes for electrical routes)
- [x] Basic cells like euler/circular bends, taper, waveguide
- [x] Path extrusion (no interface with CrossSections)
- [x] Jupyter integration
- [x] PDK/package configuration
- [x] Plugin system (simulations etc.) - Check [kplugins](https://github.com/gdsfactory/kplugins)
- [x] Generic PDK example - Check [kgeneric](https://github.com/gdsfactory/kgeneric)
- [x] CrossSection
- [x] Netlist/Schematics and LVS

Notable missing Features:

- [ ] More advanced routing


New/Improved Features:

- Fully hierarchical bi-directional conversion to YAML
- Automatic snapping to grid thanks to KLayout
- More features for vector geometries due to concept of Point/Edge/Vector/Polygon from Klayout
- Easy booleans thanks to KLayout Regions
- Enclosures: use the concept of enclosures, similar to cross sections, to allow automatic
  calculation of boolean layers for structures based on [minkowski sum](https://en.wikipedia.org/wiki/Minkowski_addition),
  which are built into KLayout


## Getting Started

### Installation

kfactory is available as [`kfactory`](https://pypi.org/project/kfactory/) on PyPI

Install kfactory with `uv`, or `pip`:

```bash
# Add kfactory to your project.
uv add kfactory

# With pip.
pip install kfactory
```

At the moment kfactory works only on python 3.11 and above

### Development Installation

A development environment can be installed with

```bash
just dev
```

For committing `pre-commit` should be installed with `pre-commit install` (this is done with `just dev`).
