蟒蛇红林异步客户端
rf-client的Python项目详细描述
python red forester异步客户端
这是red forester api包装器的早期版本。
当前API限制:
- 忽略节点链接
待办事项:
- 完成节点API
- 局部地图加载
- 注释API
- 节点类型API
- 地图API
- 地图事件收听
- 源代码
使用示例
要使用wrapper,需要运行pythonevent_loop
。
asyncdeftask():asyncwithMindMap('map_id',('username','password_md5_hash'))asmm:# At this moment you can access map nodes, # map users and map types through mm object.# Can create and update nodes# mm.root is map root Node.# Node model has methods to find childs and ancestors Nodes.# mm object has methods to act with API.passloop=asyncio.get_event_loop()loop.run_until_complete(task())
思维导图用法:
MindMap(map_id:str,token:Tuple[str,str],# username (email) + md5 hashview_root_id=None,# id of root Node# temporary way to ignore node-links from outside of loading branchignore_out_of_branch=False,# session_id is identifier of user-session. Allows to detect you own events # (if you do events listening)session_id=None)
您还可以在没有上下文管理器的情况下实例化MindMap(...)
(with
)。
但您需要手动调用await mm.init()
和await mm.close()
。