libvisio-ng
A Python library for parsing and converting Microsoft Visio files to SVG.
Native support for both .vsdx (XML) and .vsd (binary) formats — no external C++ dependencies required.
Features
- Native .vsdx parsing — zero external dependencies for XML-based Visio formats
- Native .vsd parsing — binary OLE2 format support via
olefile(no libvisio/C++ needed) - Theme support — resolves Visio themes, gradients, and shadows
- Text extraction — extract all text content from diagrams
- Page metadata — enumerate pages with dimensions and names
- SVG output — high-fidelity SVG conversion with geometry, text, and styling
- CLI tool —
visio2svgcommand for quick conversions - PNG/PDF export — optional CairoSVG-based rasterization
Installation
pip install libvisio-ng
For PNG/PDF export support:
pip install libvisio-ng[png]
Quick Start
from libvisio_ng import convert, get_page_info, extract_text
# Convert all pages to SVG (works with both .vsdx and .vsd)
svg_files = convert("diagram.vsdx", output_dir="output/")
svg_files = convert("legacy.vsd", output_dir="output/")
# Get page information
for page in get_page_info("diagram.vsdx"):
print(f"{page['name']}: {page['width']}x{page['height']}")
# Extract text
text = extract_text("diagram.vsdx")
Working with .vsd binary files directly
from libvisio_ng._vsd_parser import parse_vsd_file
doc = parse_vsd_file("legacy.vsd")
for page in doc.pages:
print(f"Page: {page.name} ({page.width}x{page.height} inches)")
for shape in page.shapes:
if shape.text:
print(f" Shape {shape.shape_id}: {shape.text}")
print(f" Position: ({shape.xform.pin_x}, {shape.xform.pin_y})")
print(f" Size: {shape.xform.width}x{shape.xform.height}")
CLI
# Convert to SVG
visio2svg convert diagram.vsdx -o output/
visio2svg convert legacy.vsd -o output/
# Show page info
visio2svg info diagram.vsdx
# Extract text
visio2svg text diagram.vsdx
Supported Formats
| Format | Extension | Support |
|---|---|---|
| Visio Drawing (XML) | .vsdx, .vsdm | ✅ Native |
| Visio Template (XML) | .vstx, .vstm | ✅ Native |
| Visio Stencil (XML) | .vssx, .vssm | ✅ Native |
| Visio Drawing (Binary) | .vsd | ✅ Native (olefile) |
| Visio Template (Binary) | .vst | ✅ Native (olefile) |
| Visio Stencil (Binary) | .vss | ✅ Native (olefile) |
Documentation
Full documentation is available at libvisio-ng.readthedocs.io.
To build docs locally:
pip install sphinx sphinx-rtd-theme
cd docs && make html
Architecture
libvisio-ng uses libvisio (C++) as an architectural reference but is a pure Python implementation. The .vsd binary parser reads OLE2 structured storage and parses Visio's chunk-based record format to extract pages, shapes, text, geometry, and styling.
License
GPL-3.0-or-later
Author
Daniel Nylander daniel@danielnylander.se
Metadata
Release files for libvisio-ng 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| libvisio_ng-0.6.1.tar.gz | 82.4 kB | Without provenance | Details for libvisio_ng-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| libvisio_ng-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for libvisio_ng-0.6.1-py3-none-any.whl |
Total release size: 156.4 kB
Release files / libvisio_ng-0.6.1.tar.gz
| Download URL | libvisio_ng-0.6.1.tar.gz |
|---|---|
| Size | 82.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ac116cca56ba96c36334719ec5c87f6184a0f8ff80a87060dc86b8ad3148e2e
|
|
BLAKE2b-256 checksum How to use checksums |
ed6e85857c0f94e592fe7e29bf6ea78618f217e843d4c073fb54d77fcda26b2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / libvisio_ng-0.6.1-py3-none-any.whl
| Download URL | libvisio_ng-0.6.1-py3-none-any.whl |
|---|---|
| Size | 74.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12c953b0673ca7e0608f463f1af29cbd33fb458d860939a41186b1215556ce27
|
|
BLAKE2b-256 checksum How to use checksums |
497a52b7db2af26693a7355ba9d66d92a719bc27896b5d619538712b4ea2cafb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for libvisio-ng 0.6.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.