Metadata-Version: 2.4
Name: visioconverter
Version: 1.0.0
Summary: Convert Visio .vsdx to other file formats.
Author-email: Marvin Elling <mane.der@web.de>
License: Apache 2.0
Project-URL: Homepage, https://github.com/MarvinElling/VisioConverter
Project-URL: Iussues, https://github.com/MarvinElling/VisioConverter/issues
Keywords: Visio,Converter,VSDX,SVG
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pywin32
Provides-Extra: dev
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: yapf; extra == "dev"
Dynamic: license-file

# Visio VSDX to File Converter

*A Python utility for batch converting Microsoft Visio VSDX files to other using the Visio COM interface*

*Possible file formats: "html", "png", "jpg", "gif", "tif", "bmp", "emf", "wmf", "svg"*

---

## Features

- Convert a single `.vsdx` file to individual files (one per Visio page)
- Batch-convert all `.vsdx` files in a directory
- Leverages the official Microsoft Visio COM interface for reliable conversion

---

## Requirements

- **Windows** operating system
- **Microsoft Visio** installed (required for the COM Automation)
- Python 3.7+


---

## Installation

```sh
pip install visioconverter
```

Clone or download this repository.
Usage
1. Import and Use in Python
from converter import Converter

# Convert a single .vsdx file to other format
```python
other_files = Converter.vsdx2other(
    src_path="diagram.vsdx",
    out_format="png",         # Possible: "html", "png", "jpg", "gif", "tif", "bmp", "emf", "wmf", "svg"
    out_dir="output_svgs",    # optional, defaults to same as source
    visible=False             # optional, show Visio UI?
)
```

# Batch-convert all .vsdx files in a folder
```python
Converter.folder_vsdx2other(
    src_folder="vsdx_files",
    out_format="png",          # Possible: "html", "png", "jpg", "gif", "tif", "bmp", "emf", "wmf", "svg"
    out_folder="output_files",  # optional, defaults to source folder
    visible=False   
)
```
2. From Command Line
No CLI interface is included by default. See Python sample above or integrate as needed.

# Reference
```
Converter.vsdx2other(src_path, out_dir=None, visible=False) -> list[str]
    src_path: Path to a .vsdx file.
    out_dir: Output directory (default: same as source file).
    visible: Whether to show the Visio UI (default: False).
    Returns list of file paths created.

Converter.folder_vsdx2other(src_folder, out_folder=None, visible=False)
    src_folder: Folder containing .vsdx files.
    out_folder: Where to save files (default: same as each source file).
    visible: Whether to show the Visio UI.
```

## Notes
Requires Microsoft Visio to be installed and licensed on your system.
Only Windows is supported (due to COM automation).
Each page in a Visio document is exported as a separate SVG (<base>_pageX.svg).
Error messages are printed to stdout.

