skillfed

clamav-client

Python client library for the ClamAV antivirus.

clamav-client v0.7.2 145.1K downloads/30d#11,134 on PyPI16
Copyleft license GPL-2.0 Active released

What it is and what it does

clamav-client is a Python wrapper around the ClamAV antivirus engine's clamd daemon. It provides both a low-level client interface (via the clamd module) for direct daemon communication over TCP or Unix sockets, and a high-level scanner interface that abstracts over both clamd and the clamscan command-line tool. The package is a maintained fork of an earlier clamd library, adding type hints and testing against supported Python versions.

You use it when you need to integrate antivirus scanning into a Python application—typically to check uploaded files, monitor directories, or validate content before processing. The library handles the socket communication and protocol details, leaving you to focus on scan logic and result handling. It requires an external ClamAV installation with the clamd daemon running; it does not bundle or manage the antivirus engine itself.

Use it for:

  • Scan uploaded files in a web application before storing them to disk.
  • Integrate malware detection into a document processing pipeline.
  • Monitor a directory for infected files using clamd or clamscan.
  • Build a file quarantine system that checks content before restoration.
  • Validate attachments in an email or messaging system.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python client library for the ClamAV antivirus engine that connects to a running clamd daemon via TCP or Unix sockets, supporting file scanning on Windows, Linux, macOS, and other platforms.

Yes, if you need Python-based ClamAV integration and already run clamd. The package has low install friction, no runtime dependencies, active maintenance, and a copyleft license that is manageable in most contexts. No known vulnerabilities. The main constraint is the external clamd requirement—without a running ClamAV daemon, the library cannot function.

Install

clamav-client on PyPI

pip

pip install clamav-client

uv

uv add clamav-client

poetry

poetry add clamav-client

Installing clamav-client

Before you install

Low install friction with no runtime dependencies. The package is actively maintained with a recent release and supports current Python versions (3.9+). Repository shows steady activity.

License in practice

Licensed under GPL-2.0 (copyleft). Any software linking this library must comply with copyleft obligations—distribute source code and apply the same license to derivative works.

Quickstart

pip install clamav-client

from clamav_client import get_scanner

scanner = get_scanner()
result = scanner.scan_file('/path/to/file')

Requires a running clamd daemon instance (ClamAV antivirus service) accessible via TCP or Unix socket before the client can connect.

Verify before relying

  • Whether the package works with ClamAV versions other than those tested by maintainers.
  • Performance characteristics when scanning large files or directories.
  • Specific error handling and retry behavior for network failures to clamd.

Package facts

License GPL-2.0 (copyleft)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 162 days since the last release
Last repo commit
First released
Downloads 145,113/month — #11,134 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: clamav_client-0.7.2-py3-none-any.whl

Tags

clamav python clientclamd daemon connectorantivirus file scanner pythonclamav tcp unix socketmalware detection python library
antivirusmalware-detection

More Security packages