A Python client for Antivirus Microservice
Project description
Antivirus Microservice Python Client
This is a Python client for the free and fully functional Antivirus Microservice Server. It allows you to easily integrate virus scanning capabilities into your Python applications.
Table of Contents
- Antivirus Microservice Python Client
- Table of Contents
- Installation
- Usage
- API
- Configuration
- Error Handling
- Requirements
- Contributing
- License
- Support
- Created by
Installation
You can install this package via pip:
pip install antivirus-microservice
Usage
Here's a basic example of how to use the Antivirus Microservice client:
from antivirus_microservice import AntivirusMicroservice
antivirus = AntivirusMicroservice('http://localhost:3000')
result = antivirus.check_file('/path/to/your/file.txt')
if result['ok']:
print("File is clean")
else:
print(f"File is infected: {result['viruses']}")
API
The AntivirusMicroservice
class provides the following method:
check_file(file_path)
: Scans the provided file for viruses. Returns a dictionary with:ok
: boolean indicating whether the file is clean (True
) or infected (False
)viruses
: a list of detected virus names (only present ifok
isFalse
)
Configuration
When initializing the AntivirusMicroservice
class, you can specify the URL of your Antivirus Microservice server. By default, it uses http://localhost:3000
.
antivirus = AntivirusMicroservice('http://your-custom-url:port')
Error Handling
The client handles basic errors:
- If there's an error communicating with the server, it returns
{'ok': False, 'viruses': ['Error checking file']}
. - The specific error message is printed to the console.
Requirements
- Python 3.6 or higher
- requests library
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is open-sourced software licensed under the MIT license.
Support
If you encounter any problems or have questions, please open an issue in the project repository.
Created by
Dimitry Ivanov 2@ivanoff.org.ua # curl -A cv ivanoff.org.ua
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file antivirus-microservice-0.1.1.tar.gz
.
File metadata
- Download URL: antivirus-microservice-0.1.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f52e169c059e4d5e237af13327a6ba18b9b021dfbf141429028da146d912b1bd |
|
MD5 | f47aa441435cd9d722282cbc415e1a36 |
|
BLAKE2b-256 | 6cd0d444751aa7c9ce7da53b5a42cddb43ab55f8dac0696fbcb486b2933458ef |
File details
Details for the file antivirus_microservice-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: antivirus_microservice-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ffabb622d4fa82739846784dd5d230d9e0ae5acc031344f1c2f0c55efb8762f |
|
MD5 | 9c19fe8ed0503a3d0b35ced379b0f4a6 |
|
BLAKE2b-256 | cfc04929211eed0f47b7e6dda72cb1b886b7053f447a54b6b83433dea5e7e8a9 |