Skip to main content

A Python library for creating and editing XMind 16 files

Project description

py-xmind16

A Python library for creating and editing XMind 16 files.

Features

  • Create XMind 16 compatible files
  • Read and modify existing XMind files
  • Support for topics, subtopics, notes, labels, and markers
  • Multiple sheets per workbook
  • Simple and intuitive API

Installation

pip install py-xmind16

Quick Start

Create a Simple Mind Map

from py_xmind16 import Workbook

# Create a new workbook
workbook = Workbook()

# Create a sheet
sheet = workbook.create_sheet("My Mind Map")

# Get the root topic and add content
root = sheet.get_root_topic()
root.title = "Project Ideas"

# Add subtopics
tech = root.add_subtopic("Technology")
tech.add_subtopic("AI/ML")
tech.add_subtopic("Web Development")

# Save the file
workbook.save("my_ideas.xmind")

Load and Edit an Existing File

from py_xmind16 import Workbook

# Load an existing file
workbook = Workbook.load("existing.xmind")

# Get the first sheet
sheet = workbook.get_sheet(0)
root = sheet.root_topic

# Modify content
root.title = "Updated Title"
root.add_subtopic("New Topic")

# Save changes
workbook.save("updated.xmind")

API Reference

Workbook

The main container for XMind content.

workbook = Workbook()
sheet = workbook.create_sheet("Sheet Title")
workbook.save("output.xmind")

Sheet

Represents a single mind map canvas.

sheet = workbook.create_sheet("My Sheet")
root = sheet.get_root_topic()

Topic

Represents a node in the mind map.

topic = root.add_subtopic("Topic Title")
topic.notes = "Detailed notes"
topic.add_label("important")
topic.add_marker("priority-1")

Examples

See the examples/ directory for more usage examples:

  • create_simple.py - Create a basic mind map
  • create_testcases.py - Create a test case structure
  • edit_existing.py - Edit an existing XMind file

Development

Setup

git clone https://github.com/example/py-xmind16.git
cd py-xmind16
pip install -e ".[dev]"

Run Tests

pytest

Run with Coverage

pytest --cov=py_xmind16

License

MIT License - see LICENSE 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

py_xmind16-0.1.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

py_xmind16-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file py_xmind16-0.1.0.tar.gz.

File metadata

  • Download URL: py_xmind16-0.1.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for py_xmind16-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7d8656d5c96c248d3e018087ed7ec956d0b8871b3b979862e1103bc189d87e29
MD5 cc74f1712b8d2cc4bb092ea56feebe8f
BLAKE2b-256 93d70fe72f7ff790561bdb4123c512a2febde35bba29d2fc018b0ca1caa76bc9

See more details on using hashes here.

File details

Details for the file py_xmind16-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: py_xmind16-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for py_xmind16-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de3215ba34995ae7f647404e110de283c24bac3ea943626ac3008adaaaa80889
MD5 add2abbc6a887a81b0839c0db32b1b46
BLAKE2b-256 a172938b1e992891be7e9e5484af6ed8a20bf71f144ccbfffb3b73a191d6d236

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