Skip to content

Janus-sama/clamd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

104 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clamd

About

python_clamd is a modernized Python wrapper for the ClamAV anti-virus engine.
It allows you to interact with a running clamd daemon on Linux, macOS, and Windows.

This project is a fork of python-clamd (last updated 2014), itself a fork of pyClamd v0.2.0 by Philippe Lagadec, which in turn extended pyClamd v0.1.1 by Alexandre Norman.

Why this fork?

  • Updated for Python 3.12+ compatibility (replaced deprecated pkg_resources with importlib.metadata).
  • Added type hints and annotations for better IDE/autocomplete and mypy support.
  • Actively maintained with patches and modernization.

Usage

Connect via Unix socket

import python_clamd
cd = python_clamd.ClamdUnixSocket()
cd.ping()         # 'PONG'
cd.version()      # 'ClamAV ...'
cd.reload()       # 'RELOADING'

Scan a file

open('/tmp/EICAR','wb').write(python_clamd.EICAR)
cd.scan('/tmp/EICAR')
# {'/tmp/EICAR': ('FOUND', 'Eicar-Test-Signature')}

Scan a stream

from io import BytesIO
cd.instream(BytesIO(python_clamd.EICAR))
# {'stream': ('FOUND', 'Eicar-Test-Signature')}

Installation

Python package

Coming soon via PyPI:

pip install python-clamd

ClamAV daemon

On Ubuntu:

sudo apt-get install clamav-daemon clamav-freshclam clamav-unofficial-sigs
sudo freshclam
sudo service clamav-daemon start

Supported Versions

  • Python 3.9 – 3.13
  • Python 2.x (dropped)

License

Released under the LGPL license.

Contributing

PRs and issues are welcome. This fork exists to keep ClamAV bindings usable on modern Python.

About

Clamd is a Python interface to the ClamAV daemon, enabling efficient virus scanning in your Python applications. This fork modernizes the project by replacing deprecated `pkg_resources` with `importlib.metadata`, adding typing support, and ensuring compatibility with Python 3.13+.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%