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.4-cp312-cp312-win_amd64.whl (14.5 MB view details)

Uploaded CPython 3.12Windows x86-64

pyd2lang_native-0.1.4-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.4-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.4-cp312-cp312-macosx_11_0_arm64.whl (9.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

pyd2lang_native-0.1.4-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.4-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.4-cp311-cp311-macosx_11_0_arm64.whl (9.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

pyd2lang_native-0.1.4-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.4-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.4-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.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyd2lang_native-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8a73de402d44f68f613a458d2c3957e2302fb72ec0415eb38c59257b1749ca88
MD5 6a5cfee503243d8b1d37bf01f1e65bff
BLAKE2b-256 8f1def57b0ee117a1801df492d8d9687d8edee07a6616a6ffa6681b2027b7e56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyd2lang_native-0.1.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0bc24d016e06f01ea8391d0afa30b912cc9f32c088eb95e54da9c5f0cf546dca
MD5 6324e90853e4f09676ab175890f27b9b
BLAKE2b-256 ec1ea91bf64cf8ab63e82c3172c27f8a0f4ef9a39b2f45baa0e82f803ac289b1

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.4-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.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4c47b325aaa2605f38ada971a6f5a298328e37ff6d93b7dfa37c82d5ae63b006
MD5 bf974e3d19317174e3dd525b741d638e
BLAKE2b-256 ace8b6ce4613d939c54049e14fbf3ff7c5d2719270796a687aa6d0a2bb23e46e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyd2lang_native-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 162997c2332f507bea937e38620a1144f729acba93889af7ab9e08d9ea971b0c
MD5 969d0a78195ea4f00fd21466cfda19d7
BLAKE2b-256 c99cca831cdaa9b82f804e6bd166fc671f888f0601bb2216e3e848d3d124e99e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyd2lang_native-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 603cb6b87f6655898d6537f9fcecb3f7e628663d872d2cdd7bd661d29b68be55
MD5 94ed3bfc4a9cba3c93432f6cd82c1acb
BLAKE2b-256 89f7cdae3f8ed9337a284d6e75f2b91a90851db9f198b95f8dddd74d62e062e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyd2lang_native-0.1.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1736ce38a91304864bb86fbfa2af5e9915b2a4ff23b851d7826f5f42da2589e0
MD5 27aa96c1c71f47a49d9efe4cffc9d12e
BLAKE2b-256 7c0975a3860ef26f781f5bd27caee9b12b34047368f9915264546b5d8deef29c

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.4-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.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 760bae996a23dde16812f8415fce2cc507d0cd4ce93c41647643a413127164f7
MD5 69061c4f1d0d930a07d5275da0ae3d02
BLAKE2b-256 d5dca515fdee818128c206d1d844b38166790d4d720eb540c3379579bb1f7b63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyd2lang_native-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 415a550fc0ced62bc572ca0abc32f0ba9748799fe68b72b8a2453cceed515a1c
MD5 d201ad111027181bafd862ac79e043f0
BLAKE2b-256 b4dba2aede7b7acab18658a80bc6f85650f8eccbd0900e23aa1c2cca6718a494

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyd2lang_native-0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ab02c739c2dd9687b84f9feaf6f51bdf4e5842b0518ef1b28c29833e50e694eb
MD5 f8836310b24a3498f28ecf9bea90c785
BLAKE2b-256 3d7e0c851e1055b1b3f5267588fb10372fb7449945b20d1f8504016276c80c71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyd2lang_native-0.1.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 26ec99daffb41c2c936a7ae5c3a158e9dd808636ecf1f476bb2ff77699329e56
MD5 9ac1bad679f5229445e67617ccb9596c
BLAKE2b-256 1dcf00ee9a80ac9d20fcea3b53334dfce1936d6b753f49a0d1e19bd9eabb4d6a

See more details on using hashes here.

File details

Details for the file pyd2lang_native-0.1.4-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.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff98710489f730bf673f1d217d02d3a7b8d697ba3a8db5791e988bc88fd01727
MD5 c9ce8be265edac27ac3f64828d0e9ae2
BLAKE2b-256 114fbe199f18ffaa3827fd14eb721029ef84fee49cea5a84b7b8e667b7619bb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyd2lang_native-0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d77d9ccba48b59374e66d93e47e39fe29bb37b9481fdb0d828246656744f98a
MD5 10b6a653e4c009ebc05e9a7ebce283c3
BLAKE2b-256 c9f9add3603007b68996b151133b40eaf1cf91623f06fb41435f506975810343

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