Skip to main content

SmoothGlue Malware Scan

A Python package that provides a library for interfacing with malware scanning utilities, currently only ClamAV.

Overview

smoothglue_malware_scan simplifies the process of scanning files for malware. The core problem it solves is providing a stop-check for incoming files to be scanned and either continue through the desired workflow if clean of malware and to follow a rejection workflow if malware is found.

Key Features

  • Malware Scanning Wrappers: Easily interact with malware scanning utilities, currently only ClamAV.
  • Custom Exceptions: A set of custom exceptions to easily use if malware is found or to help debug.

Installation

Prerequisites

  • Python 3.9+

Install App From PyPI Package (Official Use)

  1. Before installing the package, make sure that there is a virtual environment set up:

    python -m venv venv
    source venv/bin/activate
    
  2. Use pip and the following command:

    pip install smoothglue_malware_scan
    

Usage

ClamAV

from smoothglue_malware_scan.scanners.clamav import ClamAVScanner
from smoothglue_malware_scan.exceptions import MalwareFoundException, ScanningServiceException

scanner = ClamAVScanner(clam_av_host="<clam av host name>", clam_av_port=3310)

with open("/tmp/mymalware.exe", "rb") as f:
    try:
        scanner.scan_stream(f.read())
    except ScanningServiceException as e:
        # Unable to connect to ClamAV server or ClamAV encountered an error scanning the file
        # e.reason may have additional context
        print("Error scan file")
    except MalwareFoundException as e:
        # ClamAV detected malware in the file. e.reason will be the type of malware detected
        print(f"Detected {e.reason} in file")
    else:
        print("No malware detected")

License

This project is licensed under a Proprietary License. See the LICENSE file for more details.

Release files for smoothglue_malware_scan 1.0.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 smoothglue_malware_scan 1.0.0
File Size Uploaded
smoothglue_malware_scan-1.0.0.tar.gz 6.2 kB Details

Built distribution (wheel)

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

Total release size: 11.9 kB

Release files / smoothglue_malware_scan-1.0.0.tar.gz

Download URL smoothglue_malware_scan-1.0.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9c76beca85e075ff0dbbb86ba16387296594d88680c89554ce6c754dc9bc136a
BLAKE2b-256 checksum
How to use checksums
40e34139dcd3ad893fb18a4747863f2fddb1f62ec0f32d684b67257c01086fe0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.11 Linux/4.18.0-553.51.1.el8_10.x86_64

Release files / smoothglue_malware_scan-1.0.0-py3-none-any.whl

Download URL smoothglue_malware_scan-1.0.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40fe543d5288a82cd643dc6dc04bd43bde7c7032b066dd02ccb1b892009c2789
BLAKE2b-256 checksum
How to use checksums
c3546016226cdc871ecc0f302f5da0daefeca1f39de6c7086eb72644ba2c61bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.11 Linux/4.18.0-553.51.1.el8_10.x86_64

Release history Release notifications | RSS feed

This release

1.0.0 This release

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