

[](https://virustotal.github.io/yara-x/docs/api/python)
[](https://pepy.tech/project/yara-x)
[](https://pepy.tech/project/yara-x)

The official Python library for [YARA-X](https://virustotal.github.io/yara-x).
Supports Python 3.9+ in Linux, MacOS and Windows.
```python
import yara_x
rules = yara_x.compile('''
rule test {
strings:
$a = "foobar"
condition:
$a
}''')
results = rules.scan(b"foobar")
assert results.matching_rules[0].identifier == "test"
assert results.matching_rules[0].patterns[0].identifier == "$a"
assert results.matching_rules[0].patterns[0].matches[0].offset == 0
assert results.matching_rules[0].patterns[0].matches[0].length == 6
```
For more information about how to use this library, please check
the [documentation](https://virustotal.github.io/yara-x/docs/api/python).
Raw data
{
"_id": null,
"home_page": "https://virustotal.github.io/yara-x",
"name": "yara-x",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "pattern-matching, cybersecurity, forensics, malware, yara",
"author": null,
"author_email": null,
"download_url": null,
"platform": null,
"description": "\n\n[](https://virustotal.github.io/yara-x/docs/api/python)\n[](https://pepy.tech/project/yara-x)\n[](https://pepy.tech/project/yara-x)\n\n\nThe official Python library for [YARA-X](https://virustotal.github.io/yara-x).\nSupports Python 3.9+ in Linux, MacOS and Windows.\n\n```python\nimport yara_x\n\nrules = yara_x.compile('''\n rule test { \n strings: \n $a = \"foobar\" \n condition: \n $a\n }''')\n\nresults = rules.scan(b\"foobar\")\n\nassert results.matching_rules[0].identifier == \"test\"\nassert results.matching_rules[0].patterns[0].identifier == \"$a\"\nassert results.matching_rules[0].patterns[0].matches[0].offset == 0\nassert results.matching_rules[0].patterns[0].matches[0].length == 6\n```\n\nFor more information about how to use this library, please check\nthe [documentation](https://virustotal.github.io/yara-x/docs/api/python).\n",
"bugtrack_url": null,
"license": null,
"summary": "Python bindings for YARA-X",
"version": "1.6.0",
"project_urls": {
"Homepage": "https://virustotal.github.io/yara-x",
"repository": "https://github.com/VirusTotal/yara-x.git"
},
"split_keywords": [
"pattern-matching",
" cybersecurity",
" forensics",
" malware",
" yara"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7800c874f381979e7a0c49398e04a97b29e269f7428dd685a03021207effe3af",
"md5": "886b1deeeecbe7f2e5628ef405818afe",
"sha256": "96cda624add5f3720799fc5fac4bb0e68c4b83bda3c5d2f72234de7d9a5d39a2"
},
"downloads": -1,
"filename": "yara_x-1.6.0-cp38-abi3-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "886b1deeeecbe7f2e5628ef405818afe",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 8232853,
"upload_time": "2025-09-05T07:35:55",
"upload_time_iso_8601": "2025-09-05T07:35:55.582620Z",
"url": "https://files.pythonhosted.org/packages/78/00/c874f381979e7a0c49398e04a97b29e269f7428dd685a03021207effe3af/yara_x-1.6.0-cp38-abi3-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9e21639e9c6a7070a09feb490b4c36fd6ed2291d916b0b1aa88e8a449a5e93a3",
"md5": "22173bbd02ddf5afe278c905a26cca8a",
"sha256": "44fc2ed49d60b3f5a8f7fb2efb02efaf759e2be9ab2345f4ff9e004db8f30e01"
},
"downloads": -1,
"filename": "yara_x-1.6.0-cp38-abi3-macosx_14_0_x86_64.whl",
"has_sig": false,
"md5_digest": "22173bbd02ddf5afe278c905a26cca8a",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 9029064,
"upload_time": "2025-09-05T07:35:57",
"upload_time_iso_8601": "2025-09-05T07:35:57.926586Z",
"url": "https://files.pythonhosted.org/packages/9e/21/639e9c6a7070a09feb490b4c36fd6ed2291d916b0b1aa88e8a449a5e93a3/yara_x-1.6.0-cp38-abi3-macosx_14_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "81341d0d4cf2b991499e328057b2bada7b78292577922d834cb189f058858fbd",
"md5": "3b9f1b4f9882be2392df74764df7fa62",
"sha256": "b3a5f1d006ba81ec5593c353168b18f1c52e03b7bbf956ca3926a696171647e2"
},
"downloads": -1,
"filename": "yara_x-1.6.0-cp38-abi3-manylinux_2_28_aarch64.whl",
"has_sig": false,
"md5_digest": "3b9f1b4f9882be2392df74764df7fa62",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 9135157,
"upload_time": "2025-09-05T07:35:59",
"upload_time_iso_8601": "2025-09-05T07:35:59.984294Z",
"url": "https://files.pythonhosted.org/packages/81/34/1d0d4cf2b991499e328057b2bada7b78292577922d834cb189f058858fbd/yara_x-1.6.0-cp38-abi3-manylinux_2_28_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "3a24dc40e25bd4dc67746cd0f4fe552745c3e00b4b4c3e53e191af7696697115",
"md5": "c13c6bcecebb7a8286eaba96e75d671e",
"sha256": "093999bfbc7a18a9f1abe6e2decbf6def2a228e228973026c61b476604e42b31"
},
"downloads": -1,
"filename": "yara_x-1.6.0-cp38-abi3-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "c13c6bcecebb7a8286eaba96e75d671e",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 9965579,
"upload_time": "2025-09-05T07:36:02",
"upload_time_iso_8601": "2025-09-05T07:36:02.118660Z",
"url": "https://files.pythonhosted.org/packages/3a/24/dc40e25bd4dc67746cd0f4fe552745c3e00b4b4c3e53e191af7696697115/yara_x-1.6.0-cp38-abi3-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "73084454ba36391f16424cd0a5456af83b2955cddd073a7b6b9e339b5af9d82b",
"md5": "065ab57c03fb53a8d56cca424b06e3fa",
"sha256": "b0334d2ab12abb1a709c96cdf8114be2412b6dad80ec02e61c99bd045654eee1"
},
"downloads": -1,
"filename": "yara_x-1.6.0-cp38-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "065ab57c03fb53a8d56cca424b06e3fa",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 7740537,
"upload_time": "2025-09-05T07:36:04",
"upload_time_iso_8601": "2025-09-05T07:36:04.067745Z",
"url": "https://files.pythonhosted.org/packages/73/08/4454ba36391f16424cd0a5456af83b2955cddd073a7b6b9e339b5af9d82b/yara_x-1.6.0-cp38-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6c409ca8dcbf0cd7f860c531e59cbc44c5cc90dd76cefa6eb2012e879b054f67",
"md5": "582d3404ac2a93139506a5aafe0062e8",
"sha256": "d92d4817047871c2bef4d7c6bde5f7dad88b958893dad78898aba422ac71acdd"
},
"downloads": -1,
"filename": "yara_x-1.6.0-pp310-pypy310_pp73-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "582d3404ac2a93139506a5aafe0062e8",
"packagetype": "bdist_wheel",
"python_version": "pp310",
"requires_python": ">=3.9",
"size": 8236033,
"upload_time": "2025-09-05T07:36:06",
"upload_time_iso_8601": "2025-09-05T07:36:06.067113Z",
"url": "https://files.pythonhosted.org/packages/6c/40/9ca8dcbf0cd7f860c531e59cbc44c5cc90dd76cefa6eb2012e879b054f67/yara_x-1.6.0-pp310-pypy310_pp73-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "11e85b591721a7a75f44da4eecbc0310dbadb106dd24e56653f9cfdd0aaa474c",
"md5": "9cb2fb08ac15848078cf73e87c5fcfc9",
"sha256": "bc6f9e64baa8d84c951c00fb1161da47e6c61f819f57663c19c312d19801a6d7"
},
"downloads": -1,
"filename": "yara_x-1.6.0-pp310-pypy310_pp73-macosx_14_0_x86_64.whl",
"has_sig": false,
"md5_digest": "9cb2fb08ac15848078cf73e87c5fcfc9",
"packagetype": "bdist_wheel",
"python_version": "pp310",
"requires_python": ">=3.9",
"size": 9029746,
"upload_time": "2025-09-05T07:36:08",
"upload_time_iso_8601": "2025-09-05T07:36:08.689315Z",
"url": "https://files.pythonhosted.org/packages/11/e8/5b591721a7a75f44da4eecbc0310dbadb106dd24e56653f9cfdd0aaa474c/yara_x-1.6.0-pp310-pypy310_pp73-macosx_14_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0a8cf623e82b26809ccf56eaa8ea1d523dfcb5d7adbfbbe0c6da7b70080eed96",
"md5": "4aaed757a3676a0fbd3d57840dbcf35a",
"sha256": "9ed8f394e54298ba6116598e2d5bf844e83fe5a84f3d964b839715420f3dd4f7"
},
"downloads": -1,
"filename": "yara_x-1.6.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl",
"has_sig": false,
"md5_digest": "4aaed757a3676a0fbd3d57840dbcf35a",
"packagetype": "bdist_wheel",
"python_version": "pp310",
"requires_python": ">=3.9",
"size": 9137493,
"upload_time": "2025-09-05T07:36:10",
"upload_time_iso_8601": "2025-09-05T07:36:10.602190Z",
"url": "https://files.pythonhosted.org/packages/0a/8c/f623e82b26809ccf56eaa8ea1d523dfcb5d7adbfbbe0c6da7b70080eed96/yara_x-1.6.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "299caf9cea6046f096caa0df74b5f7fa65ceebd4a3c602ef6339a43c7819dab3",
"md5": "2600249fdab3d59955914ff412de5e53",
"sha256": "cbb712cd01be0b301ffe1540d101eb3f04929438ebef9f9d77456e25cedaf9bc"
},
"downloads": -1,
"filename": "yara_x-1.6.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "2600249fdab3d59955914ff412de5e53",
"packagetype": "bdist_wheel",
"python_version": "pp310",
"requires_python": ">=3.9",
"size": 9970126,
"upload_time": "2025-09-05T07:36:12",
"upload_time_iso_8601": "2025-09-05T07:36:12.855975Z",
"url": "https://files.pythonhosted.org/packages/29/9c/af9cea6046f096caa0df74b5f7fa65ceebd4a3c602ef6339a43c7819dab3/yara_x-1.6.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "819b63149aaa6587cf49e451744bddeb359ce7621004f800a382d66c5f30fea3",
"md5": "b4ea57a9adaef40aaac05cfee6c72ca4",
"sha256": "e3d8b62759db907009ee2b7f3a5041cc0041bdc84600785bd9d3dcde43891544"
},
"downloads": -1,
"filename": "yara_x-1.6.0-pp310-pypy310_pp73-win_amd64.whl",
"has_sig": false,
"md5_digest": "b4ea57a9adaef40aaac05cfee6c72ca4",
"packagetype": "bdist_wheel",
"python_version": "pp310",
"requires_python": ">=3.9",
"size": 7741533,
"upload_time": "2025-09-05T07:36:15",
"upload_time_iso_8601": "2025-09-05T07:36:15.166588Z",
"url": "https://files.pythonhosted.org/packages/81/9b/63149aaa6587cf49e451744bddeb359ce7621004f800a382d66c5f30fea3/yara_x-1.6.0-pp310-pypy310_pp73-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-05 07:35:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "VirusTotal",
"github_project": "yara-x",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "yara-x"
}