Running Python

These instructions are going to assume you have never run a Python environment before and you are already working inside the cloned repository for the annotation extraction tool. All commands are designed to be executed from a Bash-compatible command line interface, such as Git Bash (Windows) or Terminal (macOS), within Visual Studio Code or any terminal emulator.

To begin:

✺

Step 1: Install Bash

1A. Windows: Download Git for Windows (which includes Git Bash):

  • Go to the Git for Windows website
  • Download the installer and run it
  • Follow the installation prompts, and make sure to select the option to use Git from the Windows Command Prompt

1B. Mac: Install Git Using Homebrew:

  • Open the Terminal and run the following command:
    brew install git
    

Step 2: Install Python

2A. Windows: Install Python 3:

  • Go to the Python official website
  • Download the latest version of Python (ensure to select the option to add Python to your PATH during installation).

2B. Mac: Install Python Using Homebrew:

  • Open the Terminal and run the following command:
    brew install python
    
  1. Verify Python installation:
    • Open your command line (or Git Bash on Windows, Terminal on macOS) and run:
      python --version
      
    • This should display the installed version of Python.

Step 3: Install Required Python Packages

  1. Install PyMuPDF:
    • In the command line, run the following command to install the PyMuPDF library:
      pip install PyMuPDF
      

Step 4: Organize Your Folders

  1. Place Your PDF File:
    • Place the PDF file from which you want to extract highlights and annotations into the annotation_extraction/A folder

Step 5: Run the Python Script

  1. Run the Python Script:
    • In the command line, navigate to the cloned repository directory and run:
      python script.py
      
    • Or simply go to script.py and press the play button on the top right corner of the screen in Visual Studio Code

✺


After following these steps your Python tool should run successfully, and you will find the extracted highlights in the annotation_extraction/B folder in two separate markdown files organized categorically and chronologically.