A tool to convert PDF files to Freeplane mind maps using OpenAI
Project description
PDF to Freeplane Mind Map Converter
A Python tool that converts PDF documents into Freeplane mind maps using OpenAI. This allows you to automatically generate structured mind maps from PDF documents.
You can read about how it got written using AI on medium. That's a friend link so you can read it even if you're not a subscriber.
Installation
This project requires Python and should be run in a virtual environment:
# Create and activate virtual environment in the directory of your choice
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
pip install freeplane-and-yaml
You'll need to set up your OpenAI API key in a .env file or as an environment variable:
# Create a .env file in your project directory
echo "OPENAI_API_KEY=your_api_key_here" > .env
Usage
Converting PDF Documents to Mind Maps
To convert a PDF document to a Freeplane mind map:
# Convert a PDF file to a mind map
pdf2mindmap path/to/document.pdf output_directory
# Use a specific OpenAI model (default is gpt-4o-mini)
pdf2mindmap path/to/document.pdf output_directory --model gpt-4-turbo
# Also save the extracted text
pdf2mindmap path/to/document.pdf output_directory --save-text
The tool performs these steps:
- Extracts text from the PDF using PyMuPDF4LLM (preserving structure as markdown)
- Processes the text with OpenAI to generate a structured mind map in YAML format
- Converts the YAML to a Freeplane mind map (.mm file)
- Saves all files in the output directory
This is useful for:
- Summarizing academic papers
- Converting product requirements documents (PRDs)
- Creating structured summaries of technical documentation
- Organizing research notes or book content
The generated .mm file can be opened in Freeplane. When you first open the file, Freeplane will show this warning dialog because the file wasn't created by Freeplane itself:
This is normal and expected — click OK to load the mind map.
Here's an example of how the output looks:
Features
- Converts PDF documents to Freeplane mind maps using OpenAI
- Uses PyMuPDF4LLM for high-quality text extraction from PDFs
- Creates hierarchical mind maps with node titles and notes
- Automatically alternates between right and left positions for top-level nodes
- Generates unique IDs for each node
- Produces clean, well-structured YAML as an intermediate format
- Supports different OpenAI models (default is gpt-4o-mini)
License
Apologies to readers from the USA. This README uses UK spelling.
This project is licensed under the MIT Licence — see the LICENCE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file freeplane-and-yaml-0.3.0.tar.gz.
File metadata
- Download URL: freeplane-and-yaml-0.3.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ccf840b6f152f477fcd84ac2c9f67ed1ad7843be142fc2738a7ae9597035623
|
|
| MD5 |
9efc631d42fd8238dfc77aeee40a715b
|
|
| BLAKE2b-256 |
6aad225e78be0c839d205aac1cb9a702bdc270a97468d2c9ad6d5011a839f327
|
File details
Details for the file freeplane_and_yaml-0.3.0-py3-none-any.whl.
File metadata
- Download URL: freeplane_and_yaml-0.3.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a57b4d197e0e0a94185eabaebde95defcb92001863cb1dc41bddb48f40192c4c
|
|
| MD5 |
d93509686dd06def47acd9f3dfd6198c
|
|
| BLAKE2b-256 |
6ab16db93231f04d6065b5e2da9fc629f676c9ca51609a541c3ab5d258cfadd8
|