Catalog PyPI
Back to packageRELEASE DETAILS

1.1.0

PyPI

aioclamd

Asynchronous client for virus scanning with ClamAV

clamavscanningvirus
Published17 Sept 2026
Direct dependencies5
Transitive dependenciesNot calculated

README

Version 1.1.0 documentation

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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 5

Native requirements
5 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
black
Environment
{
  "extras": "",
  "marker": "extra == \"lint\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
black>=22.8.0; extra == "lint"runtime
flake8
Environment
{
  "extras": "",
  "marker": "extra == \"lint\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
flake8>=5.0.0; extra == "lint"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest>=7.1.3; extra == "test"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=0.19.0; extra == "test"runtime
pytest-cov
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest-cov>=3.0.0; extra == "test"runtime

Distribution files

2 collected
aioclamd-1.1.0-py3-none-any.whl

bdist_wheel · 6.46 KB · Python py3

Source file
aioclamd-1.1.0.tar.gz

sdist · 8.2 KB · Python source

Source file

Repository

PENDING
hbldh/aioclamd

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:43 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:c8dfa2ec6619f02768ec3be2361fc867a97ed1105d88dc63e3874bbd6e2404a7

Other collected versions

View all collected versions →