download.py 文件源码

python
阅读 43 收藏 0 点赞 0 评论 0

项目:chat 作者: Decalogue 项目源码 文件源码
def match(*, label="NluCell", topic=""):
    """Match subgraph and download.
    """
    database = Database(password="train")
    if topic:
        cypher_info = "MATCH (n:{label}) WHERE n.topic='{topic}' RETURN n"
    else:
        cypher_info = "MATCH (n:{label}) RETURN n"
    filename = asksaveasfilename(filetypes=[('QA?excel??', '*.xls')])
    keys = ['name', 'content', 'topic', 'tag', 'keywords', 'api', 'behavior', 'url', \
    "hot", 'txt', 'img', 'chart', 'parameter']
    # keys = database.graph.find_one(label).keys()
    items = database.graph.run(cypher_info.format(label=label, topic=topic)).data()
    sheets = [{"name": label, "keys": keys, "items": items}]
    write_excel(filename=filename, sheets=sheets)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号