If only life was this simple apt-get install python-clamav:

import pyclamav >>> ret=pyclamav.scanfile('/tmp/virus') >>> print ret (1, 'Worm.Sober.G') >>> ret=pyclamav.scanthis("Buffer to test blalblabla...") >>> print ret (0, '') >>> print pyclamav.get_numsig() 25474

Return value is a tupple (integer, string) where integer = 1: if a virus was found, string then contains the name of the virus = 0: no virus found, string is empty If anything went wrong, an exception ValueError is raised. String contains the error string (see clamav.h )