Skip to main content

aioclamd

This package is an asynchronous version of the pleasant package python-clamd. It has the same external API, only all methods are coroutines and all communication is handled asynchronously using the asyncio framework.

The ClamdAsyncClient connects to a ClamAV antivirus instance and scans files and data for malicious threats. This package does not bundle ClamAV in any way, so a running instance of the clamd deamon is required.

Installation

pip install aioclamd

Usage

To scan a file (on the system where ClamAV is installed):

import asyncio

from aioclamd import ClamdAsyncClient

async def main(host, port):
    clamd = ClamdAsyncClient(host, port)
    print(await clamd.scan('/etc/clamav/clamd.conf'))

asyncio.run(main("127.0.0.1", 3310))

# Output:
# {'/etc/clamav/clamd.conf': ('OK', None)}

To scan a data stream:

import asyncio
import base64
from io import BytesIO

from aioclamd import ClamdAsyncClient

EICAR = BytesIO(
    base64.b64decode(
        b"WDVPIVAlQEFQWzRcUFpYNTQoUF4pN0NDKTd9JEVJQ0FSLVNU"
        b"QU5EQVJELUFOVElWSVJVUy1URVNU\nLUZJTEUhJEgrSCo=\n"
    )
)

async def main(host, port):
    clamd = ClamdAsyncClient(host, port)
    print(await clamd.instream(EICAR))

asyncio.run(main("127.0.0.1", 3310))

# Output:
# {'stream': ('FOUND', 'Win.Test.EICAR_HDB-1')}

Development

This repo ships a Dockerfile that bundles a clamd instance together with this package itself, for local development and integration testing:

docker build -t aioclamd-dev .
docker run --rm -p 127.0.0.1:3310:3310 aioclamd-dev

Only ever publish the port to loopback (127.0.0.1:3310:3310), never to 0.0.0.0 or a public interface. clamd's TCP protocol is unauthenticated and unencrypted by design (this is documented upstream ClamAV behavior, not specific to this image) -- treat it as safe only on loopback or within a fully trusted internal network, never across an untrusted network.

Alternatively, if you just want a bare clamd without the packaged client, the official upstream image works standalone:

docker run -p 3310:3310 --rm clamav/clamav

Metadata

Release files for aioclamd 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aioclamd 1.1.0
File Size Uploaded
aioclamd-1.1.0.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aioclamd 1.1.0
File Interpreter ABI Platform
aioclamd-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / aioclamd-1.1.0.tar.gz

Download URL aioclamd-1.1.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
56fc307da2bc372f764bf06c9d116bb89b40081321e4923bec180990ec9bbf95
BLAKE2b-256 checksum
How to use checksums
2517d7978e1ac067a5639528f0e5ae32acb418302599e7fa3785a3fbb3597ce2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / aioclamd-1.1.0-py3-none-any.whl

Download URL aioclamd-1.1.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49f2831d6d0fe7cd26da1e5eaa65fe32d8c5d0afdcaa9e86929ecbb801f57784
BLAKE2b-256 checksum
How to use checksums
cc89596b85aa615cf3fbf414d950294e77bc6b11a5e16e4c60c45b753635147e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page