clamav-client
Python client library for the ClamAV antivirus.
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-clientuv
uv add clamav-clientpoetry
poetry add clamav-clientInstalling 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
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
clamdclamd is a Python interface to the ClamAV…
copyleft · top 5,000 on PyPI
cvdupdateDownloads and maintains a local ClamAV…
permissive · top 5,000 on PyPI
pyClamdpyClamd provides a Python interface to the…
copyleft · top 15,000 on PyPI
cartCaRT is a file format and Python library for…
permissive · top 15,000 on PyPI
pymemcacheA pure-Python memcached client implementing the…
permissive · top 5,000 on PyPI
pmd-pytcpA pure-Python TCP/IP stack (Ethernet through…
copyleft · top 15,000 on PyPI
openccu-loom-clientAsync Python REST and WebSocket client for the…
permissive · top 15,000 on PyPI
requests-unixsocket2Extends the requests library to make HTTP calls…
permissive · top 15,000 on PyPI
daemonizeDaemonize provides a Python library for…
permissive · top 15,000 on PyPI
ipfshttpclientA Python HTTP client library for interacting…
permissive · top 15,000 on PyPI