Skip to main content

Python bindings to d2lang

Project description

pyd2lang-native

Build Docs PyPI Python License

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.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pyd2lang_native-0.1.1-cp312-cp312-win_amd64.whl (14.5 MB view details)

Uploaded CPython 3.12Windows x86-64

pyd2lang_native-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

pyd2lang_native-0.1.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pyd2lang_native-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (9.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyd2lang_native-0.1.1-cp311-cp311-win_amd64.whl (14.5 MB view details)

Uploaded CPython 3.11Windows x86-64

pyd2lang_native-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

pyd2lang_native-0.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pyd2lang_native-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (9.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyd2lang_native-0.1.1-cp310-cp310-win_amd64.whl (14.5 MB view details)

Uploaded CPython 3.10Windows x86-64

pyd2lang_native-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

pyd2lang_native-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pyd2lang_native-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (9.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file pyd2lang_native-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 12219766a4005c62f6e8351ce0f37de072c908419f57249224a144a28e48f542
MD5 57dbdca2f582c4d000861e93e0d85caf
BLAKE2b-256 5c40b4300647dc36b10406319912fd20292deb5dc9fc272539ae79f8a6a1d425

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 593ee3e7f94a6e7c0457e2183dcb8a10e6eb832c2ccaf79d3ef8953c9f0260b9
MD5 692c3606aff6be8e61cd98ba951ccfcb
BLAKE2b-256 06278c090568c42a4fa401f1e3223060256a59db9a51b5d06028731b872ebad7

See more details on using hashes here.

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

File hashes

Hashes for pyd2lang_native-0.1.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1a2e7c183c0b88cf31d88f1cf0bd4c51d6c65d2bf363af56e8f647b0ee97631c
MD5 90236c3009598c89a63ba32df855be69
BLAKE2b-256 0a52186e807ff3fa1ccf3ddc98e77a2612c7c634cd57ee5ec6f00d4f721a0fc2

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0880aa75286a381b12bf24b7a9b689eccdb0da0d4bb3c2259e6faaa88dd21785
MD5 42d741856db61dfce0cd727606f75cdc
BLAKE2b-256 7127e8ce1dca6ec100f23da116b981622cb0b855efd540ab80a88ddc53b02f28

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3d9717a62e64c357a6ba93f1df6f9742f3f53ff4c5c96d45716bdb8a1a62d6bb
MD5 8b9cf3ada1953cae2f87e352d22d6f6f
BLAKE2b-256 1cf2d80ff0783a96654b37ab45ba97d9074f4ff8000ec922116dd9aef1e6213d

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7ed63c822a097a004121c9ce6a90a73782b6e97ac73587555c5e3c83ff467dfc
MD5 49b6271cf4c4008a93c5d86c7c4de9e3
BLAKE2b-256 8e9a798c5d375a66abe46822394f166425dd48ef893b0661480aec08c801501f

See more details on using hashes here.

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

File hashes

Hashes for pyd2lang_native-0.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1bbfec8e9d459872f8c3a01087ec38f29a354b296e5d5b0c086b899f781a517f
MD5 d95d2c805455a70c53735a1161fe4516
BLAKE2b-256 a58cc7143755535a006801f652ff5ed3e472139257c6f9cef429e9b7aa2fe548

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 99d25817ba5585dc16ec18fdcc63845683a4267c758f7b75c6e2b2b97d413c02
MD5 920b6bd79b7175fd4bab462dc764a105
BLAKE2b-256 85dd7db49a6c4587bc53f86c0b0d5ade4f6b5edb79cf0928810bac279e2cdb35

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b53baf4058b21d41a5837749d8a4ca02803cd635ca8126a894a59ddc796b4dc5
MD5 fa851d9325dbb1eaa25c5abd4ee41874
BLAKE2b-256 5b616f9dcfacf33ab9ebc58aafddebf7de4487daaa4ba6b6fcc3aa829dd3d25e

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1c476acdaab98f0db62850088598caff40bbd84b2aa3136a85a4b9ef27674794
MD5 37c357d02c357946b7b8e86bc93082db
BLAKE2b-256 417f7246466a56273da851e17549f50a9de7d2056123e36e42a4868b8c182800

See more details on using hashes here.

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

File hashes

Hashes for pyd2lang_native-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c14df6308bb5953fba13cc9bb19cb904190e33c7ec0f2acab07f7a5322880e25
MD5 2c83b662b413402a5979c973eafa28e6
BLAKE2b-256 09fef69b8854909f2b313aca2108b414e7928b87ad6a51539415dc5a729db3c7

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba3e2c68d0546e9bfd0822a5d7fce06c379c0fe918a5e044d9ec498dbc97bfff
MD5 e92e61cb4563118e4bade5b7a0f274c1
BLAKE2b-256 75100030fa7f7b044645535bb2fcdafb42adbc0079fda1ef07260b369a0348e1

See more details on using hashes here.

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