Skip to main content

ezsxf

A fast SXF parser, SFC writer and drawing converter for Python, powered by Rust and PyO3. Python 3.9 or later is supported.

  • Parse P21/SFC from a file path, text or bytes, with strict or lenient recovery.
  • Create, edit and save SFC geometry, text, styles, groups, dimensions and hatches.
  • Add elements, fills and shared parts in a single validated batch; export P21/P2Z with dimensions, hatches, attributes and images.
  • Deliver drawings with SAF attributes and TIFF/JPEG dependencies.
  • Export DXF or plot drawings with the optional matplotlib backend.

Installation

python -m pip install ezsxf

For plotting:

python -m pip install "ezsxf[plot]"

The core package has no runtime Python dependencies. Prebuilt wheels are available for Linux x86-64/ARM64, Windows x86-64 and macOS x86-64/ARM64. Building from source requires Rust; see Contributing.

Quick start

import ezsxf

doc = ezsxf.new_sfc("drawing.sfc", name="Drawing", paper="A1", orientation="landscape")
layer = doc.add_layer("Structure")
color = doc.add_color((32, 96, 160))
doc.add_line((10, 10), (100, 50), layer=layer, color=color)
doc.add_circle((50, 50), 10, layer=layer)
doc.add_text("SXF 日本語", (10, 80), height=3.5)  # estimates a monospaced box width
doc.save("drawing.sfc")
doc.save_p21("drawing.p21")

parsed = ezsxf.parse_sfc("drawing.sfc", strict=True)
ezsxf.write_sfc(parsed, "copy.sfc")
print(len(parsed["typed_features"]))

Use parse_p21 for P21 input. For existing SFC edits, start with edit_sfc(parsed). SFC output uses CP932 and validates the complete model before saving. Excess precision or unencodable text raises an error. Drawings with external SAF/image files should be delivered with the bundle APIs.

CLI

python -m ezsxf parse sfc drawing.sfc --pretty
python -m ezsxf to-dxf drawing.sfc drawing.dxf
python -m ezsxf resave-sfc drawing.sfc copy.sfc
python -m ezsxf to-p21 drawing.sfc drawing.p21

Run python -m ezsxf --help or see the CLI guide.

Supported scope

Format Support
SFC All 34 SXF Ver.3.1 feature types are parsed with resolved hierarchy, style codes and attribute attachments. Saving and supported editing APIs retain the SFC model.
P21/P2Z output AP202 output from SFC models includes curves/cubic splines, point markers, text, dimensions/leaders, fills/hatches, styles, subfigures and attributes. P21 bundles and P2Z include validated SAF/images. See P21 writing and bulk authoring/preflight.

Model preservation and third-party CAD display/re-export have separate limits. See compatibility for Japanese text, backslashes, groups, SAF and images. The package does not claim OCF certification.

Documentation

Start with the documentation index, or choose a guide:

Contributing and license

See Contributing for source setup and checks, and Code of Conduct for participation guidelines. MIT licensed; see LICENSE.

Metadata

Release files for ezsxf 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ezsxf 0.3.5
File Size Uploaded Provenance Actions
ezsxf-0.3.5.tar.gz 242.3 kB With provenance Details for ezsxf-0.3.5.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ezsxf 0.3.5
File Actions
ezsxf-0.3.5-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for ezsxf-0.3.5-cp39-abi3-win_amd64.whl
ezsxf-0.3.5-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for ezsxf-0.3.5-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
ezsxf-0.3.5-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for ezsxf-0.3.5-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
ezsxf-0.3.5-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details for ezsxf-0.3.5-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Total release size: 6.5 MB

Release files / ezsxf-0.3.5.tar.gz

Download URL ezsxf-0.3.5.tar.gz
Size 242.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2b0adb18656612e4618f1db0433b80c0e32b9c0f4cee3d9a742072f8f70fbb7c
BLAKE2b-256 checksum
How to use checksums
1c7d0f8a6455b176fb4e259310fe4fd82dbf78ae91104cfb4b7b72eb2d54d900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / ezsxf-0.3.5-cp39-abi3-win_amd64.whl

Download URL ezsxf-0.3.5-cp39-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
12bca50edee7317f78abc98a2a304e18d34fa39f3d2c84b1d311f918d2c5a0d8
BLAKE2b-256 checksum
How to use checksums
95e6fd1c946f00403b004b59c27bc95b6a857a3e258d2a3f04854211c5bc69db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / ezsxf-0.3.5-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL ezsxf-0.3.5-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8d7d7c130260ef848332a784c9c58b68fb5b57571f1015ea36833642eedfb85f
BLAKE2b-256 checksum
How to use checksums
1ab1a926a4efb460561e3c0fcfbfeefdf7b1c8ee4fc83c55434083a6265643d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / ezsxf-0.3.5-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL ezsxf-0.3.5-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a65c33491ebfd3ebf29b356804773048a8022fc7c21ff42c625ed2f9bd76ecb2
BLAKE2b-256 checksum
How to use checksums
b4db0b28e4f641cee356abc70010ce45ba9d54232691b34dd8a65642f58d2ff2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / ezsxf-0.3.5-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Download URL ezsxf-0.3.5-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2cd2f3bb21e88370338d0a5730ec320e11b51ebb36cd848ca9e1a3e4f8d7f2cc
BLAKE2b-256 checksum
How to use checksums
388238f02ccdbe93ab32c92dd4204850d7276268e20c64f1a8e4ca3ffaa1ecd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for ezsxf 0.3.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for ezsxf-0.3.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page