File Format Processing in Python

19 projects in Text & Documents. Most starred: markitdown, docling and pymupdf.

For Office files, openpyxl reads and writes Excel workbooks, while XlsxWriter only writes them but offers rich formatting and charts. python-docx and python-pptx create and edit Word documents and PowerPoint decks. For PDFs, pypdf is pure Python and handles splitting, merging, cropping and basic text extraction. PyMuPDF is much faster for rendering and extraction but is licensed under the AGPL or a commercial license. pdfminer.six gives detailed control over text layout, ReportLab generates PDFs from code, and WeasyPrint renders HTML and CSS to PDF.

To feed documents into language models, MarkItDown from Microsoft converts Office files, PDFs and more to Markdown, and Docling from IBM parses layout and tables into structured output. pypandoc wraps pandoc for conversions between many markup formats. For Markdown itself, markdown-it-py follows CommonMark closely, Python-Markdown is the long-standing extensible implementation, and Mistune is fast.

Python 3.11 added tomllib to the standard library for reading TOML (it does not write). PyYAML is the common YAML library; use safe_load for untrusted input. tablib exports tabular data to several formats, and pyelftools parses ELF binaries and DWARF debug information. When a format has both a reading and a writing library, check which side you need first: several popular packages here only read or only write, and choosing the wrong one usually means switching libraries halfway through a project.

General2

pyelftools

Parsing and analyzing ELF files and DWARF debugging information.

2.3kupdated today

tablib

A module for Tabular Datasets in XLS, CSV, JSON, YAML.

4.8kupdated 18d ago3.10.0

File Conversion3

markitdown

Python tool for converting files and office documents to Markdown.

192kupdated 1d ago0.1.9

pypandoc

A thin wrapper for pandoc, the universal document converter.

1.2kupdated 2d ago1.13

docling

Library for converting documents into structured data.

69.5kupdated 1d ago2.142.1

Excel2

openpyxl

A library for reading and writing Excel 2010 xlsx/xlsm/xltx/xltm files.

xlsxwriter

A Python module for creating Excel.xlsx files.

4kupdated 2d ago

Word1

python-docx

Creates, reads, and updates Microsoft Word (.docx) files.

5.7kupdated 2mo ago

PowerPoint1

python-pptx

Python library for creating and updating PowerPoint (.pptx) files.

3.6kupdated 2y ago

PDF4

pypdf

A library capable of splitting, merging, cropping, and transforming PDF pages.

10.3kupdated today6.21.2

pymupdf

A fast MuPDF-based library for extracting, rendering, and editing PDFs and other documents.

11kupdated today2.0

reportlab

An open-source library for generating PDFs and graphics.

pdfminer.six

A community-maintained fork of PDFMiner for extracting information from PDF documents.

7kupdated 7mo ago20260107

HTML-to-PDF1

weasyprint

A visual rendering engine for HTML and CSS that can export to PDF.

9.7kupdated 2d ago70.0

Markdown3

markdown-it-py

Markdown parser with 100% CommonMark support, extensions, and syntax plugins.

1.4kupdated 5d ago4.2.0

markdown

A Python implementation of John Gruber’s Markdown.

4.3kupdated 1d ago3.11.2

mistune

A fast yet powerful Python Markdown parser with renderers and plugins.

3.1kupdated 1d ago3.4.0

Data Formats2

tomllibStandard library

Parse TOML files.

pyyaml

A full-featured YAML framework for Python.

3kupdated 17d ago6.0.3
Esc

Type to search every entry. ↑↓ to move, Enter to open.