Skip to content

wangwllu/peoples_daily

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

People's Daily PDF

Generate a single PDF of People's Daily by fetching and stitching the official page PDFs.

Requirements

  • Python 3.12 or newer

  • requests, pypdf, pytest (development) — install with:

    pip install -r requirements.txt
  • Optional: Ghostscript if you plan to use --compress for file-size reduction.

Usage

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

Examples

Fetch today's paper:

python peoples_daily.py

Show CLI help and available options:

python peoples_daily.py -h

Save the 2025-10-15 issue to a custom file with verbose logging:

python peoples_daily.py -d 2025-10-15 -o paper.pdf -v

Produce a compressed version (requires Ghostscript on PATH):

python peoples_daily.py -d 2025-10-15 --compress

Notes

  • Compression uses Ghostscript with the /ebook profile. The script skips compression automatically if Ghostscript is not available.
  • Verbose mode surfaces upstream PDF parsing warnings that are hidden by default.

About

Generate a PDF file for People's Daily

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages