Skip to main content

kweb 2.0.4

KLayout Web Viewer demo

Based on https://github.com/klayoutmatthias/canvas2canvas

Install & Run

Through pypi

From a python virtual environment run:

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

Advanced Usage

KWeb offers two basic apps:

  • Browser:

    A version that provides a version with a file browser for a folder and the kweb viewer for viewing the gds file in that folder. This can be used by importing the function kweb.browser.get_app and settings the KWEB_FILESLOCATION env variable of passing fileslocation=<Path object for target folder> to the function. Alternatively there is a default one in kweb.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 kweb.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

# Clone the repository to your local
git clone https://github.com/gdsfactory/kweb.git
# Install the necessary dependencies
cd /kweb
python -m pip install -e .[dev]

Set a folder for kweb to use when looking for gds files

export KWEB_FILESLOCATION=/path/to/folder/with/gdsfiles

Run

cd src/kweb
uvicorn --reload default:app

Copy the link http://127.0.0.1:8000/gds/file.gds (or http://localhost:8000/gds/file.gds also works) to your browser to open the waveguide example

Contributing

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

python -m pip install pre-commit
pre-commit install

Metadata

Release files for kweb 2.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kweb 2.0.4
File Size Uploaded
kweb-2.0.4.tar.gz 430.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kweb 2.0.4
File Interpreter ABI Platform
kweb-2.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 799.3 kB

Release files / kweb-2.0.4.tar.gz

Download URL kweb-2.0.4.tar.gz
Size 430.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d7a0f128e39a14daffcec7729639a80b6b94f45c1f95306dca7a0120f4cc6095
BLAKE2b-256 checksum
How to use checksums
2cc1323720d064f7fdce9c5097aa351ec0144edf9680d65d719c63f6c3c37082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / kweb-2.0.4-py3-none-any.whl

Download URL kweb-2.0.4-py3-none-any.whl
Size 369.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80c6b6a3c98306cdb896e1fb6280319c57aa438052afc94dba0a04f4273bc3c6
BLAKE2b-256 checksum
How to use checksums
7c4ac3357993793769904822d7b4f038fe92a4b5b30de213091ff4f201c7520c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

2.0.4 This release

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page