Metadata-Version: 2.4
Name: doweb
Version: 1.7.3
Summary: KLayout API implementation of gdsfactory
Author-email: DoPlayDo <contact@gdsfactory.com>
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: klayout>=0.29.11
Requires-Dist: fastapi>=0.135.2
Requires-Dist: uvicorn[standard]
Requires-Dist: jinja2
Requires-Dist: pydantic_extra_types>=2.6.0
Requires-Dist: pydantic-settings>=2.10.1
Requires-Dist: loguru>=0.7.3
Requires-Dist: pydantic>=2.11.7
Provides-Extra: dev
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: gitpython; extra == "dev"
Requires-Dist: pylsp-mypy; extra == "dev"
Requires-Dist: types-cachetools; extra == "dev"
Requires-Dist: towncrier; extra == "dev"
Requires-Dist: tbump; extra == "dev"
Requires-Dist: cython>=3.1.3; extra == "dev"
Requires-Dist: setuptools>=80.9.0; extra == "dev"
Requires-Dist: ruff>=0.13.1; extra == "dev"
Requires-Dist: pyright>=1.1.405; extra == "dev"
Requires-Dist: websockets>=15.0.1; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx_rtd_theme; extra == "docs"
Requires-Dist: sphinxcontrib-video; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
Requires-Dist: sphinx-book-theme==1.1.4; extra == "docs"
Requires-Dist: sphinx-click; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx-markdown-tables==0.0.17; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: matplotlib; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: autodoc_pydantic; extra == "docs"
Provides-Extra: ipy
Requires-Dist: ipython; extra == "ipy"
Requires-Dist: ipywidgets; extra == "ipy"
Requires-Dist: ipyevents; extra == "ipy"
Provides-Extra: tests
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Requires-Dist: httpx; extra == "tests"
Dynamic: license-file

# DoWeb 1.7.3

KLayout Web Viewer based on [canvas2canvas](https://github.com/klayoutmatthias/canvas2canvas)

This app contains the logic to render .gds files, including in VSCode.

![demo](docs/_static/doweb.png)

## Install & Run

### Through pypi

From a python virtual environment run:

```bash
python -m pip install doweb
export DOWEB_FILESLOCATION="/path/to/gds/folder" # or the windows equivalent with set
uvicorn --reload doweb.default:app
````

#### Advanced Usage

DoWeb offers two basic apps:

- Browser:

  A version that provides a version with a file browser for a folder and the doweb viewer for viewing the gds file in that folder.
  This can be used by importing the function `doweb.browser.get_app` and settings the `DOWEB_FILESLOCATION` env variable of passing
  `fileslocation=<Path object for target folder>` to the function. Alternatively there is a default one in `doweb.default.app` that
  will only look for the env variable.

- Viewer:

  Only enables the `/gds/<filename>` endpoints, no root path, i.e. no file browser. Available at `doweb.viewer.get_app`. This version
  doesn't provide a listener for the env variable. Use the `fileslocation` parameter in the function instead.

### Development

#### Clone & Install


```bash
git clone https://github.com/doplaydo/doweb.git
cd /doweb
python -m pip install -e .[dev]
make clean # to remove the build files
```

#### Set a folder for doweb to use when looking for gds files

```bash
export DOWEB_FILESLOCATION=/path/to/folder/with/gdsfiles
```

#### Run

```bash
cd src/doweb
uvicorn --reload default:app
```

Copy the link http://localhost:8000/gds/file.gds to your browser to open the waveguide example


#### Contributing

Please make sure you have also installed pre-commit before committing:

```bash
python -m pip install pre-commit
pre-commit install
```
