Paper Instruments
Ultramarine API

Packages

Install the packages Ultramarine uses where it runs code.

For the environment where the model runs code, start from the python:3.12-slim Debian image or a newer Python slim image (Python 3.12 or later), and install the packages below.

Python

PackageUsed for
paper-docxWord documents (imports as docx)
paper-pptxPowerPoint presentations (imports as pptx)
paper-xlsxExcel workbooks (imports as openpyxl)
reportlabPDF authoring
pypdf, pdfplumber, PyMuPDF, pypdfium2PDF reading, extraction, and rendering
pdf2image, PillowRendering pages to images and processing images
pandasTabular data
requests, beautifulsoup4, lxmlHTTP requests and HTML and XML parsing

The Paper packages are forks that keep the upstream import names, so existing code works unchanged. When an edit cannot be made safely, they raise a typed error and leave the file unchanged. Other packages can pull in the upstream distributions, so install the Paper packages last:

pip install pandas==2.2.3 requests==2.34.2 beautifulsoup4==4.12.3 lxml==5.3.0 \
  pypdf pypdfium2==5.10.1 pdfplumber==0.11.10 pdf2image==1.17.0 \
  "Pillow>=12.1.1,<13" PyMuPDF==1.28.0 reportlab==4.5.1
pip uninstall -y python-docx python-pptx openpyxl
pip install --force-reinstall paper-docx==0.2.0 paper-pptx==0.2.0 paper-xlsx==0.2.1

System

sudo apt-get update
sudo apt-get install -y --no-install-recommends curl git jq zip unzip ripgrep \
  poppler-utils libreoffice-calc tesseract-ocr
PackageUsed for
ripgrepFile search
curl, git, jq, zip, unzipCommon command-line tools
poppler-utilsPDF rendering and text extraction
libreoffice-calcFormula recalculation
tesseract-ocrOCR for scanned documents. Add the language packs you need.

On this page