Python bindings to d2lang
Project description
Native Python bindings for d2lang, the modern text-to-diagram language. Compile D2 diagram source code to SVG directly from Python — no CLI tools or subprocesses required.
Includes a built-in Analog Devices (ADI) component library with 64 signal chain shapes (ADCs, DACs, amplifiers, filters, PLLs, power management, RF, interfaces, and more) plus light and dark ADI-branded themes.
Quick Start
import d2
# Basic diagram
svg = d2.compile("x -> y -> z")
# ADI signal chain with branded theme
svg = d2.compile("""
sensor: ADXL345 { class: sensor }
amp: LT6230 { class: amplifier }
adc: AD7606 { class: adc }
dsp: ADSP-21489 { class: dsp-fpga }
sensor -> amp -> adc -> dsp
""", adi=True)
# Dark theme variant
svg = d2.compile(code, adi=True, theme="dark")
Installation
pip install pyd2lang-native
Pre-built wheels are available for Linux (x86_64, aarch64), macOS (Intel, Apple Silicon), and Windows.
Documentation
Full documentation is available at the project docs site.
License
This project is licensed under the MPL-2.0 License. See the LICENSE file for details.
Dependencies
The d2lang compiler is built as a native shared library (.so / .dll / .dylib) and bundled into platform-specific Python wheels.
- d2lang: Project repo and License
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 Distributions
Built Distributions
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 pyd2lang_native-0.1.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 14.5 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12219766a4005c62f6e8351ce0f37de072c908419f57249224a144a28e48f542
|
|
| MD5 |
57dbdca2f582c4d000861e93e0d85caf
|
|
| BLAKE2b-256 |
5c40b4300647dc36b10406319912fd20292deb5dc9fc272539ae79f8a6a1d425
|
File details
Details for the file pyd2lang_native-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 13.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
593ee3e7f94a6e7c0457e2183dcb8a10e6eb832c2ccaf79d3ef8953c9f0260b9
|
|
| MD5 |
692c3606aff6be8e61cd98ba951ccfcb
|
|
| BLAKE2b-256 |
06278c090568c42a4fa401f1e3223060256a59db9a51b5d06028731b872ebad7
|
File details
Details for the file pyd2lang_native-0.1.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 14.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a2e7c183c0b88cf31d88f1cf0bd4c51d6c65d2bf363af56e8f647b0ee97631c
|
|
| MD5 |
90236c3009598c89a63ba32df855be69
|
|
| BLAKE2b-256 |
0a52186e807ff3fa1ccf3ddc98e77a2612c7c634cd57ee5ec6f00d4f721a0fc2
|
File details
Details for the file pyd2lang_native-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 9.7 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0880aa75286a381b12bf24b7a9b689eccdb0da0d4bb3c2259e6faaa88dd21785
|
|
| MD5 |
42d741856db61dfce0cd727606f75cdc
|
|
| BLAKE2b-256 |
7127e8ce1dca6ec100f23da116b981622cb0b855efd540ab80a88ddc53b02f28
|
File details
Details for the file pyd2lang_native-0.1.1-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 14.5 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d9717a62e64c357a6ba93f1df6f9742f3f53ff4c5c96d45716bdb8a1a62d6bb
|
|
| MD5 |
8b9cf3ada1953cae2f87e352d22d6f6f
|
|
| BLAKE2b-256 |
1cf2d80ff0783a96654b37ab45ba97d9074f4ff8000ec922116dd9aef1e6213d
|
File details
Details for the file pyd2lang_native-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 13.7 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ed63c822a097a004121c9ce6a90a73782b6e97ac73587555c5e3c83ff467dfc
|
|
| MD5 |
49b6271cf4c4008a93c5d86c7c4de9e3
|
|
| BLAKE2b-256 |
8e9a798c5d375a66abe46822394f166425dd48ef893b0661480aec08c801501f
|
File details
Details for the file pyd2lang_native-0.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 14.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bbfec8e9d459872f8c3a01087ec38f29a354b296e5d5b0c086b899f781a517f
|
|
| MD5 |
d95d2c805455a70c53735a1161fe4516
|
|
| BLAKE2b-256 |
a58cc7143755535a006801f652ff5ed3e472139257c6f9cef429e9b7aa2fe548
|
File details
Details for the file pyd2lang_native-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 9.7 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99d25817ba5585dc16ec18fdcc63845683a4267c758f7b75c6e2b2b97d413c02
|
|
| MD5 |
920b6bd79b7175fd4bab462dc764a105
|
|
| BLAKE2b-256 |
85dd7db49a6c4587bc53f86c0b0d5ade4f6b5edb79cf0928810bac279e2cdb35
|
File details
Details for the file pyd2lang_native-0.1.1-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 14.5 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b53baf4058b21d41a5837749d8a4ca02803cd635ca8126a894a59ddc796b4dc5
|
|
| MD5 |
fa851d9325dbb1eaa25c5abd4ee41874
|
|
| BLAKE2b-256 |
5b616f9dcfacf33ab9ebc58aafddebf7de4487daaa4ba6b6fcc3aa829dd3d25e
|
File details
Details for the file pyd2lang_native-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 13.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c476acdaab98f0db62850088598caff40bbd84b2aa3136a85a4b9ef27674794
|
|
| MD5 |
37c357d02c357946b7b8e86bc93082db
|
|
| BLAKE2b-256 |
417f7246466a56273da851e17549f50a9de7d2056123e36e42a4868b8c182800
|
File details
Details for the file pyd2lang_native-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 14.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c14df6308bb5953fba13cc9bb19cb904190e33c7ec0f2acab07f7a5322880e25
|
|
| MD5 |
2c83b662b413402a5979c973eafa28e6
|
|
| BLAKE2b-256 |
09fef69b8854909f2b313aca2108b414e7928b87ad6a51539415dc5a729db3c7
|
File details
Details for the file pyd2lang_native-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyd2lang_native-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 9.7 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba3e2c68d0546e9bfd0822a5d7fce06c379c0fe918a5e044d9ec498dbc97bfff
|
|
| MD5 |
e92e61cb4563118e4bade5b7a0f274c1
|
|
| BLAKE2b-256 |
75100030fa7f7b044645535bb2fcdafb42adbc0079fda1ef07260b369a0348e1
|