Skip to content

Latest commit

 

History

History
105 lines (92 loc) · 3.06 KB

README.md

File metadata and controls

105 lines (92 loc) · 3.06 KB

PDF Renaming Utilities

This is a rough and hacky script that looks into the first page of PDF files to figure out what they are, and propose (or applies) a new name to them based on their content.

Supported PDFs

As this is aimed at my (@Flameeyes) own use, the list of supported PDFs pretty much focuses on bills and statements from UK, Italian, or Irish services and banks.

Usage

Set up the virtual environment as follows. Select the script for bash (Linux, OSX, etc.) or Windows PowerShell (especially for Visual Studio Code).

$ python -m venv venv
$ . venv/bin/activate  # bash
$ venv\Scripts\activate.ps1  # Windows PowerShell
(venv) $ pip install -e .

Once the venv is activated and the dependencies installed, you can run the script from the directory and point it to one or more PDFs:

# Only prints suggested renames
(venv) $ pdfrename unsortedbill.pdf

# Actually rename files
(venv) $ pdfrename --rename unsortedbill.pdf

# Verifies names
(venv) $ pdfrename --list-all "2155-10-28 - AWS - Neo - Bill.pdf"