What it does
Privilege Log Generator scans a folder of documents and produces a formatted Excel privilege log. For each document it fills in the document number, filename, file type, date modified, and size, then uses Claude AI to write a one-line description of what the document is. Columns for privilege claimed and notes are left blank for your review.
The output is a spreadsheet you refine, not a finished filing. The AI descriptions give you a running start on a log that would otherwise take hours to build line by line.
Setup
-
Install Python 3 (once)
Download it free from python.org/downloads and run the installer. On Windows, check the box that says "Add Python to PATH" during installation.
-
Install the three libraries this tool needs
Open Terminal (Mac) or Command Prompt (Windows) and paste the command for your system:
Mac/usr/local/bin/pip3 install anthropic pypdf openpyxlWindowspip install anthropic pypdf openpyxl -
Get an Anthropic API key
Create a free account at console.anthropic.com and generate an API key. This is what lets the script send document text to Claude for description. Costs run about $0.001 per document — a 500-document log costs roughly fifty cents.
-
Download the script
Use the download button in the sidebar. Save privilege_log.py anywhere convenient.
Running the tool
-
Start the script
In Terminal or Command Prompt, navigate to the folder holding the script (type cd, a space, then drag the folder into the window and press Enter). Then run:
Macpython3 privilege_log.pyWindowspython privilege_log.py -
Answer the prompts
The script asks for the folder of documents to log, your API key, and where to save the output. Your key is used for this run only — it is never stored anywhere. When you paste it, don't be alarmed if nothing appears to type; that's normal for password-style input.
-
Let it work through the folder
You'll see progress as each document is read and described. A few hundred documents typically takes a few minutes.
-
Open the Excel file and review
Every document is a row: number, filename, type, date, size, AI description, and blank privilege-claimed and notes columns. Work through it, correct anything, and make your privilege designations.
Common errors
| Error | Fix |
|---|---|
| command not found: python3 | Python isn't installed (or isn't on your PATH). Install it from python.org — on Windows, re-run the installer and check "Add Python to PATH." |
| No module named 'anthropic' | The libraries didn't install. Re-run the install command from Setup step 2. On a Mac, use the full /usr/local/bin/pip3 path shown above. |
| authentication_error / 401 | The API key was mistyped or has been revoked. Copy a fresh key from console.anthropic.com and paste it carefully — no extra spaces. |
| rate_limit_error / 429 | You're sending documents faster than your account tier allows. Wait a minute and re-run; the script picks up where it can. Very large folders may need to be run in batches. |
| Description says "could not read" | That document is a scanned image with no text layer, or a format the script can't open. Log it by hand, or OCR the file first and re-run. |