scanii.com的python包装器

PyScanii的Python项目详细描述


pyscanii

用于使用scanii.comapi的python模块。

安装/升级

$ pip install -U PyScanii

使用量

>>>fromPyScaniiimportPyScanii>>>pyscanii=PyScanii('SOMEAPIKEY','SECRET',verbose=True)# Verbose is good while integrating / debugging.# You can ping to see if things are set up properly.>>>pyscanii.ping(){u'message':u'pong',u'key':u'SOMEAPIKEY'}# There is a .test method that sends the EICAR test string.# WARNING: Costs a scan credit.>>>pyscanii.test()# It will populate the files list like any other scan.>>>pyscanii.files[0].infectedTrue# .scan() is the main method.# It can accept single strings or paths.# It can also accept a list or tuple of either of those things.>>>pyscanii.scan('X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*')# The files property contains a list of ScanFile instances:>>>pyscanii.files[0](563ef4b7836060b3bb9d0cba3e6a5f84)string.bin-Infected:True-Findings:[u'av.eicar-test-signature']>>>str(pyscanii.files[0])'{"content_length": 68, "infected": true, "name": "string.bin", "content_type": "text/plain", "checksum": "3395856ce81f2b7382dee72602f798b642f14140", "metadata": {}, "id": "563ef4b7836060b3bb9d0cba3e6a5f84", "findings": ["av.eicar-test-signature"], "creation_date": "2016-04-05T14:57:35.989Z"}'>>>pyscanii.files[0].infectedTrue>>>pyscanii.files[0].findings[u'av.eicar-test-signature']# You can also, of course, scan file paths:>>>pyscanii.scan('~/Desktop/IMG_0011.jpeg')>>>pyscanii.files[0].infectedFalse>>>pyscanii.files[0].findings[]# The last_file property is good when you've only scanned one file:>>>pyscanii.last_file(d0e6345ea2ceb9c1f260c8e249f933df)~/Desktop/IMG_0011.jpeg-Infected:False-Findings:[]>>>pyscanii.last_file.infectedFalse

更改

版本1.1.3-2016年4月6日

  • First production version.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
爪哇太阳报。安全验证器。ValidatorException:PKIX路径生成失败   java理解为什么在onDispatchTouchEvent()返回True后仍调用onClick()   java如何在资源包中使用JSF标记/如何在资源包中重写URL?   java什么是流控制异常的替代方案?   java使用Spring数据JPA/MongoDB交叉存储,一个查询可以跨越两个数据库吗?   Apache Sling/felix中的java OSGi slf4j日志记录   为什么当我们想要水平/垂直旋转矩阵时,我们要把这个项除以2?   尝试从外部网页接收JSON字符串时出现安卓 Java NullPointerException   java执行异常:从Callable调用方法时   java在jetty上以调试模式运行webapp,使用maven jetty插件在intellij中构建成功(应用程序应在调试模式下启动)   带有内存数据库的linux Java应用程序的构建时间太长   基于java的随机数单元测试算法   java类型javax。摆动JComponent无法解析   Google日历API和UI小部件Java   java tomcat没有突然和任意地响应   java无法使用jsoup在html中获取图像src   我无法让Java接受键盘输入字符串   java如何开始使用Bambol而不让部署永远继续?   java如何使用另一个类的actionPerformed方法删除一个类/组件中的按钮?   java JSON反序列化brakets{}中的一系列对象