Skip to main content

An AnyWidget for displaying declarative diagrams written in D2

Project description

PyPI

D2 Widget d2-widget logo

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

d2_widget-0.0.1rc1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

d2_widget-0.0.1rc1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for d2_widget-0.0.1rc1.tar.gz
Algorithm Hash digest
SHA256 a7eb31e42ab3aee206677ae631f03dd25f90db724b50f85e98caf7a536a6fa0c
MD5 72908c0c315d8d51b300d4d2de52f543
BLAKE2b-256 e20cf9c6d2a6034dc19e8eda77834f4c8f8b6c1a63ca620b388f3aca4bcfd9dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for d2_widget-0.0.1rc1.tar.gz:

Publisher: python-publish.yml on peter-gy/d2-widget

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for d2_widget-0.0.1rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 be4c91a63298e8a230f3a1c289bb224fe88413a38ef53bf1f11ff67b668a7db2
MD5 b518fc5310823133e278901b160d4ff8
BLAKE2b-256 cec81f9d70bfb3542972e4ba4bb92029f9862af9dcac6de63b1c95724151d2d9

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page