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.
- Antivirus Microservice Python Client
- Table of Contents
- Installation
- Usage
- API
- Configuration
- Error Handling
- Requirements
- Contributing
- License
- Support
- Created by
You can install this package via pip:
pip install antivirus-microserviceHere'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']}")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 ifokisFalse)
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')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.
- Python 3.6 or higher
- requests library
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open-sourced software licensed under the MIT license.
If you encounter any problems or have questions, please open an issue in the project repository.
Dimitry Ivanov 2@ivanoff.org.ua # curl -A cv ivanoff.org.ua
