Minifold是一个Python模块,用来与各种数据源(如CSV,LDAP,SQL,twitter等)交互,可对数据进行查询、合并和聚合,就像一个数据库操作一样。
Minifold要求最低Python3的支持。
Debian,Ubuntu安装.sudoapt-getupdatesudoapt-getinstallgitpython3python3-pycountrypython3-ldap3python3-setuptoolspython3-urllib3python3-tweepypython3-xmltodict安装minifoldmkdir~/gitcd~/gitgitclonehttps://github.com/nokia/minifoldcdminifoldsudopython3./setup.pyinstall测试python3>>>importminifold代码示例:直观查询
fromminifold.queryimportQuery,ACTION_GETq_institution=Query(action=ACTION_GET,object="institutions",attributes=[],filters=BinaryPredicate("institution_id","==",3))LDAP查询:
fromminifold.queryimportQuery,ACTION_GETq_ldap=Query(action=ACTION_GET,object="ou=users,dc=lincs,dc=fr",attributes=["uid","sn","givenName","departmentNumber"],filters=BinaryPredicate("sn","==","Mathieu"))
评论