No description
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| clean_casebook.py | ||
| README.md | ||
| requirements.txt | ||
Casebook Cleaner
Extracts casebook notes from a PDF and converts imported email HTML within those notes into plain text.
How it works
- Reads a PDF generated by a Casebook tool (likely LexisNexis/CLE exports)
- Skips the cover page and extracts only the "Casebook notes" section
- Splits the content into individual notes
- For notes marked as
Type: Imported email, converts embedded HTML into clean, readable plain text while preserving attachments - Outputs a single
.txtfile with all cleaned notes
Prerequisites
- Python 3.12+
- A Casebook PDF export (with imported email content)
Setting up the environment on Windows
Step 1: Install Python (if not already installed)
- Go to https://www.python.org/downloads/
- Download the latest Python installer
- Run it and check "Add python.exe to PATH" before clicking Install
Verify the installation:
python --version
Step 2: Create a virtual environment
Open PowerShell or Command Prompt and navigate to the project folder, then create a virtual environment:
cd path\to\casebook_clean
py -3.14 -m venv venv
Step 3: Activate the virtual environment
.\venv\Scripts\activate
You should see (venv) appear at the start of your command prompt.
Step 4: Install the dependencies
pip install -r requirements.txt
Running the script
Activate the virtual environment (see step 3 above), then run:
python clean_casebook.py path\to\your\casebook.pdf
By default, the output text file will be saved as <same filename>.txt in the same directory. To specify a custom output path:
python clean_casebook.py path\to\casebook.pdf -o output\notes.txt