What is Mathpix Python SDK?

Mathpix Python SDK (mpxpy) is the official Python client for accessing Mathpix API services. It offers a simple and flexible way to integrate OCR, document conversion, and Mathpix Markdown (MMD) processing into your Python applications.
Whether you’re building educational tools, research workflows, or content pipelines, the SDK makes it easy to extract and convert structured content from PDFs, images, or Markdown sources.
Mathpix Python SDK Details

Key features of Mathpix Python SDK

  • processing of images and PDFs via a unified interface
  • support for structured math, tables, and text extraction
  • conversion of Mathpix Markdown (MMD) to multiple formats: PDF, DOCX, HTML, LaTeX ZIP, plain Markdown
  • simplified download APIs (get content as text/bytes or save to a file)
  • robust error handling and environment-based authentication

What can I do with the SDK?

  • automate document conversion workflows
  • extract content from scanned PDFs and images
  • render documents to DOCX, HTML, PDF, LaTeX, or Markdown
  • analyze OCR output line-by-line in JSON format
  • build custom UIs and editors around Mathpix Markdown
The SDK is open source and available on GitHub. It is compatible with major Python environments and is distributed via PyPI for easy installation.