

[](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.8.1",
"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": "7513394594e2517d015a5a098337574af601cc0ed6f954df4e325087d3f4858e",
"md5": "7d2a22d6899836668581856a1cf86dfa",
"sha256": "dbb1fd289f24a05c113b8f0713d4750331cb9c39722d212fea108b8aa69c8594"
},
"downloads": -1,
"filename": "yara_x-1.8.1-cp38-abi3-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "7d2a22d6899836668581856a1cf86dfa",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 8402756,
"upload_time": "2025-10-07T14:42:57",
"upload_time_iso_8601": "2025-10-07T14:42:57.726915Z",
"url": "https://files.pythonhosted.org/packages/75/13/394594e2517d015a5a098337574af601cc0ed6f954df4e325087d3f4858e/yara_x-1.8.1-cp38-abi3-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a1159a943ba38845cc6c5565fb60e9a46dc68f4a0365b2ba82fd9b5b7a2012ed",
"md5": "05ea0dfdc814bdc905159530d9936632",
"sha256": "b41f4c4b9326905d584b38cf84d52037eb6864e70154844db4f59672107a5a1a"
},
"downloads": -1,
"filename": "yara_x-1.8.1-cp38-abi3-macosx_14_0_x86_64.whl",
"has_sig": false,
"md5_digest": "05ea0dfdc814bdc905159530d9936632",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 9174689,
"upload_time": "2025-10-07T14:43:00",
"upload_time_iso_8601": "2025-10-07T14:43:00.000539Z",
"url": "https://files.pythonhosted.org/packages/a1/15/9a943ba38845cc6c5565fb60e9a46dc68f4a0365b2ba82fd9b5b7a2012ed/yara_x-1.8.1-cp38-abi3-macosx_14_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6f36d3b08f68aaae6785637bd3e37e4607dcb41d9220e3785bfa1f94db2fd29a",
"md5": "929bc8bbc52f7d0492365e645b93f041",
"sha256": "bcee1686b937fd8d75df3faae354e45c64256561b384bdf97ff79be32770c7a8"
},
"downloads": -1,
"filename": "yara_x-1.8.1-cp38-abi3-manylinux_2_28_aarch64.whl",
"has_sig": false,
"md5_digest": "929bc8bbc52f7d0492365e645b93f041",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 9331503,
"upload_time": "2025-10-07T14:43:02",
"upload_time_iso_8601": "2025-10-07T14:43:02.257207Z",
"url": "https://files.pythonhosted.org/packages/6f/36/d3b08f68aaae6785637bd3e37e4607dcb41d9220e3785bfa1f94db2fd29a/yara_x-1.8.1-cp38-abi3-manylinux_2_28_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "18cddbf1e6c885e4509bb639ec9e45884a0c65ed958432af12dcffe13b256970",
"md5": "b663ac4759801621fb775b1e91217980",
"sha256": "c6936ac7a316ce86e78e570bca73724319c2daa33db147974adbe3c8e502f27a"
},
"downloads": -1,
"filename": "yara_x-1.8.1-cp38-abi3-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "b663ac4759801621fb775b1e91217980",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 9727253,
"upload_time": "2025-10-07T14:43:04",
"upload_time_iso_8601": "2025-10-07T14:43:04.041648Z",
"url": "https://files.pythonhosted.org/packages/18/cd/dbf1e6c885e4509bb639ec9e45884a0c65ed958432af12dcffe13b256970/yara_x-1.8.1-cp38-abi3-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ddc832707af5853629f5db5d5a06c2383a1695e2936378167a00b07f19c3ba06",
"md5": "d023a8d874cfa0fe4a33eb51aa09b13f",
"sha256": "25c3e4554ba3428968f1749004efaaf47a111f2ac7db51d08915f66140c7d53d"
},
"downloads": -1,
"filename": "yara_x-1.8.1-cp38-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "d023a8d874cfa0fe4a33eb51aa09b13f",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 7880428,
"upload_time": "2025-10-07T14:43:05",
"upload_time_iso_8601": "2025-10-07T14:43:05.792868Z",
"url": "https://files.pythonhosted.org/packages/dd/c8/32707af5853629f5db5d5a06c2383a1695e2936378167a00b07f19c3ba06/yara_x-1.8.1-cp38-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "997cdd8ae7ac0fac0a6c013502269862536031f845b89c08f87ada8b785426db",
"md5": "f9bfd072a233330540b34f9ad1507133",
"sha256": "3565c776476c71a15cd997463b52578c38b4c20aae538157baf070b83339d7b4"
},
"downloads": -1,
"filename": "yara_x-1.8.1-pp311-pypy311_pp73-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "f9bfd072a233330540b34f9ad1507133",
"packagetype": "bdist_wheel",
"python_version": "pp311",
"requires_python": ">=3.9",
"size": 8394178,
"upload_time": "2025-10-07T14:43:07",
"upload_time_iso_8601": "2025-10-07T14:43:07.361242Z",
"url": "https://files.pythonhosted.org/packages/99/7c/dd8ae7ac0fac0a6c013502269862536031f845b89c08f87ada8b785426db/yara_x-1.8.1-pp311-pypy311_pp73-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "51ecf6ada996e31de817c5909b71d75bea95535acdde48250f48f084ffac6899",
"md5": "9cbf95b25a677dc58d68ef9486228291",
"sha256": "b0fb608e107e92fb240cac8229160637c6219fe06811e113aca0cc7a85190e80"
},
"downloads": -1,
"filename": "yara_x-1.8.1-pp311-pypy311_pp73-macosx_14_0_x86_64.whl",
"has_sig": false,
"md5_digest": "9cbf95b25a677dc58d68ef9486228291",
"packagetype": "bdist_wheel",
"python_version": "pp311",
"requires_python": ">=3.9",
"size": 9171080,
"upload_time": "2025-10-07T14:43:09",
"upload_time_iso_8601": "2025-10-07T14:43:09.516666Z",
"url": "https://files.pythonhosted.org/packages/51/ec/f6ada996e31de817c5909b71d75bea95535acdde48250f48f084ffac6899/yara_x-1.8.1-pp311-pypy311_pp73-macosx_14_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6dae7cea2a8fc10c18f0fb7c587e23127be696282bc3e5956e7fbfd911e06d01",
"md5": "455c547ebbc216e0ea143f0423136d3f",
"sha256": "4d3ceaf7571b8d6ce6a2e644e3083c4f5656e4726885d98d12b75bbbb23262f7"
},
"downloads": -1,
"filename": "yara_x-1.8.1-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl",
"has_sig": false,
"md5_digest": "455c547ebbc216e0ea143f0423136d3f",
"packagetype": "bdist_wheel",
"python_version": "pp311",
"requires_python": ">=3.9",
"size": 9329606,
"upload_time": "2025-10-07T14:43:11",
"upload_time_iso_8601": "2025-10-07T14:43:11.543922Z",
"url": "https://files.pythonhosted.org/packages/6d/ae/7cea2a8fc10c18f0fb7c587e23127be696282bc3e5956e7fbfd911e06d01/yara_x-1.8.1-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "63aa0d080cd65c3881a6a85703a6705fd1dc1a02377f0b61889b20742cb7a64b",
"md5": "2b17c888fe255f794a9f40b0313ce47e",
"sha256": "7f2e42b980e0b4388e633d11c3ac4a7d70d10e3099e008ba3dadf8c6f9a33fb9"
},
"downloads": -1,
"filename": "yara_x-1.8.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "2b17c888fe255f794a9f40b0313ce47e",
"packagetype": "bdist_wheel",
"python_version": "pp311",
"requires_python": ">=3.9",
"size": 9723727,
"upload_time": "2025-10-07T14:43:13",
"upload_time_iso_8601": "2025-10-07T14:43:13.270667Z",
"url": "https://files.pythonhosted.org/packages/63/aa/0d080cd65c3881a6a85703a6705fd1dc1a02377f0b61889b20742cb7a64b/yara_x-1.8.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "25fb3abf595c3fb9eb8e768ebe3114accb7f5ce5ddb4a476845cb59d42fb410e",
"md5": "e411260afd8776d526c3ba9ab7c99b94",
"sha256": "6a31f5f7e17b0231e9b0ef00ca0c91fb6c2a7b21c1973a42c0a459288ed7fd71"
},
"downloads": -1,
"filename": "yara_x-1.8.1-pp311-pypy311_pp73-win_amd64.whl",
"has_sig": false,
"md5_digest": "e411260afd8776d526c3ba9ab7c99b94",
"packagetype": "bdist_wheel",
"python_version": "pp311",
"requires_python": ">=3.9",
"size": 7876971,
"upload_time": "2025-10-07T14:43:15",
"upload_time_iso_8601": "2025-10-07T14:43:15.095623Z",
"url": "https://files.pythonhosted.org/packages/25/fb/3abf595c3fb9eb8e768ebe3114accb7f5ce5ddb4a476845cb59d42fb410e/yara_x-1.8.1-pp311-pypy311_pp73-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-07 14:42:57",
"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"
}