Skip to main content

A tool to convert YAML files to Freeplane MM format

Project description

YAML to Freeplane Converter

A Python tool that converts YAML files into Freeplane mind maps. This allows you to generate mind maps programmatically from structured YAML data.

The YAML file can be created using Claude AI. A suitable prompt is given below.

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 direcoty of your choice
python -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate
pip install freeplane-and-yaml

Usage

Your YAML file should follow this schema. It includes an example.

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Mind Map Schema",
  "description": "Schema for Freeplane-compatible mind map YAML format",
  
  "definitions": {
    "node": {
      "type": "object",
      "required": ["title"],
      "properties": {
        "title": {
          "type": "string",
          "description": "The display text for the node"
        },
        "note": {
          "type": "string",
          "description": "Rich text note attached to the node"
        },
        "children": {
          "type": "object",
          "description": "Child nodes of this node",
          "patternProperties": {
            "^[a-zA-Z0-9_]+$": {
              "$ref": "#/definitions/node"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },

  "type": "object",
  "required": ["root"],
  "properties": {
    "root": {
      "allOf": [
        { "$ref": "#/definitions/node" },
        { 
          "required": ["children"],
          "description": "The root node must have at least one child"
        }
      ]
    }
  },
  "additionalProperties": false,

  "examples": [
    {
      "root": {
        "title": "Example Mind Map",
        "note": "This is the root node",
        "children": {
          "topic1": {
            "title": "First Topic",
            "note": "Note for first topic",
            "children": {
              "subtopic1": {
                "title": "Subtopic 1",
                "note": "Note for subtopic"
              }
            }
          },
          "topic2": {
            "title": "Second Topic",
            "note": "Note for second topic"
          }
        }
      }
    }
  ]
}

Converting YAML to Mind Map

To convert a YAML file to a Freeplane mind map:

# Convert YAML and store mind map in temp
convert data/marr.yaml temp

YAML Schema requirements explained

As the schema specifies, The YAML must conform to these rules:

  • Must have a root node with a title and at least one child
  • Each node requires a title
  • Notes are optional
  • Child node keys must be alphanumeric (including underscores)
  • No additional properties are allowed beyond title, note, and children

For full schema details, see above.

Converting Documents to YAML using Claude AI

You can use Claude Sonnet to automatically convert documents (PDFs, articles, specifications, etc.) into the required YAML format. Here's the workflow:

  1. Share your document and the schema (above) with Claude Sonnet.
  2. Use this prompt:
    I've uploaded a document and a schema file.  I'd like you to summarise the document as a yaml file following the schema that I uploaded.
    
  3. Claude will generate a YAML file that follows the schema
  4. Save Claude's output as a .yaml file
  5. Convert it to a mind map using this tool

This workflow is useful for:

  • Summarizing academic papers
  • Converting product requirements documents (PRDs)
  • Creating structured summaries of technical documentation
  • Organizing research notes

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:

Freeplane Warning Dialog

This is normal and expected — click OK to load the mind map.

Here's an example of how the output looks:

Example Mind Map

Features

  • Converts YAML structured data to Freeplane mind map format
  • Supports hierarchical node structure
  • Includes node titles and optional notes
  • Automatically alternates between right and left positions for top-level nodes
  • Generates unique IDs for each node
  • Validates input against JSON schema

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

freeplane-and-yaml-0.1.4.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

freeplane_and_yaml-0.1.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file freeplane-and-yaml-0.1.4.tar.gz.

File metadata

  • Download URL: freeplane-and-yaml-0.1.4.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for freeplane-and-yaml-0.1.4.tar.gz
Algorithm Hash digest
SHA256 01a7e96012c2ecd7eebe080dec55ee02625299901cd84813118c2af7b0c5bfca
MD5 c1241581c6c180b3e249f8f1dd5eb24d
BLAKE2b-256 5496ce8228d3ad6d8ddef76fc87ef08fa53a93960fb65eb501ef2d3071b68d2e

See more details on using hashes here.

File details

Details for the file freeplane_and_yaml-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for freeplane_and_yaml-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 187acf766f4e47efcf47e2d2fef7aa727d7b15dbeb1c55c320e5a01a2598e242
MD5 642e18d495e8ee2367ed5f85d66d8fc6
BLAKE2b-256 cfa5338c19314379eba5906c728506f3c1597e946c936cb778b9db93f8b0f5ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page