Skip to main content

Draw.io, with Python

Project description

🚧 WIP draw.io using Python

Create Draw.io (diagrams.net) drawings, with Python. Without dependency !

Features

  • Rectangles
  • Lines
    • stroke type, thickness, color
    • rounded, curved
    • Connected ends, intermediate points

Usage

from xml.etree.ElementTree import tostring

d = Document()
p1 = Page("Page-1")
p2 = Page("Page-2")
d.add_page(p1)
d.add_page(p2)

r = RoundedRectangle(
    x=200, y=100, width=100, height=100,
    content="blabetiblou",
    text_align="left", text_valign="top",
)
p1.add_content(r)
p1.add_content(Line(points=[
    (r, 0.5, 0),
    (200, 50),
    (200, 100),
], stroke_thickness=4, stroke_color="#FF000",
    content="bonjour", curved=True))

with open('widespot.drawio', 'w') as f:
    f.write(tostring(d.to_xml()).decode())

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

python-drawio-0.1.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

python_drawio-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file python-drawio-0.1.2.tar.gz.

File metadata

  • Download URL: python-drawio-0.1.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for python-drawio-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a845b34b95ebb9a08c2bf1adf277e405bc9a2b57c59a347d6acb9aa4b4a0bd14
MD5 1fe2535505d910ac44029919e3181c7c
BLAKE2b-256 3644c43b334a3f4fbe26f5be6e8d44d06ef38881e8642344424b70a71cd749d5

See more details on using hashes here.

File details

Details for the file python_drawio-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: python_drawio-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for python_drawio-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c1cbdb9c9500d803b6a485b8f63ba7ac854abdee6bb75e51e72b114c2f2aff2c
MD5 e339acb7a9424f8aa96db19adac5b672
BLAKE2b-256 a8bcf6499f22fd4b78821522161f82198c952a014e7fbcfa1e1e33588f2cb243

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