freeplane module
- class freeplane.Mindmap(path='', mtype='freeplane', version='1.3.0', _id='', log_level='')
Bases:
objectrepresentation of Freeplane mindmap file as a container for nodes. access styles and other general features from here.
- add_style(name='', settings={})
This functions adds a style to a mindmap
- classmethod create_node(core='', link='', id='', style='', modified='', created='')
- classmethod create_node_id(mindmap=None)
create a valid node id. this node id is incremented automatically, whenever a new XML node is created. even if it is discarded later. the node id, here consists of three parts:
the id token “ID_” which is used for all nodes directly created within freeplane editor
and kind of session seed which is the current date
and a standard 4-digit integer value constantly incremented
- find_nodes(core='', link='', id='', attrib='', details='', notes='', icon='', exact=False, caseinsensitive=False, keep_link_specials=False)
- classmethod get_num_of_maps()
return the number of maps already created within the current session
- Returns:
integer
- property rootnode
- save(strPath, encoding='')
- property styles
- test()
- class freeplane.Node(node, mindmap)
Bases:
objectrepresentation of Freeplane node elements found within a mindmap. all the node-related features can be accessed from here.
- add_arrowlink(node=None, style='', shape='', color='', width='', transparency='', dash='', fontsize='', font='', startinclination='', endinclination='', startarrow='NONE', endarrow='DEFAULT')
draw an arrow link from the current node to the given one.
the arrow starts at the host object and extends to an arbitrary node. it’s appearance can be configured using the following parameters:
- Parameters:
node (freeplane.Node) – the node object an arrow is to be drawn to
shape (string) – the shape of the arrow (e.g. “CUBIC_CURVE”)
color (string) – the color of the arrow (e.g. “#FF0000” for red)
transparency (string) – the transparency of the arrow over the background (e.g. “80” for 80%)
- add_attribute(key='', value='')
This functions adds an attribute to a node
- add_child(core='', link='', id='', pos=-1, style='')
This functions adds a Freeplane-Node as a child to this Node. Further more a XML-node ist added to the XML-Tree
- add_icon(icon='')
This functions adds a Freeplane-Icon to a node
- add_sibling(core='', link='', id='', pos=-1, style=None)
This functions adds a Freeplane-Node as a Sibling. Further more a XML-node ist added to the XML-Tree at the corresponding position
- property arrowlinked
get list of nodes connecting to the node (incoming arrowlinks)
- Returns:
list of Node elements
- property arrowlinks
get list of nodes connected via outgoing arrowlinks
- Returns:
list of Node elements
- attach(attached_node=None, pos=-1)
This functions appends an existing but previously detached Freeplane-Node as a child to this node object.
- property attributes
- property children
- property comment
- property corelink
- property creationdate
- del_arrowlink(ident=0)
remove arrowlink from node
- Parameters:
ident (Node - the target node reference itself int - the index of target node according to the return of the arrowlinks method str - the node id of the target node to which the connection is to be removed) – identifier for node to which the arrowlink connection is to be removed
- Returns:
True - if the desired coonnection was removed False - if target node could not be found
- del_icon(icon='')
This functions removes a Freeplane-Icon from a node
- property details
- find_children(core='', link='', id='', attrib='', details='', notes='', icon='', exact=False, caseinsensitive=False, keep_link_specials=False)
- find_nodes(core='', link='', id='', attrib='', details='', notes='', icon='', exact=False, caseinsensitive=False, find_in_self=False, keep_link_specials=False)
- property follow_internal_hyperlink
- getSubText(token='')
- get_child_by_index(idx=0)
- get_indexchain_until(node)
determine the list of index values which have to be used in order to find the given node. the process is started from the self object and continued until the given node was found. the actual implementation works from backwards. starting at the given node and determining its parents until the base node (self) was found. then reversing the list order.
- property has_children
- property has_internal_hyperlink
- property hyperlink
- property icons
- property id
- property imagepath
- property imagesize
- property index
- property is_comment
- is_descendant_of(node)
determine if the current node object has a direct relational connection to a given node element. so, if the current node object is a child, grand-child, … of that given node element.
- property is_detached_head
check if node is the head node of a detached branch.
- property is_detached_node
check if node is belonging to a detached branch.
- property is_map_node
check if node is belonging to a map, but not being the root node.
- property is_root_node
check if node is the map’s root node.
- property is_rootnode
- property modificationdate
- property next
- property notes
get the value of the node’s notes attribute.
- Returns:
the plaintext value of the notes attribute (preserving newlines)
- Return type:
string
- property parent
- property plaintext
- property previous
- remove()
This functions removes the current Freeplane node from a branch
- set_attribute(key='', value='')
This functions sets an attribute for a node
- set_image(link='', size='1', modified='')
- property style