ezdxf 1.4.3


pip install ezdxf

  Latest version

Released: Oct 19, 2025


Meta
Author: Manfred Moitzi
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

License
  • OSI Approved :: MIT License

Operating System
  • OS Independent

Programming Language
  • Python :: 3
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Intended Audience
  • Developers

Topic
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed

ezdxf

Abstract

This Python package is designed to facilitate the creation and manipulation of DXF documents, with compatibility across various DXF versions. It empowers users to seamlessly load and edit DXF files while preserving all content, except for comments.

Any unfamiliar DXF tags encountered in the document are gracefully ignored but retained for future modifications. This feature enables the processing of DXF documents containing data from third-party applications without any loss of valuable information.

Quick-Info

  • ezdxf is a Python package to create new DXF files and read/modify/write existing DXF documents
  • MIT-License
  • the intended audience are programmers
  • requires at least Python 3.10
  • OS independent
  • tested with CPython and pypy3
  • has type annotations and passes mypy --ignore-missing-imports -p ezdxf successful
  • additional required packages for the core package without add-ons
  • read/write/new support for DXF versions: R12, R2000, R2004, R2007, R2010, R2013 and R2018
  • additional read-only support for DXF versions R13/R14 (upgraded to R2000)
  • additional read-only support for older DXF versions than R12 (upgraded to R12)
  • read/write support for ASCII DXF and Binary DXF
  • retains third-party DXF content
  • optional C-extensions for CPython are included in the binary wheels, available on PyPI for Windows, Linux and macOS
  • command line script ezdxf to display, convert and inspect DXF files

Included Extensions

Additional packages required for these add-ons are not automatically installed during the basic setup, for more information about the setup & dependencies visit the documentation.

  • The drawing add-on is a translation layer to send DXF data to a render backend, interfaces to matplotlib, which can export images as PNG, PDF or SVG, and PyQt5 are implemented.
  • r12writer add-on to write basic DXF entities direct and fast into a DXF R12 file or stream
  • iterdxf add-on to iterate over DXF entities from the modelspace of huge DXF files (> 5GB) which do not fit into memory
  • Importer add-on to import entities, blocks and table entries from another DXF document
  • dxf2code add-on to generate Python code for DXF structures loaded from DXF documents as starting point for parametric DXF entity creation
  • acadctb add-on to read/write plot style files (CTB/STB)
  • pycsg add-on for basic Constructive Solid Geometry (CSG) modeling
  • MTextExplode add-on for exploding MTEXT entities into single-line TEXT entities
  • text2path add-on to convert text into outline paths
  • geo add-on to support the __geo_interface__
  • meshex for exchanging meshes with other tools as STL, OFF or OBJ files
  • openscad add-on, an interface to OpenSCAD
  • odafc add-on, an interface to the ODA File Converter to read and write DWG files
  • hpgl2 add-on for converting HPGL/2 plot files to DXF, SVG and PDF

A simple example:

import ezdxf
from ezdxf import colors
from ezdxf.enums import TextEntityAlignment

# Create a new DXF document.
doc = ezdxf.new(dxfversion="R2010")

# Create new table entries (layers, linetypes, text styles, ...).
doc.layers.add("TEXTLAYER", color=colors.RED)

# DXF entities (LINE, TEXT, ...) reside in a layout (modelspace, 
# paperspace layout or block definition).  
msp = doc.modelspace()

# Add entities to a layout by factory methods: layout.add_...() 
msp.add_line((0, 0), (10, 0), dxfattribs={"color": colors.YELLOW})
msp.add_text(
    "Test", 
    dxfattribs={
        "layer": "TEXTLAYER"
    }).set_placement((0, 0.2), align=TextEntityAlignment.CENTER)

# Save the DXF document.
doc.saveas("test.dxf")

Example for the r12writer, which writes a simple DXF R12 file without in-memory structures:

from random import random
from ezdxf.addons import r12writer

MAX_X_COORD = 1000
MAX_Y_COORD = 1000

with r12writer("many_circles.dxf") as doc:
    for _ in range(100000):
        doc.add_circle((MAX_X_COORD*random(), MAX_Y_COORD*random()), radius=2)

The r12writer supports only the ENTITIES section of a DXF R12 drawing, no HEADER, TABLES or BLOCKS section is present, except FIXED-TABLES are written, than some additional predefined text styles and line types are available.

Installation

Basic installation by pip including the optional C-extensions from PyPI as binary wheels:

pip install ezdxf

Full installation with all dependencies (matplotlib, PySide6) for using the drawing add-on:

pip install ezdxf[draw]

For more information about the setup & dependencies visit the documentation.

Command Line

Use python -m ezdxf ... if your shell can't find the ezdxf script.

Get additional help for a sub-command:

ezdxf <cmd> -h

Preview DXF files in a graphical window:

ezdxf view <file.dxf>

Export the modelspace of DXF files as PNG|SVG|PDF:

ezdxf draw -o file.<png|svg|pdf> <file.dxf>

Print basic information about DXF files:

ezdxf info <file.dxf>

Show detailed information and structures of DXF files:

ezdxf browse <file.dxf>

Audit DXF files:

ezdxf audit <file.dxf>

Preview and convert HPGL/2 plot files:

ezdxf hpgl <file.plt>

Website

https://ezdxf.mozman.at/

Documentation

Documentation of the development version at https://ezdxf.mozman.at/docs

Documentation of the latest release at https://ezdxf.readthedocs.io/

Knowledge Graph

The knowledge graph contains additional information beyond the documentation and is managed by logseq. The source data is included in the repository in the folder ezdxf/notes. There is also a HTML export on the website which gets regular updates.

Contribution

The source code of ezdxf can be found at GitHub, target your pull requests to the master branch:

https://github.com/mozman/ezdxf.git

Feedback

Questions and feedback at GitHub Discussions:

https://github.com/mozman/ezdxf/discussions

Questions at Stack Overflow:

Post questions at stack overflow and use the tag dxf or ezdxf.

Issue tracker at GitHub:

http://github.com/mozman/ezdxf/issues

Release Notes

The release notes are included in the knowledge graph.

Changelog

The changelog is included in the knowledge graph.

Contact

Please always post questions at the forum or stack overflow to make answers available to other users as well.

ezdxf@mozman.at

Feedback is greatly appreciated.

Manfred

1.4.3 Oct 19, 2025
1.4.3b3 Sep 24, 2025
1.4.3b2 Sep 19, 2025
1.4.3b0 Sep 05, 2025
1.4.2 May 18, 2025
1.4.2b1 May 03, 2025
1.4.2b0 Apr 27, 2025
1.4.1 Apr 14, 2025
1.4.1b2 Apr 09, 2025
1.4.1b1 Mar 29, 2025
1.4.1b0 Mar 17, 2025
1.4.0 Mar 08, 2025
1.4.0b3 Feb 13, 2025
1.4.0b2 Feb 05, 2025
1.4.0b1 Jan 24, 2025
1.4.0b0 Jan 06, 2025
1.3.5 Dec 15, 2024
1.3.5b0 Nov 18, 2024
1.3.4 Oct 15, 2024
1.3.4rc0 Oct 15, 2024
1.3.4b0 Sep 21, 2024
1.3.3 Aug 13, 2024
1.3.2 Jul 12, 2024
1.3.2b1 Jun 24, 2024
1.3.1 Jun 06, 2024
1.3.1b1 Jun 01, 2024
1.3.1b0 May 28, 2024
1.3.0 May 01, 2024
1.3.0rc0 Apr 18, 2024
1.3.0b1 Mar 25, 2024
1.3.0b0 Mar 24, 2024
1.2.1a0 Mar 02, 2024
1.2.0 Mar 02, 2024
1.2.0b3 Feb 24, 2024
1.2.0b2 Feb 11, 2024
1.2.0b1 Jan 28, 2024
1.2.0b0 Jan 06, 2024
1.1.4 Dec 24, 2023
1.1.4b2 Dec 16, 2023
1.1.4b0 Dec 08, 2023
1.1.3 Nov 25, 2023
1.1.3b1 Nov 19, 2023
1.1.3b0 Nov 08, 2023
1.1.2 Nov 01, 2023
1.1.2rc0 Oct 31, 2023
1.1.2b0 Oct 27, 2023
1.1.1 Oct 08, 2023
1.1.1b0 Sep 29, 2023
1.1.0 Sep 09, 2023
1.1.0rc0 Sep 06, 2023
1.1.0b5 Jul 09, 2023
1.1.0b4 Jun 17, 2023
1.1.0b3 May 31, 2023
1.1.0b2 May 20, 2023
1.1.0b1 May 06, 2023
1.1.0b0 Apr 27, 2023
1.0.4b1 Apr 15, 2023
1.0.3 Mar 26, 2023
1.0.3b0 Mar 12, 2023
1.0.2 Feb 15, 2023
1.0.2b1 Feb 10, 2023
1.0.2b0 Feb 04, 2023
1.0.1 Jan 14, 2023
1.0.1b1 Jan 02, 2023
1.0.1b0 Dec 17, 2022
1.0.0 Dec 09, 2022
1.0.0rc2 Nov 25, 2022
1.0.0rc1 Nov 18, 2022
1.0.0rc0 Nov 06, 2022
1.0.0b1 Oct 26, 2022
1.0.0b0 Oct 01, 2022
0.18.1 Sep 03, 2022
0.18 Jul 29, 2022
0.17.2 Jan 06, 2022
0.17.1 Nov 14, 2021
0.17 Oct 01, 2021
0.16.6 Aug 28, 2021
0.16.5 Jul 18, 2021
0.16.4 Jun 20, 2021
0.16.3 May 22, 2021
0.16.2 Apr 24, 2021
0.16.1 Apr 10, 2021
0.16 Mar 27, 2021
0.15.2 Feb 07, 2021
0.15.1 Jan 15, 2021
0.15 Dec 30, 2020
0.14.2 Oct 18, 2020
0.14.1 Sep 19, 2020
0.14 Sep 12, 2020
0.13.1 Jul 18, 2020
0.13 Jul 04, 2020
0.12.5 Jun 05, 2020
0.12.4 May 22, 2020
0.12.3 May 16, 2020
0.12.2 May 03, 2020
0.12.1 Apr 25, 2020
0.12 Apr 12, 2020
0.11.2 Apr 03, 2020
0.11.1 Feb 29, 2020
0.11 Feb 15, 2020
0.10.4 Jan 31, 2020
0.10.3 Jan 29, 2020
0.10.2 Oct 05, 2019
0.10.1 Sep 07, 2019
0.10 Sep 01, 2019
0.9 Feb 24, 2019
0.8.10 Feb 24, 2019
0.8.9 Nov 28, 2018
0.8.8 Apr 02, 2018
0.8.7 Mar 04, 2018
0.8.6 Feb 17, 2018
0.8.5 Jan 28, 2018
0.8.4 Jan 14, 2018
0.8.3 Jan 02, 2018

Wheel compatibility matrix

Platform CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13 Python 3
any
macosx_10_13_universal2
macosx_10_13_x86_64
macosx_10_9_universal2
macosx_10_9_x86_64
macosx_11_0_arm64
manylinux2014_aarch64
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_x86_64
musllinux_1_2_aarch64
musllinux_1_2_x86_64
win_amd64

Files in release

ezdxf-1.4.3-cp310-cp310-macosx_10_9_universal2.whl (3.4MiB)
ezdxf-1.4.3-cp310-cp310-macosx_10_9_x86_64.whl (1.8MiB)
ezdxf-1.4.3-cp310-cp310-macosx_11_0_arm64.whl (2.8MiB)
ezdxf-1.4.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3MiB)
ezdxf-1.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3MiB)
ezdxf-1.4.3-cp310-cp310-musllinux_1_2_aarch64.whl (4.3MiB)
ezdxf-1.4.3-cp310-cp310-musllinux_1_2_x86_64.whl (4.4MiB)
ezdxf-1.4.3-cp310-cp310-win_amd64.whl (1.7MiB)
ezdxf-1.4.3-cp311-cp311-macosx_10_9_universal2.whl (3.4MiB)
ezdxf-1.4.3-cp311-cp311-macosx_10_9_x86_64.whl (2.8MiB)
ezdxf-1.4.3-cp311-cp311-macosx_11_0_arm64.whl (2.8MiB)
ezdxf-1.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.5MiB)
ezdxf-1.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5MiB)
ezdxf-1.4.3-cp311-cp311-musllinux_1_2_aarch64.whl (5.5MiB)
ezdxf-1.4.3-cp311-cp311-musllinux_1_2_x86_64.whl (5.6MiB)
ezdxf-1.4.3-cp311-cp311-win_amd64.whl (2.8MiB)
ezdxf-1.4.3-cp312-cp312-macosx_10_13_universal2.whl (3.4MiB)
ezdxf-1.4.3-cp312-cp312-macosx_10_13_x86_64.whl (2.8MiB)
ezdxf-1.4.3-cp312-cp312-macosx_11_0_arm64.whl (2.8MiB)
ezdxf-1.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.5MiB)
ezdxf-1.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5MiB)
ezdxf-1.4.3-cp312-cp312-musllinux_1_2_aarch64.whl (5.5MiB)
ezdxf-1.4.3-cp312-cp312-musllinux_1_2_x86_64.whl (5.6MiB)
ezdxf-1.4.3-cp312-cp312-win_amd64.whl (2.8MiB)
ezdxf-1.4.3-cp313-cp313-macosx_10_13_universal2.whl (3.4MiB)
ezdxf-1.4.3-cp313-cp313-macosx_10_13_x86_64.whl (2.8MiB)
ezdxf-1.4.3-cp313-cp313-macosx_11_0_arm64.whl (2.8MiB)
ezdxf-1.4.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.5MiB)
ezdxf-1.4.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5MiB)
ezdxf-1.4.3-cp313-cp313-musllinux_1_2_aarch64.whl (5.5MiB)
ezdxf-1.4.3-cp313-cp313-musllinux_1_2_x86_64.whl (5.6MiB)
ezdxf-1.4.3-cp313-cp313-win_amd64.whl (2.8MiB)
ezdxf-1.4.3-py3-none-any.whl (1.3MiB)
ezdxf-1.4.3.tar.gz (1.7MiB)
Extras:
Dependencies:
pyparsing (>=2.0.1)
typing_extensions (>=4.6.0)
numpy
fonttools