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.
Metadata
Release files for freeplane-and-yaml 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| freeplane-and-yaml-0.3.0.tar.gz | 11.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| freeplane_and_yaml-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.5 kB
Release files / freeplane-and-yaml-0.3.0.tar.gz
| Download URL | freeplane-and-yaml-0.3.0.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ccf840b6f152f477fcd84ac2c9f67ed1ad7843be142fc2738a7ae9597035623
|
|
BLAKE2b-256 checksum How to use checksums |
6aad225e78be0c839d205aac1cb9a702bdc270a97468d2c9ad6d5011a839f327
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / freeplane_and_yaml-0.3.0-py3-none-any.whl
| Download URL | freeplane_and_yaml-0.3.0-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a57b4d197e0e0a94185eabaebde95defcb92001863cb1dc41bddb48f40192c4c
|
|
BLAKE2b-256 checksum How to use checksums |
6ab16db93231f04d6065b5e2da9fc629f676c9ca51609a541c3ab5d258cfadd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|