xmind数据文件读写库。

mekk.xmind的Python项目详细描述


mekk.xmindXMind思维导图文件的纯python处理程序。 它可用于:

  • 从头开始生成XMind思维导图(例如可视化 一些数据作为思维导图
  • 修改现有的^ {tt2} $文件,解析现有的^ {TT2} $文件并分析它们的内容。

示例

创建思维导图:

from mekk.xmind import XMindDocument

OUTPUT = "test.xmind"

xmind = XMindDocument.create(u"First sheet title", u"Root subject")
first_sheet = xmind.get_first_sheet()
root_topic = first_sheet.get_root_topic()

root_topic.add_subtopic(u"First item")
root_topic.add_subtopic(u"Second item")
t = root_topic.add_subtopic(u"Third item")
t.add_subtopic(u"Second level - 1")
t.add_subtopic(u"Second level - 2")
root_topic.add_subtopic(u"Detached topic", detached = True)
t.add_subtopic(u"Another detached", detached = True)
t.add_marker("flag-red")
root_topic.add_subtopic(u"Link example").set_link("http://mekk.waw.pl")
root_topic.add_subtopic(u"Attachment example").set_attachment(
    file("map_creator.py").read(), ".txt")
root_topic.add_subtopic(u"With note").set_note(u"""This is just some dummy note.""")

MARKER_CODE = "40g6170ftul9bo17p1r31nqk2a"
XMP = "../../py_mekk_nozbe2xmind/src/mekk/nozbe2xmind/NozbeIconsMarkerPackage.xmp"
root_topic.add_subtopic(u"With non-standard marker").add_marker(MARKER_CODE)

xmind.embed_markers(XMP)

xmind.save(OUTPUT)

#xmind.pretty_print()

print "Saved to", OUTPUT

注意:虽然上面的示例使用ascii,但完全支持unicode

解析思维导图:

from mekk.xmind import XMindDocument

xmind = XMindDocument.open("test.xmind")

sheet = xmind.get_first_sheet()
print "Sheet title: ", sheet.get_title()

root = sheet.get_root_topic()
print "Root title: ", root.get_title()
print "Root note: ", root.get_note()

for topic in root.get_subtopics():
    print "* ", topic.get_title()
    print "   label: ", topic.get_label()
    print "   link: ", topic.get_link()
    print "   markers: ", list(topic.get_markers())
    # topic.get_subtopics()

要修改,只需解析现有文档,找到要修改的项 根据需要更改它们,然后保存

开发

使用Mercurial跟踪代码存储库位于 http://bitbucket.org/Mekk/mekk.xmind/

使用同一个位置报告错误、建议改进并提供 补丁。

许可证

mekk.xmind是Article License 2.0和Mozilla Public的双重授权 许可证1.1.完整的许可证文本可在Artic-2.0.txt中找到 以及mpl-1.1.txt。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何获取所有链接并使用SeleniumWebDriver逐个单击这些链接   java中数组列表的arraylist移位元素   java如何存储具有不同类型参数的元素   java不能使用List<Future<?>>当从不同位置调用时,在方法参数中   java我应该如何修复代码以避免测试代码出错?   安卓 PreferenceFragment java。lang.RuntimeException   java在运行emulator时发现错误   java取消多个AsyncTask回调的有效方法是什么?如果中途满足条件,这些回调将在将来返回?   有没有办法在运行时将方法动态分配给Java类?   java如何将propertyfile与GlassFish一起使用   如何在PHP中使用bcrypt对密码进行哈希处理?   Java和UDP web服务器   java JPA允许EntityListeners执行JPA操作吗?   java执行do while语句时不会产生错误   java无法在edittext中显示数据库中的数据   java Tomcat中活动会话的数量   java在何处使用@SuppressWarnings(“requestfactory”)   netty连接中的java HornetQ异常