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 | Provenance | Actions |
|---|---|---|---|---|
| kweb-2.0.4.tar.gz | 430.0 kB | Without provenance | Details for kweb-2.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kweb-2.0.4-py3-none-any.whl | Python 3 | none | any | Details for kweb-2.0.4-py3-none-any.whl |
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
|
Security for kweb 2.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.