Generate a single PDF of People's Daily by fetching and stitching the official page PDFs.
-
Python 3.12 or newer
-
requests,pypdf,pytest(development) — install with:pip install -r requirements.txt
-
Optional: Ghostscript if you plan to use
--compressfor file-size reduction.
python peoples_daily.py [-h] [-d DATE] [-o OUTPUT] [-v] [--compress]| Flag | Description | Default |
|---|---|---|
-d, --date |
Issue date (YYYY-MM-DD). | today |
-o, --output |
Output filename. | 人民日报_<date>.pdf |
-v, --verbose |
Print progress + warning details. | off |
--compress |
Run Ghostscript to shrink the merged PDF. | off |
Fetch today's paper:
python peoples_daily.pyShow CLI help and available options:
python peoples_daily.py -hSave the 2025-10-15 issue to a custom file with verbose logging:
python peoples_daily.py -d 2025-10-15 -o paper.pdf -vProduce a compressed version (requires Ghostscript on PATH):
python peoples_daily.py -d 2025-10-15 --compress- Compression uses Ghostscript with the
/ebookprofile. The script skips compression automatically if Ghostscript is not available. - Verbose mode surfaces upstream PDF parsing warnings that are hidden by default.