kweb 2.0.4
KLayout Web Viewer
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_appand settings theKWEB_FILESLOCATIONenv variable of passingfileslocation=<Path object for target folder>to the function. Alternatively there is a default one inkweb.default.appthat will only look for the env variable. -
Viewer:
Only enables the
/gds/<filename>endpoints, no root path, i.e. no file browser. Available atkweb.viewer.get_app. This version doesn't provide a listener for the env variable. Use thefileslocationparameter 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)
| File | Size | Uploaded | |
|---|---|---|---|
| kweb-2.0.4.tar.gz | 430.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|