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.1.tar.gz (16.2 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.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: py_xmind16-0.1.1.tar.gz
  • Upload date:
  • Size: 16.2 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.1.tar.gz
Algorithm Hash digest
SHA256 5c96c25d4e92f006cd08b5574afcea854b7d021c782f5d38b4403337936450aa
MD5 9d5a6ceceab0ad837c9a45bbaff23d83
BLAKE2b-256 652f3bd3d19cc6f64a7a8f59bb50556e22ded626e3f5bfc0b92b73ee2cd376a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: py_xmind16-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2196144a174e32e50f3526166faff05e02108e0736c67c3a9ad15d612001346b
MD5 ea5688fb08cec1816d8198d9fc4e034a
BLAKE2b-256 cb4031196b83cf15ed92bbff2f364870dec52da8a6fda777806c0e4906c8d060

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