最后我用了
python-graph
. 我最后也用了
argparse
构建一个命令行界面,从XML文档中提取一些基本信息,并以支持的格式构建图形图像
pydot
. 它叫
xmlearn
usage: xmlearn [-h] [-i INFILE] [-p PATH] {graph,dump,tags} ...
optional arguments:
-h, --help show this help message and exit
-i INFILE, --infile INFILE
The XML file to learn about. Defaults to stdin.
-p PATH, --path PATH An XPath to be applied to various actions.
Defaults to the root node.
subcommands:
{graph,dump,tags}
dump Dump xml data according to a set of rules.
tags Show information about tags.
graph Build a graph from the XML tags relationships.