This script fetches all your ebook highlights from your Hoopla borrow history and exports them to a CSV file that's ready for import into Readwise.
Set the HOOPLA_API_TOKEN environment variable:
You need to get your API token from the Hoopla website. You can find it by inspecting the network requests in your browser's developer tools when you are logged in to your Hoopla account. Look for the Authorization header in the requests to the patron-api-gateway.hoopladigital.com endpoint. The value will be Bearer <YOUR_TOKEN>.
Then set the environment variable in your shell:
export HOOPLA_API_TOKEN="<YOUR_TOKEN>"Run the script:
uv run main.pyThe script will create a hoopla_highlights.csv file in the same directory with all your ebook highlights.