antivirus-microservice


Nameantivirus-microservice JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/ivanoff/antivirus-microservice-python
SummaryA Python client for Antivirus Microservice
upload_time2024-08-11 19:11:38
maintainerNone
docs_urlNone
authorDimitry Ivanov
requires_python>=3.6
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![antivirus-microservice](./assets/logo2.png)

## Antivirus Microservice Python Client

This is a Python client for the free and fully functional [Antivirus Microservice Server](https://github.com/ivanoff/Antivirus-Microservice). It allows you to easily integrate virus scanning capabilities into your Python applications.

## Table of Contents

- [Antivirus Microservice Python Client](#antivirus-microservice-python-client)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Usage](#usage)
- [API](#api)
- [Configuration](#configuration)
- [Error Handling](#error-handling)
- [Requirements](#requirements)
- [Contributing](#contributing)
- [License](#license)
- [Support](#support)
- [Created by](#created-by)

## Installation

You can install this package via pip:

```bash
pip install antivirus-microservice
```

## Usage

Here's a basic example of how to use the Antivirus Microservice client:

```python
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 if `ok` is `False`)

## Configuration

When initializing the `AntivirusMicroservice` class, you can specify the URL of your Antivirus Microservice server. By default, it uses `http://localhost:3000`.

```python
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](https://opensource.org/licenses/MIT).

## Support

If you encounter any problems or have questions, please open an issue in the [project repository](https://github.com/ivanoff/antivirus-microservice-python).

## Created by

Dimitry Ivanov <2@ivanoff.org.ua> # curl -A cv ivanoff.org.ua



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ivanoff/antivirus-microservice-python",
    "name": "antivirus-microservice",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Dimitry Ivanov",
    "author_email": "2@ivanoff.org.ua",
    "download_url": "https://files.pythonhosted.org/packages/6c/d0/d444751aa7c9ce7da53b5a42cddb43ab55f8dac0696fbcb486b2933458ef/antivirus-microservice-0.1.1.tar.gz",
    "platform": null,
    "description": "![antivirus-microservice](./assets/logo2.png)\n\n## Antivirus Microservice Python Client\n\nThis is a Python client for the free and fully functional [Antivirus Microservice Server](https://github.com/ivanoff/Antivirus-Microservice). It allows you to easily integrate virus scanning capabilities into your Python applications.\n\n## Table of Contents\n\n- [Antivirus Microservice Python Client](#antivirus-microservice-python-client)\n- [Table of Contents](#table-of-contents)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n- [Configuration](#configuration)\n- [Error Handling](#error-handling)\n- [Requirements](#requirements)\n- [Contributing](#contributing)\n- [License](#license)\n- [Support](#support)\n- [Created by](#created-by)\n\n## Installation\n\nYou can install this package via pip:\n\n```bash\npip install antivirus-microservice\n```\n\n## Usage\n\nHere's a basic example of how to use the Antivirus Microservice client:\n\n```python\nfrom antivirus_microservice import AntivirusMicroservice\n\nantivirus = AntivirusMicroservice('http://localhost:3000')\nresult = antivirus.check_file('/path/to/your/file.txt')\n\nif result['ok']:\n    print(\"File is clean\")\nelse:\n    print(f\"File is infected: {result['viruses']}\")\n```\n\n## API\n\nThe `AntivirusMicroservice` class provides the following method:\n\n- `check_file(file_path)`: Scans the provided file for viruses. Returns a dictionary with:\n  - `ok`: boolean indicating whether the file is clean (`True`) or infected (`False`)\n  - `viruses`: a list of detected virus names (only present if `ok` is `False`)\n\n## Configuration\n\nWhen initializing the `AntivirusMicroservice` class, you can specify the URL of your Antivirus Microservice server. By default, it uses `http://localhost:3000`.\n\n```python\nantivirus = AntivirusMicroservice('http://your-custom-url:port')\n```\n\n## Error Handling\n\nThe client handles basic errors:\n- If there's an error communicating with the server, it returns `{'ok': False, 'viruses': ['Error checking file']}`.\n- The specific error message is printed to the console.\n\n## Requirements\n\n- Python 3.6 or higher\n- requests library\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n\n## Support\n\nIf you encounter any problems or have questions, please open an issue in the [project repository](https://github.com/ivanoff/antivirus-microservice-python).\n\n## Created by\n\nDimitry Ivanov <2@ivanoff.org.ua> # curl -A cv ivanoff.org.ua\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python client for Antivirus Microservice",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/ivanoff/antivirus-microservice-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cfc04929211eed0f47b7e6dda72cb1b886b7053f447a54b6b83433dea5e7e8a9",
                "md5": "9c19fe8ed0503a3d0b35ced379b0f4a6",
                "sha256": "0ffabb622d4fa82739846784dd5d230d9e0ae5acc031344f1c2f0c55efb8762f"
            },
            "downloads": -1,
            "filename": "antivirus_microservice-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9c19fe8ed0503a3d0b35ced379b0f4a6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 3259,
            "upload_time": "2024-08-11T19:11:36",
            "upload_time_iso_8601": "2024-08-11T19:11:36.562792Z",
            "url": "https://files.pythonhosted.org/packages/cf/c0/4929211eed0f47b7e6dda72cb1b886b7053f447a54b6b83433dea5e7e8a9/antivirus_microservice-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6cd0d444751aa7c9ce7da53b5a42cddb43ab55f8dac0696fbcb486b2933458ef",
                "md5": "f47aa441435cd9d722282cbc415e1a36",
                "sha256": "f52e169c059e4d5e237af13327a6ba18b9b021dfbf141429028da146d912b1bd"
            },
            "downloads": -1,
            "filename": "antivirus-microservice-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f47aa441435cd9d722282cbc415e1a36",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 2684,
            "upload_time": "2024-08-11T19:11:38",
            "upload_time_iso_8601": "2024-08-11T19:11:38.301548Z",
            "url": "https://files.pythonhosted.org/packages/6c/d0/d444751aa7c9ce7da53b5a42cddb43ab55f8dac0696fbcb486b2933458ef/antivirus-microservice-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-11 19:11:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ivanoff",
    "github_project": "antivirus-microservice-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "antivirus-microservice"
}
        
Elapsed time: 0.59495s