An AnyWidget for displaying declarative diagrams written in D2
Project description
D2 Widget 
Bring the power of D2 to Python notebooks.
d2-widget is an AnyWidget for displaying declarative diagrams written in D2.
Installation
pip install d2-widget
or with uv:
uv add d2-widget
Development
We recommend using uv for development. It will automatically manage virtual environments and dependencies for you.
uv run jupyter lab example.ipynb
Alternatively, create and manage your own virtual environment:
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
jupyter lab example.ipynb
The widget front-end code bundles it's JavaScript dependencies. After setting up Python, make sure to install these dependencies locally:
pnpm install
While developing, you can run the following in a separate terminal to automatically rebuild JavaScript as you make changes:
pnpm dev
Open example.ipynb in JupyterLab, VS Code, or your favorite editor
to start developing. Changes made in js/ will be reflected
in the notebook.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file d2_widget-0.0.1rc1.tar.gz.
File metadata
- Download URL: d2_widget-0.0.1rc1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7eb31e42ab3aee206677ae631f03dd25f90db724b50f85e98caf7a536a6fa0c
|
|
| MD5 |
72908c0c315d8d51b300d4d2de52f543
|
|
| BLAKE2b-256 |
e20cf9c6d2a6034dc19e8eda77834f4c8f8b6c1a63ca620b388f3aca4bcfd9dd
|
Provenance
The following attestation bundles were made for d2_widget-0.0.1rc1.tar.gz:
Publisher:
python-publish.yml on peter-gy/d2-widget
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
d2_widget-0.0.1rc1.tar.gz -
Subject digest:
a7eb31e42ab3aee206677ae631f03dd25f90db724b50f85e98caf7a536a6fa0c - Sigstore transparency entry: 200568824
- Sigstore integration time:
-
Permalink:
peter-gy/d2-widget@37b16fdfee5bae1ac2336b80ea18fa1907e7a688 -
Branch / Tag:
refs/tags/v0.0.1rc1 - Owner: https://github.com/peter-gy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@37b16fdfee5bae1ac2336b80ea18fa1907e7a688 -
Trigger Event:
release
-
Statement type:
File details
Details for the file d2_widget-0.0.1rc1-py3-none-any.whl.
File metadata
- Download URL: d2_widget-0.0.1rc1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be4c91a63298e8a230f3a1c289bb224fe88413a38ef53bf1f11ff67b668a7db2
|
|
| MD5 |
b518fc5310823133e278901b160d4ff8
|
|
| BLAKE2b-256 |
cec81f9d70bfb3542972e4ba4bb92029f9862af9dcac6de63b1c95724151d2d9
|
Provenance
The following attestation bundles were made for d2_widget-0.0.1rc1-py3-none-any.whl:
Publisher:
python-publish.yml on peter-gy/d2-widget
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
d2_widget-0.0.1rc1-py3-none-any.whl -
Subject digest:
be4c91a63298e8a230f3a1c289bb224fe88413a38ef53bf1f11ff67b668a7db2 - Sigstore transparency entry: 200568827
- Sigstore integration time:
-
Permalink:
peter-gy/d2-widget@37b16fdfee5bae1ac2336b80ea18fa1907e7a688 -
Branch / Tag:
refs/tags/v0.0.1rc1 - Owner: https://github.com/peter-gy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@37b16fdfee5bae1ac2336b80ea18fa1907e7a688 -
Trigger Event:
release
-
Statement type: