{"id":16643659,"url":"https://github.com/josee9988/compress-pdfs","last_synced_at":"2025-10-30T12:30:23.660Z","repository":{"id":58703620,"uuid":"379712105","full_name":"Josee9988/Compress-PDFs","owner":"Josee9988","description":"A python CLI script to 𝗰𝗼𝗺𝗽𝗿𝗲𝘀𝘀 📦 all the 𝗣𝗗𝗙 files 𝗿𝗲𝗰𝘂𝗿𝘀𝗶𝘃𝗲𝗹𝘆 in a directory using the iLovePDF technology 🥰","archived":false,"fork":false,"pushed_at":"2021-11-26T08:33:50.000Z","size":47,"stargazers_count":13,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T08:31:46.927Z","etag":null,"topics":["compress","compress-files","compress-pdf","compressed","compression","compressor","compressors","pdf","pdf-compression","pdf-converter","pdf-document-processor","pdf-files","python","python-3","python-compressing","python-pdf","python3","python3-script","python3-scripts","size-reduction"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Josee9988.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null},"funding":{"github":"Josee9988","custom":["https://www.paypal.me/josee9988"]}},"created_at":"2021-06-23T19:41:38.000Z","updated_at":"2024-11-26T15:57:20.000Z","dependencies_parsed_at":"2022-09-06T14:40:35.348Z","dependency_job_id":null,"html_url":"https://github.com/Josee9988/Compress-PDFs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"Josee9988/project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Josee9988%2FCompress-PDFs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Josee9988%2FCompress-PDFs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Josee9988%2FCompress-PDFs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Josee9988%2FCompress-PDFs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Josee9988","download_url":"https://codeload.github.com/Josee9988/Compress-PDFs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238961202,"owners_count":19559439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compress","compress-files","compress-pdf","compressed","compression","compressor","compressors","pdf","pdf-compression","pdf-converter","pdf-document-processor","pdf-files","python","python-3","python-compressing","python-pdf","python3","python3-script","python3-scripts","size-reduction"],"created_at":"2024-10-12T08:09:15.412Z","updated_at":"2025-10-30T12:30:18.313Z","avatar_url":"https://github.com/Josee9988.png","language":"Python","funding_links":["https://github.com/sponsors/Josee9988","https://www.paypal.me/josee9988"],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD032 MD033--\u003e\n# 📦 **Josee9988/Compress-PDFs**\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Josee9988/Compress-PDFs/issues\"\u003e\n    \u003cimg alt=\"Issues\" src=\"https://img.shields.io/github/issues/Josee9988/Compress-PDFs?color=0088ff\u0026style=for-the-badge\u0026logo=github\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Josee9988/Compress-PDFs/pulls\"\u003e\n    \u003cimg alt=\"GitHub pull requests\" src=\"https://img.shields.io/github/issues-pr/Josee9988/Compress-PDFs?color=0088ff\u0026style=for-the-badge\u0026logo=github\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n⚠️This project is not fully finished or tester, it might cause some errors with in certain situations. Please, do a backup of the folders you want to compress before using this script.⚠️\n\n---\n\n## 🤔 **About the project**\n\n* A CLI tool to compress 📦 all PDFs recursively in a directory.\n\n---\n\n## ⚡ **Installation**\n\n1. Clone the repository and `cd` into it\n\n    ```bash\n    git clone git@github.com:Josee9988/Compress-PDFs.git \u0026\u0026 cd Compress-PDFs\n    ```\n\n2. *Install pip3*\n\n    ```bash\n    sudo apt install python3-pip\n    # verify it with pip3 --version\n    ```\n\n3. Instal the ilovepdf dependency\n\n    ```bash\n    pip3 install pylovepdf\n    ```\n\n4. Make the script executable from anywhere\n\n    ```bash\n    bash MAKE_SCRIPT_GLOBAL.sh\n    ```\n\n5. Rename `.env.example` to `.env`.\n\n    ```bash\n    mv -v .env.example .env # rename to .env\n    ```\n\n6. Add your [IlovePDF](https://developer.ilovepdf.com/) public key\n\n    * Modify the `.env` file add update the **`PUBLIC_KEY`** variable with your public key from [the IlovePDF developer's site](https://developer.ilovepdf.com/)\n\n7. Run it ;)\n\n    ```bash\n    compress.py /RELATIVE/OR/ABSOLUTE/PATH/TO/YOUR/DIR/\n    ```\n\n---\n\n## 🚀 **Usage**\n\n* After running the script `MAKE_SCRIPT_GLOBAL.sh` you can call the script from anywhere in your system with: `compress.py \u003cpath\u003e`\n\n* The script receives only one argument and it is the path of the directory that will be recursively compressed. All the subfolders will be looked up to compress all the pdfs inside the passed directory as an argument.\n\n* Script profile\n\n  ```bash\n  compress.py \u003cDirectory path\u003e\n  ```\n\n* Some examples of usage\n\n  1. Using an absolute path\n\n      ```bash\n      compress.py /home/username/Documents/MyFolder\n      ```\n\n  2. Using a relative path\n\n      ```bash\n      compress.py .\n      ```\n\n      ```bash\n      compress.py /dirFromWhereIAm/whatever/\n      ```\n\n---\n\n## 🌲 **Project tree**\n\n```bash\n.\n├── compress.py\n├── .env\n├── .github\n│   ├── CODE_OF_CONDUCT.md\n│   ├── CODEOWNERS\n│   ├── config.yml\n│   ├── CONTRIBUTING.md\n│   ├── FUNDING.yml\n│   ├── issue_label_bot.yaml\n│   ├── ISSUE_TEMPLATE\n│   │   ├── 1-bug-report.md\n│   │   ├── 2-failing-test.md\n│   │   ├── 3-docs-bug.md\n│   │   ├── 4-feature-request.md\n│   │   ├── 5-enhancement-request.md\n│   │   ├── 6-security-report.md\n│   │   ├── 7-question-support.md\n│   │   └── config.yml\n│   ├── ISSUE_TEMPLATE.md\n│   ├── pull_request_template.md\n│   ├── SECURITY.md\n│   ├── settings.yml\n│   └── SUPPORT.md\n├── .gitignore\n├── LICENSE\n├── MAKE_SCRIPT_GLOBAL.sh\n└── README.md\n\n2 directories, 25 files\n```\n\n---\n\n## 📝 **Additional notes**\n\n* The compressed PDF's will automatically replace your old and uncompressed ones.\n* In case an error happens because there are multiple pdfs with the same name or simply the program doesn't know how to replace them, an error will be prompt and you will have to manually move the compressed pdf (which will be in the directory passed as an argument) to the desired directory.\n* The cloned repository should not be  removed as it contains the symbolic link which is globally executable. You can manually move the file and the .env file to your /bin/ folder if you wish.\n\n---\n\nCompress-PDFs was generated from *[Josee9988/project-template](https://github.com/Josee9988/project-template)* 📚\n\n---\n\n## 🕵️ Extra recommendations\n\n* Always check the console output to check if any error happened and if so, you will have to manually move the non-moved compressed file to its location.\n\n* Also, always perform a copy of the folder before using the script as it will remove the old PDFs, and it might cause some data loss if an error occurs.\n\n---\n\n## 🎉 Was the pdf compressor helpful? Help us raise these numbers up\n\n[![Github followers](https://img.shields.io/github/followers/Josee9988.svg?style=social)](https://github.com/Josee9988)\n[![Github stars](https://img.shields.io/github/stars/Josee9988/Compress-PDFs.svg?style=social)](https://github.com/Josee9988/Compress-PDFs/stargazers)\n[![Github watchers](https://img.shields.io/github/watchers/Josee9988/Compress-PDFs.svg?style=social)](https://github.com/Josee9988/Compress-PDFs/watchers)\n[![Github forks](https://img.shields.io/github/forks/Josee9988/Compress-PDFs.svg?style=social)](https://github.com/Josee9988/Compress-PDFs/network/members)\n[![Sponsor](https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=github-sponsors\u0026color=red\u0026style=social)](https://github.com/sponsors/Josee9988)\n\nEnjoy! 😃\n\n---\n\n## ⚖️📝 **License**\n\nSee the license in the '**[LICENSE](LICENSE)**' file.\n\n---\n\n_Made with a lot of ❤️❤️ by **[@Josee9988](https://github.com/Josee9988)**_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosee9988%2Fcompress-pdfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosee9988%2Fcompress-pdfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosee9988%2Fcompress-pdfs/lists"}