{"id":21564630,"url":"https://github.com/szajbus/clamex","last_synced_at":"2026-04-04T13:40:22.538Z","repository":{"id":57483115,"uuid":"158222587","full_name":"szajbus/clamex","owner":"szajbus","description":"Thin, error-friendly and testable wrapper for ClamAV","archived":false,"fork":false,"pushed_at":"2020-09-07T14:24:38.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T18:03:12.035Z","etag":null,"topics":["antivirus","clamav","elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szajbus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-19T12:54:17.000Z","updated_at":"2023-11-07T12:50:11.000Z","dependencies_parsed_at":"2022-08-27T21:02:22.800Z","dependency_job_id":null,"html_url":"https://github.com/szajbus/clamex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/szajbus/clamex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szajbus%2Fclamex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szajbus%2Fclamex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szajbus%2Fclamex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szajbus%2Fclamex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szajbus","download_url":"https://codeload.github.com/szajbus/clamex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szajbus%2Fclamex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004699,"owners_count":26083751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antivirus","clamav","elixir"],"created_at":"2024-11-24T10:16:37.359Z","updated_at":"2025-10-12T08:38:41.772Z","avatar_url":"https://github.com/szajbus.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clamex\n\n[![CircleCI](https://circleci.com/gh/szajbus/clamex/tree/master.svg?style=svg)](https://circleci.com/gh/szajbus/clamex/tree/master)\n\nClamex is a thin, error-friendly and testable wrapper for [ClamAV](https://www.clamav.net) written in elixir.\n\n## Installation\n\nThe package can be installed by adding `clamex` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:clamex, \"~\u003e 0.2.2\"}\n  ]\nend\n```\n\n## Requirements\n\nClamAV is not included in this package and must be installed separately. Please consult [ClamAV's official documentation](https://www.clamav.net/documents/installing-clamav) on how to install it on your system.\n\n## Configuration\n\nIt is recommended to have the ClamAV daemon (`clamd`) running in background and use `clamdscan` as a scanner, instead of `clamscan` which takes few seconds to initialize.\n\nThe following is the package's default configuration.\n\n```elixir\nconfig :clamex, scanner: Clamex.Scanner.Clamdscan\n```\n\nAlternatively, `Clamex.Scanner.Clamscan` or `Clamex.Scanner.Mock` (in tests, see below) can be used.\n\n## Usage\n\nCheck if file is infected:\n\n```elixir\niex\u003e Clamex.virus?(\"test/files/virus.txt\")\ntrue\n\niex\u003e Clamex.virus?(\"test/files/safe.txt\")\nfalse\n```\n\nCheck if file is safe:\n\n```elixir\niex\u003e Clamex.safe?(\"test/files/virus.txt\")\nfalse\n\niex\u003e Clamex.safe?(\"test/files/safe.txt\")\ntrue\n```\n\nNote that if the scanner encounters any errors, both `virus?` and `safe?` functions will quietly ignore them and return `false`. If you need to handle errors explicitly use the `scan` function directly.\n\nPerform the file scan:\n\n```elixir\niex\u003e Clamex.scan(\"test/files/virus.txt\")\n{:error, :virus_found}\n\niex\u003e Clamex.scan(\"test/files/safe.txt\")\n:ok\n```\n\nPlease check the documentation for other error reasons that may be returned by `scan`.\n\n## Documentation\n\nFull documentation can be found at [https://hexdocs.pm/clamex](https://hexdocs.pm/clamex).\n\n## Testing\n\nYou don't have to set ClamAV up in your test environment to test your application's behaviour with regard to file-scanning. You can simulate different scenarios: safe file, infected file, scanner not available, etc. using provided `Clamex.Scanner.Mock`.\n\nConfigure your test environment in `config/test.exs`:\n\n```elixir\nconfig :clamex, scanner: Clamex.Scanner.Mock\n```\n\nPlease check the [`Clamex.Scanner.Mock` documentation](https://hexdocs.pm/clamex/Clamex.Scanner.Mock.html#content) for example usage.\n\n## State of the library\n\n`Clamex` is still experimental software.\n\nSince it uses third-party scanners by calling external programs behind the scenes, things may go wrong. One of the design goals is to wrap this process in fault-tolerant way, so that the applications using `Clamex` are not susceptible to unpredicted error scenarios.\n\nThe most important aspect of the above is error-handling which is based on interpreting exit codes and parsing scanner's output.\n\nThere may still be error messages returned by `cladmscan` or `clamscan` that are currently not covered by `Clamex`. If you encounter such situations, feel free to report an issue or send a pull request.\n\n## License\n\nCopyright 2018 Michał Szajbe\n\nLicensed under the MIT license. For more information see the [LICENSE.txt](LICENSE.txt) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszajbus%2Fclamex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszajbus%2Fclamex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszajbus%2Fclamex/lists"}