Skip to main content

libclamav-py is a Python library that provides a seamless interface to the ClamAV antivirus engine via libClamAV. This wrapper directly calls the C API of Libclamav

Project description

libclamav-py

test PyPI PyPI - Downloads

libclamav-py is a Python wrapper for the ClamAV library, providing an interface to ClamAV's virus scanning capabilities.

Features

  • Directly invokes the C API of libclamav, so the clamd daemon doesn't need to be running on your machine
  • Lambda Layer which libclamav is binded (TODO)

Installation

To install libclamav-py, use pip:

pip install libclamav-py

Usage

Here is a basic example of how to use libclamav-py:

from libclamav_py.clamav import Client

# Initialize the libclamav engine with the default setting
client = Client(libclamav_path="/lib/libclamav.so")

# Or libclamav client can be initialized from clamd.conf
client = Client.from_clamd_conf(clamd_conf_path="/etc/clamd.conf", libclamav_path="/lib/libclamav.so")
# Load virus definitions
client.load_db()

# Compile engine
client.compile_engine()

# Scan a file
result = client.scan_file('/path/to/file')
if result:
    print(f"Virus detected: {result}")
else:
    print("No virus detected")

License

This project is licensed under the GPL-2.0 License. See the LICENSE file for details.

Acknowledgements

  • ClamAV for the virus scanning engine

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libclamav_py-0.2.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libclamav_py-0.2.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file libclamav_py-0.2.0.tar.gz.

File metadata

  • Download URL: libclamav_py-0.2.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for libclamav_py-0.2.0.tar.gz
Algorithm Hash digest
SHA256 85b347bb9e82a29096dd4fc1795377dff43ee46ae2289576cacbb0dd37b732ca
MD5 06e3511f0dbbefd47270312ada44ae18
BLAKE2b-256 069240d85c6ca1cb96826e7af2f5c369e1523f6ee2285a01d6c78f2b32f0ac3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for libclamav_py-0.2.0.tar.gz:

Publisher: release.yaml on tkasuz/libclamav-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libclamav_py-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: libclamav_py-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for libclamav_py-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8d8140dcc205d730c28f1d4e45a2ff7ce46ac2942ee1873a3475cd79da559a2
MD5 2eeb2b50e2f60b84c033ee29c9d52b1e
BLAKE2b-256 d07effeee5cca223d099c64b80455fba0a78a5eec45c35f614ce4672cbd07e02

See more details on using hashes here.

Provenance

The following attestation bundles were made for libclamav_py-0.2.0-py3-none-any.whl:

Publisher: release.yaml on tkasuz/libclamav-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page