Skip to main content

Comprehensive CLI tool for pdf handling

Project description

rocketpdf

rocketpdf is python-based powerful CLI app that take basic pdf operations and elevates the user experience to the next level, allowing the user to not only convert and modify existing pdf files, but to chain operations and get a polished final result in a single swing!

This project "concatenates" efforts of different open-source solutions like docx2pdf, pdf2docx or typer and creates a powerful tool for quickly managing and modifying pdf files from the console.

Install

pip install rocketpdf

CLI

It is always recommended to open a terminal inside the directory you will be working.

Command Description
parsedoc Converts .docx file into .pdf file.
parsedocxs Converts all .docx files inside a directory into .pdf files.
parsepdf Converts .pdf file into .docx file.
merge Merges multiple .pdf files into a single.pdf file.
mergeall Merges all .pdf files inside a directory into a single .pdf file.
extract Extract a certain range of pages from a .pdf file.
compress Reduces the size of .pdf file.
parsedoc

parsedoc

Converts .docx file into .pdf file.

rocketpdf parsedoc sample.docx

-o: Customize file output name. Default: {filename}.pdf.

parsedocxs

parsedocxs

Converts all .docx files inside a directory into .pdf files.

rocketpdf parsedocxs C:\Users\user\samples

Default: {filename}.pdf.

parsepdf

parsepdf

Converts .pdf file into .docx file.

rocketpdf parsepdf sample.pdf

-o: Customize file output name. Default: {filename}.docx.

merge

merge

Merges multiple .pdf files into a single.pdf file.

rocketpdf merge sample.pdf sample2.pdf sample3.pdf

-o: Customize file output name. Default: merged.pdf.

mergeall

mergeall

Merges all .pdf files inside a directory into a single .pdf file.

rocketpdf mergeall C:\Users\user\samples

-o: Customize file output name. Default: {directory}-merged.pdf.

extract

extract

Extract a certain range of pages from a .pdf file.

Single page

rocketpdf extract sample.pdf 2

Multi-page

rocketpdf extract sample.pdf 2 4

-o: Customize file output name. Default: {filename} page(s) # - #

compress

compress

Reduces the size of .pdf file.

rocketpdf compress sample.pdf

-o: Customize file output name. Default: {filename}-compressed.pdf.

Command chaining

rocketpdf is a powerful tool that allows users to execute multiple commands in a single line by passing the binary result of a file onto the next operation.

Use cases

To chain multiple operations it is assumed that that the previous operations file result will be the input of the next command.

Let's download all monthly invoices into Invoices 2024 folder and compress the file for easier upload:

rocketpdf mergeall ".\Invoices 2024" compress -o Invoices_2024.pdf 

Let's convert my Resume.docx to .pdf and append my Cover_Letter.pdf

rocketpdf parsedoc Resume.docx merge Cover_Letter.pdf -o Job_Application.pdf 

Let's extract the first page of passsport.pdf and append my bank_deposit_info.pdf:

rocketpdf extract passport.pdf 1 merge bank_deposit_info.pdf -o payment_information.pdf
  • parsedoc is generally a starting command in a chain, so it cannot be used after any other operation.
  • mergeall is generally a starting command in a chain, so it cannot be used after any other operation.
  • parsedocxs is not chainable.
  • parsepdf is not chainable (for now).

Compatibility

rocketpdf is compatible with _Windows_ and _Mac_ systems with MS Word installed.

[!IMPORTANT] Unfortunately _Linux_ users cannot parse .docx files into .pdf files due to lack of libraries and support. The team (me) will be looking forward to bring a Linux-based solution in the near future.

Contributions

Contributions are welcome! If you would like to contribute to this project, please follow these steps:

  1. Fork the Repository
  1. Clone the Repository to your local machine:
  1. Create a Branch
  1. Make Your Changes.
  1. Commit (and Detail) Your Changes.
  1. Push your changes.
  1. Open a Pull Request from your branch to the main branch of this repository. Provide a clear and descriptive title and description for your PR.
  1. Code Review and Merge

Black was used as the code formatter for this project. Please ensure that your code is formatted with Black before submitting a pull request.

Install black via pip

pip install black
black {source_file_or_directory}...

Set as default formatter via VS Code extension

"[python]": {
   "editor.defaultFormatter": "ms-python.black-formatter",
   "editor.formatOnSave": true
 }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rocketpdf-0.1.5.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rocketpdf-0.1.5-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file rocketpdf-0.1.5.tar.gz.

File metadata

  • Download URL: rocketpdf-0.1.5.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.3 Windows/10

File hashes

Hashes for rocketpdf-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c3188f6142ff32a4a544063448bd73ace04d71bbbe1b4b6f917228d10883b60e
MD5 8665f0fffe64cf34d1db528a0a7a58c9
BLAKE2b-256 2d4ea2cb745e9188c5ab1a119120142f77ca8ee02f3e875c5c82618c51004b26

See more details on using hashes here.

File details

Details for the file rocketpdf-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: rocketpdf-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.3 Windows/10

File hashes

Hashes for rocketpdf-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 89f8cda9c94b6989e3dcf05bedea09a820625a9601ffb7c1d98cdb88cfda826f
MD5 3485c25c4264ffbf29ac782d50315bc7
BLAKE2b-256 249d57210c131843ee074cc41c47b65b67f4038945c003257add56f7a943da8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page