pyClamd 0.3.4 发布,在Python程序调用ClamAV杀毒
jopen 11年前
pyClamad是一个Python模块用于在Python程序中使用来自病毒扫描程序ClamAV的clamd守护进程。
用法:
>>> import pyclamd >>> try: ... cd = pyclamd.ClamdUnixSocket() ... # test if server is reachable ... cd.ping() ... except pyclamd.ConnectionError: ... # if failed, test for network socket ... cd = pyclamd.ClamdNetworkSocket() ... try: ... cd.ping() ... except pyclamd.ConnectionError: ... raise ValueError('could not connect to clamd server either by unix or network socket') True >>> print(cd.version().split()[0]) ClamAV >>> print(cd.reload()) RELOADING >>> print(cd.stats().split()[0]) POOLS: >>> void = open('/tmp/EICAR','w').write(cd.EICAR()) >>> void = open('/tmp/NO_EICAR','w').write('no virus in this file') >>> cd.scan_file('/tmp/EICAR') {'/tmp/EICAR': ('FOUND', 'Eicar-Test-Signature')} >>> cd.scan_file('/tmp/NO_EICAR') is None True >>> cd.scan_stream(cd.EICAR()) {'stream': ('FOUND', 'Eicar-Test-Signature')}
发布说明: scan_stream中的Bug修复和其他错误的修正。现在ClamdUnixSocket能够从 /etc/clamav/clamd.conf取得Unix socket名称。
下载最新版本
pyClamd-0.3.4.tar.gz - 2013-11-17md5sum is 1725c5f3a22d4fdb04de25a978787d5b This version is compatible with python 3 (tested with 3.2.3) and python 2 (tested 2.7.3). The API for this new version is now object oriented. Usefull classes are ClamdNetworkSocket and ClamdUnixSocket. You can alway check documentation with :
pydoc pyclamd
之前的版本
This version provides old API (functions)pyclamd_0.2.2.py - 2010-07-12md5sum is f7b7a5bb2839bc3343735bc095f40aa9