ezdxf
A Python package to create/manipulate DXF drawings.
What it is and what it does
ezdxf is a Python library for working with DXF (Drawing Exchange Format) files, the standard format used by AutoCAD and other CAD applications. It lets you programmatically create new DXF documents from scratch, load and modify existing ones, and save them back while preserving all content including third-party data and unknown tags. The library supports reading and writing across multiple DXF versions (R12, R2000, R2004, R2007, R2010, R2013, R2018) and can read older versions with automatic upgrading.
The core package depends on pyparsing, typing_extensions, numpy, and fonttools. It includes optional add-ons for specialized tasks like rendering to matplotlib or PyQt5, streaming huge files, importing from other documents, and converting text to paths. A command-line tool is included for viewing, converting, and inspecting DXF files. The library has type annotations and is tested on both CPython and PyPy3.
Use it for:
- Generate CAD drawings programmatically for automated design workflows or parametric modeling.
- Convert or migrate DXF files between different AutoCAD versions while preserving all data.
- Extract and analyze DXF content from third-party CAD applications without data loss.
- Build a command-line tool to inspect, audit, or batch-process DXF files.
- Render DXF drawings to PNG, PDF, or SVG for visualization or documentation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ezdxf creates, reads, modifies, and writes DXF documents across multiple DXF versions (R12 through R2018), preserving third-party content and unknown tags while supporting both ASCII and binary formats.
Yes. ezdxf is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It's well-suited for any project that needs to read, create, or modify DXF files programmatically. The broad DXF version support and preservation of third-party content make it reliable for integration with existing CAD workflows.
Install
ezdxf on PyPI
pip
pip install ezdxfuv
uv add ezdxfpoetry
poetry add ezdxfInstalling ezdxf
Before you install
Low friction: pure Python wheel with four stable runtime dependencies (pyparsing, typing_extensions, numpy, fonttools). Active maintenance with last commit 2026-07-21 and 92 days since latest release. Supports CPython and PyPy3.
License in practice
MIT license (permissive) means you can use, modify, and distribute ezdxf with minimal restrictions in commercial and open-source projects.
Quickstart
import ezdxf
from ezdxf import colors
# Create a new DXF document
doc = ezdxf.new(dxfversion="R2010")
msp = doc.modelspace()
# Add a line and text
msp.add_line((0, 0), (10, 0), dxfattribs={"color": colors.YELLOW})
msp.add_text("Test", dxfattribs={"layer": "TEXTLAYER"})
# Save the document
doc.saveas("output.dxf")
Requires Python 3.10 or later.
Verify before relying
- Performance characteristics when handling very large DXF files (the iterdxf add-on is mentioned for >5GB files, but core performance is not quantified).
- Completeness of DXF entity support across all supported versions and whether all AutoCAD features are representable.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — pyparsing, typing_extensions, numpy, fonttools |
| Maintenance | actively maintained — 92 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,656,759/month — #2,537 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ezdxf-1.4.4-py3-none-any.whl
Keywords: DXF, CAD
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
svgwriteCreates SVG drawings programmatically by…
permissive · top 5,000 on PyPI
python-dxfStores and retrieves arbitrary data blobs in…
permissive · top 15,000 on PyPI
sphinxcontrib-svg2pdfconverterConverts SVG images to PDF or PNG for Sphinx…
permissive · top 15,000 on PyPI
spire-docSpire.Doc creates, reads, modifies, and…
unclear · top 15,000 on PyPI
docxCreates, reads, and writes Microsoft Office…
unclear · top 15,000 on PyPI
fpdfGenerates PDF documents from Python code,…
copyleft · top 5,000 on PyPI
qrcodeGenerates QR codes as images (PNG, SVG) or…
permissive · top 1,000 on PyPI
pygexfPygexf writes network graph data to GEXF (Graph…
unclear · top 15,000 on PyPI
PyQRCodePyQRCode generates QR codes in pure Python and…
permissive · top 15,000 on PyPI
manifold3dManifold3d creates and operates on manifold…
permissive · top 5,000 on PyPI