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
| Package | Used for |
|---|---|
paper-docx | Word documents (imports as docx) |
paper-pptx | PowerPoint presentations (imports as pptx) |
paper-xlsx | Excel workbooks (imports as openpyxl) |
reportlab | PDF authoring |
pypdf, pdfplumber, PyMuPDF, pypdfium2 | PDF reading, extraction, and rendering |
pdf2image, Pillow | Rendering pages to images and processing images |
pandas | Tabular data |
requests, beautifulsoup4, lxml | HTTP 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.1System
sudo apt-get update
sudo apt-get install -y --no-install-recommends curl git jq zip unzip ripgrep \
poppler-utils libreoffice-calc tesseract-ocr| Package | Used for |
|---|---|
ripgrep | File search |
curl, git, jq, zip, unzip | Common command-line tools |
poppler-utils | PDF rendering and text extraction |
libreoffice-calc | Formula recalculation |
tesseract-ocr | OCR for scanned documents. Add the language packs you need. |