pyClamd 0.3.4 發布,在Python程序調用ClamAV殺毒
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
下載開發版本
svn checkout http://pyclamd.googlecode.com/svn/trunk/ pyclamd-read-only 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!