Comparison··6 min read

Gulag Cleaner CLI (Python) vs the web version: what they share and which to use

Gulag Cleaner exists as a Python command-line tool and as a web app. Installation, options, a side-by-side table and when each one makes sense.

Gulag Cleaner isn't just a website. The original project started as a Python command-line tool with its core written in Rust, and that same core, compiled to WebAssembly, is what gulagcleaner.pro runs inside the browser. Both versions do the same thing to the PDF; what changes is the installation, the way you use them and a couple of extras. This comparison tells you which one fits each case.

What they share

The method. Gulag Cleaner doesn't crop the ads out: it extracts the original file by manipulating the internal structure of the PDF, because Wuolah and StuDocu embed each real page inside a new page with banners, a cover and marks. The result keeps the quality of the source document, and in neither version does the file leave your machine.

The CLI: installation and usage

You need Python installed. Then, in a terminal:

pip install gulagcleaner
gulagcleaner notes.pdf

It accepts one or more files, and whole folders too, which makes it the natural choice for cleaning an entire term in one go. Besides the clean PDF it prints the metadata it finds in the file, such as author, subject or university. Its options:

OptionWhat it does
-rReplaces the original file with the cleaned version.
-sDoesn't print the metadata of the cleaned files.
-nForces the “naive”, more conservative method.
-hShows the help.
-vShows the installed version.

It can also be called from your own code:

from gulagcleaner.clean import clean_pdf_path

clean_pdf_path("input.pdf", "output.pdf")

The web version: gulagcleaner.pro

Nothing to install: it opens in any browser from the last three years, on mobile too. The engine is the same one, compiled to WebAssembly, and it runs on your device. It adds two things the CLI doesn't have: a preview of the first six pages with the removed-pages count before you download, and a safety net that runs the engine in two modes, discards any result with no pages or with more than 80% of the document removed, and hands back the original if neither passes. In exchange, it cleans one file at a time.

Side by side

CLIWeb
InstallationPython and pipNone
Where the PDF is processedOn your computerIn your browser, no uploads
Several files and foldersYes, in one goOne at a time
Preview before savingNoYes, first six pages
Page-count checkManual (-n option)Automatic, in two modes
PDF metadataYesNo
MobileNoYes
Updatespip install -U gulagcleanerOn page reload
LicenceGPL-3GPL-3, same engine

Which one to pick

  • A single file, from anywhere or from your phone: the web version.
  • Dozens of PDFs or a folder per subject: the CLI.
  • You want to see the result before saving it: the web version.
  • You want to plug it into a script or your own program: the CLI and its clean_pdf_path function.

Open source, two sites

The engine, the CLI and the Rust and WebAssembly distributions live on GitHub under the GPL-3 licence, and the Python package on PyPI. gulagcleaner.pro is an independent web version built on that engine, not affiliated with gulagcleaner.com, the original project's site. The full story is in the open-source story behind Gulag Cleaner.

Ready to clean your PDF?
100% local. No uploads. Free forever.
Open the cleaner →

Keep reading