GroupDocs.Conversion for Python via .NET is designed to work seamlessly with AI agents, LLMs, and automated code generation tools. The library ships machine-readable documentation in multiple formats — including an AGENTS.md file inside the pip package itself — so that AI assistants can discover and use the API without manual guidance.
MCP server
GroupDocs provides an MCP (Model Context Protocol) server that enables LLMs to query the documentation on demand instead of loading it all at once. This saves tokens and lets your AI assistant fetch only the information it needs for the current task.
To connect your AI tool to the MCP server, add the GroupDocs endpoint to your MCP configuration:
// Claude Code: ~/.claude/settings.json (or project .mcp.json)
// Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json
{"mcpServers":{"groupdocs-docs":{"url":"https://docs.groupdocs.com/mcp"}}}
// .vscode/mcp.json in your project root
{"servers":{"groupdocs-docs":{"url":"https://docs.groupdocs.com/mcp"}}}
// .cursor/mcp.json in your project root
{"mcpServers":{"groupdocs-docs":{"url":"https://docs.groupdocs.com/mcp"}}}
The groupdocs-conversion-net pip package includes an AGENTS.md file at groupdocs/conversion/AGENTS.md. AI coding assistants that scan installed packages (such as Claude Code, Cursor, GitHub Copilot) can automatically discover the API surface, usage patterns, and troubleshooting tips.
After installing the package, you can find it at:
pip show -f groupdocs-conversion-net | grep AGENTS
Machine-readable documentation
Every documentation page is available as a plain Markdown file that AI tools can fetch and process directly:
Point your AI assistant to the full documentation file for comprehensive context:
Fetch https://docs.groupdocs.com/conversion/python-net/llms-full.txt and use it
as a reference for GroupDocs.Conversion for Python via .NET API.
Or reference individual pages for focused tasks:
Read https://docs.groupdocs.com/conversion/python-net/getting-started/quick-start-guide.md
and help me convert a DOCX to PDF in Python.
Why GroupDocs.Conversion is a good building block for AI document pipelines
LLMs and RAG systems can rarely consume DOCX, XLSX, PPTX, EML, or scanned PDFs directly. GroupDocs.Conversion turns the long tail of office, image, CAD, email, and archive formats into the few formats your model can actually read:
Convert to PDF for OCR + page-level routing.
Convert to HTML when you want to keep semantic structure (headings, tables, lists) for downstream parsers.
Convert to images (one PNG per page) for vision models.
Convert to plain text when you need pure tokens with no markup overhead.
A typical preprocessing step looks like:
fromgroupdocs.conversionimportConverterfromgroupdocs.conversion.options.convertimport(PdfConvertOptions,ImageConvertOptions,WebConvertOptions,)fromgroupdocs.conversion.filetypesimportImageFileType# Step 1: Inspect — let the agent decide what to do based on metadatawithConverter("inbox/incoming.docx")asc:info=c.get_document_info()print(f"format={info.format} pages={info.pages_count}")# Step 2: Convert to a model-friendly formatwithConverter("inbox/incoming.docx")asc:# PDF for OCR / page routingc.convert("staging/incoming.pdf",PdfConvertOptions())# HTML for structure-preserving parsingc.convert("staging/incoming.html",WebConvertOptions())# Per-page PNG for vision modelsopts=ImageConvertOptions()opts.format=ImageFileType.PNGopts.page_number=1opts.pages_count=1c.convert("staging/incoming-page-1.png",opts)
For end-to-end examples — including getting-document-info, convert-document-to-multiple-page-files, and convert-files-within-document-containers — see the Developer Guide. Every code block on those pages has a runnable counterpart in the examples repository.
Pair with GroupDocs.Markdown for clean LLM input
If your downstream model prefers Markdown (most do — it tokenizes efficiently and preserves structure), chain GroupDocs.Conversion with GroupDocs.Markdown for Python via .NET:
Use GroupDocs.Conversion to normalise CAD, email, archives, password-protected files, and exotic formats into PDF or DOCX.
Use GroupDocs.Markdown to export the normalised file to clean Markdown ready for embedding.
This combination covers the long tail of formats while keeping the final input format simple for your RAG pipeline.
AGENTS.md reference
The content below is the same AGENTS.md file that ships inside the groupdocs-conversion-net package. Copy it into your project as AGENTS.md or point your AI assistant to this page.
# GroupDocs.Conversion for Python via .NET -- AGENTS.md
> Instructions for AI agents working with this package.
Convert between 10,000+ document format pairs -- DOCX, PDF, XLSX, PPTX, images, CAD, email, and more.
## Install
```bash
pip install groupdocs-conversion-net
```**Python**: 3.5 - 3.14 | **Platforms**: Windows, Linux, macOS
## Resources
| Resource | URL |
|---|---|
| Documentation | https://docs.groupdocs.com/conversion/python-net/ |
| LLM-optimized docs | https://docs.groupdocs.com/conversion/python-net/llms-full.txt |
| API reference | https://reference.groupdocs.com/conversion/python-net/ |
| Code examples | https://docs.groupdocs.com/conversion/python-net/developer-guide/ |
| Release notes | https://releases.groupdocs.com/conversion/python-net/release-notes/ |
| PyPI | https://pypi.org/project/groupdocs-conversion-net/ |
| Free support forum | https://forum.groupdocs.com/c/conversion/ |
| Temporary license | https://purchase.groupdocs.com/temporary-license |
## Imports
```python
fromgroupdocs.conversionimportLicense,Converter,ConverterSettingsfromgroupdocs.conversion.options.convertimport(PdfConvertOptions,WordProcessingConvertOptions,SpreadsheetConvertOptions,PresentationConvertOptions,ImageConvertOptions,WebConvertOptions,PageDescriptionLanguageConvertOptions,WatermarkTextOptions,)fromgroupdocs.conversion.options.loadimport(WordProcessingLoadOptions,PdfLoadOptions,SpreadsheetLoadOptions,PresentationLoadOptions,EmailLoadOptions,CsvLoadOptions,TxtLoadOptions,)fromgroupdocs.conversion.filetypesimport(ImageFileType,WordProcessingFileType,SpreadsheetFileType,PresentationFileType,PageDescriptionLanguageFileType,WebFileType,)fromgroupdocs.conversion.loggingimportConsoleLogger```## Quick Start
```python
fromgroupdocs.conversionimportConverterfromgroupdocs.conversion.options.convertimportPdfConvertOptionswithConverter("input.docx")asconverter:converter.convert("output.pdf",PdfConvertOptions())```## Convert with Options
```python
fromgroupdocs.conversionimportConverterfromgroupdocs.conversion.options.convertimportPdfConvertOptionsfromgroupdocs.conversion.options.loadimportWordProcessingLoadOptionsload_options=WordProcessingLoadOptions()load_options.password="secret"withConverter("protected.docx",load_options)asconverter:options=PdfConvertOptions()options.dpi=300options.page_number=1options.pages_count=2converter.convert("output.pdf",options)```## Per-Page Output
For per-page raster outputs (JPG, PNG, PSD, SVG) the Python binding does
not expose the .NET per-page stream callback. Use `page_number` +
`pages_count = 1` and loop over pages instead:
```python
fromgroupdocs.conversionimportConverterfromgroupdocs.conversion.options.convertimportImageConvertOptionsfromgroupdocs.conversion.filetypesimportImageFileTypewithConverter("slides.pptx")asconverter:pages=converter.get_document_info().pages_countoptions=ImageConvertOptions()options.format=ImageFileType.PNGoptions.pages_count=1forpageinrange(1,pages+1):options.page_number=pageconverter.convert(f"slide-{page}.png",options)```## Get Document Info
```python
fromgroupdocs.conversionimportConverterwithConverter("document.pdf")asconverter:info=converter.get_document_info()print(f"Pages: {info.pages_count}, Format: {info.format}")```## Get Possible Conversions
```python
fromgroupdocs.conversionimportConverterwithConverter("report.xlsx")asconverter:conversions=converter.get_possible_conversions()primary=[c.formatforcinconversions.allifc.is_primary]print(f"Primary targets for {conversions.source.description}: {primary}")```## Convert from Stream
```python
fromgroupdocs.conversionimportConverterfromgroupdocs.conversion.options.convertimportPdfConvertOptionswithopen("input.docx","rb")asstream:withConverter(stream)asconverter:converter.convert("output.pdf",PdfConvertOptions())```## Logging
```python
fromgroupdocs.conversionimportConverter,ConverterSettingsfromgroupdocs.conversion.loggingimportConsoleLoggerfromgroupdocs.conversion.options.convertimportPdfConvertOptionssettings=ConverterSettings()settings.logger=ConsoleLogger()withConverter("input.docx",settings)asconverter:converter.convert("output.pdf",PdfConvertOptions())```## Licensing
```python
fromgroupdocs.conversionimportLicense# From fileLicense().set_license("path/to/license.lic")# From streamwithopen("license.lic","rb")asf:License().set_license(f)```Or auto-apply: `export GROUPDOCS_LIC_PATH="path/to/license.lic"`**Evaluation**: works without a license with limitations (page/document count cap, evaluation watermark in output). Get a free 30-day full license: https://purchase.groupdocs.com/temporary-license
## Key Patterns
- **Properties**: use `snake_case` -- auto-mapped to .NET `PascalCase`- **Context managers**: `with Converter(...) as x:` ensures resources are released
- **Streams (input)**: pass `open("file", "rb")` or `io.BytesIO(data)` where .NET expects Stream
- **Streams (output)**: NOT supported by the Python binding -- write to disk and read back if you need an in-memory buffer
- **Per-page raster output**: use `options.page_number` + `options.pages_count = 1` (the per-page callback overload is not exposed)
- **Enums**: case-insensitive, lazy-loaded (e.g., `ImageFileType.Jpg`)
- **Collections**: `for item in result` and `len(result)` work on .NET collections
- **Exceptions**: `ConversionNotSupportedException` for unsupported source/target pairs -- check upfront with `get_possible_conversions()`## Troubleshooting
**`Saving the entire document is only supported when converting to TIFF format`** -- you tried to convert a multi-page document to a single JPG/PNG/PSD/SVG. Set `options.page_number = 1` and `options.pages_count = 1` to render one page at a time, or convert to TIFF for a multi-page raster output.
**`ConversionNotSupportedException`** -- the source / target pair is not supported by the .NET engine. Call `Converter.get_possible_conversions_by_extension(ext)` or `converter.get_possible_conversions()` to discover valid targets before converting.
**`DllNotFoundException: libgdiplus`** -- install `libgdiplus`: `sudo apt install libgdiplus` (Linux) / `brew install mono-libgdiplus` (macOS).
**`DllNotFoundException: libSkiaSharp`** -- a stale system copy conflicts with the bundled version. Rename it: `sudo mv /usr/local/lib/libSkiaSharp.dylib /usr/local/lib/libSkiaSharp.dylib.bak`.
**`DOTNET_SYSTEM_GLOBALIZATION_INVARIANT` errors** -- do NOT set this. Install ICU: `sudo apt install libicu-dev`.
**Garbled text / missing fonts** -- install Microsoft TrueType fonts: `sudo apt install ttf-mscorefonts-installer fontconfig && sudo fc-cache -f`.
**`TypeLoadException`** -- reinstall: `pip install --force-reinstall groupdocs-conversion-net`.
**Still stuck?** Post your question at https://forum.groupdocs.com/c/conversion/ -- the development team responds directly.