{"id":18735468,"url":"https://github.com/virustotal/yara-python","last_synced_at":"2025-05-13T21:05:07.497Z","repository":{"id":2869376,"uuid":"42300237","full_name":"VirusTotal/yara-python","owner":"VirusTotal","description":"The Python interface for YARA","archived":false,"fork":false,"pushed_at":"2025-05-02T09:49:52.000Z","size":321,"stargazers_count":690,"open_issues_count":35,"forks_count":186,"subscribers_count":49,"default_branch":"master","last_synced_at":"2025-05-07T11:39:51.305Z","etag":null,"topics":["yara"],"latest_commit_sha":null,"homepage":"http://virustotal.github.io/yara/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VirusTotal.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-09-11T09:37:35.000Z","updated_at":"2025-05-02T09:49:38.000Z","dependencies_parsed_at":"2023-12-01T14:11:20.723Z","dependency_job_id":"7dca2502-bcb6-4646-b2e9-3d9b4a6e91af","html_url":"https://github.com/VirusTotal/yara-python","commit_stats":{"total_commits":399,"total_committers":38,"mean_commits":10.5,"dds":"0.47117794486215536","last_synced_commit":"03c802e39f75dd07770584246a5cad0822c517d9"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirusTotal%2Fyara-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirusTotal%2Fyara-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirusTotal%2Fyara-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirusTotal%2Fyara-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VirusTotal","download_url":"https://codeload.github.com/VirusTotal/yara-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254028533,"owners_count":22002275,"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","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":["yara"],"created_at":"2024-11-07T15:17:12.553Z","updated_at":"2025-05-13T21:05:02.489Z","avatar_url":"https://github.com/VirusTotal.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://ci.appveyor.com/api/projects/status/gidnb9ulj3rje5s2?svg=true\n    :target: https://ci.appveyor.com/project/plusvic/yara-python\n\nyara-python\n===========\n\nWith this library you can use `YARA \u003chttps://github.com/VirusTotal/yara\u003e`_ from\nyour Python programs. It covers all YARA's features, from compiling, saving\nand loading rules to scanning files, strings and processes.\n\nHere it goes a little example:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import yara\n    \u003e\u003e\u003e rule = yara.compile(source='rule foo: bar {strings: $a = \"lmn\" condition: $a}')\n    \u003e\u003e\u003e matches = rule.match(data='abcdefgjiklmnoprstuvwxyz')\n    \u003e\u003e\u003e print(matches)\n    [foo]\n    \u003e\u003e\u003e print(matches[0].rule)\n    foo\n    \u003e\u003e\u003e print(matches[0].tags)\n    ['bar']\n    \u003e\u003e\u003e print(matches[0].strings)\n    [$a]\n    \u003e\u003e\u003e print(matches[0].strings[0].identifier)\n    $a\n    \u003e\u003e\u003e print(matches[0].strings[0].instances)\n    [lmn]\n    \u003e\u003e\u003e print(matches[0].strings[0].instances[0].offset)\n    10\n    \u003e\u003e\u003e print(matches[0].strings[0].instances[0].matched_length)\n    3\n\n\nInstallation\n------------\n\nThe easiest way to install YARA is by using ``pip``:\n\n.. code-block:: bash\n\n  $ pip install yara-python\n\nBut you can also get the source from GitHub and compile it yourself:\n\n.. code-block:: bash\n\n  $ git clone --recursive https://github.com/VirusTotal/yara-python\n  $ cd yara-python\n  $ python setup.py build\n  $ sudo python setup.py install\n\nNotice the ``--recursive`` option used with ``git``. This is important because\nwe need to download the ``yara`` subproject containing the source code for\n``libyara`` (the core YARA library). It's also important to note that the two\nmethods above link ``libyara`` statically into yara-python. If you want to link\ndynamically against a shared ``libyara`` library, use:\n\n.. code-block:: bash\n\n  $ python setup.py build --dynamic-linking\n\nFor this option to work you must build and install\n`YARA \u003chttps://github.com/VirusTotal/yara\u003e`_ separately before installing\n``yara-python``.\n\n\nDocumentation\n-------------\n\nFind more information about how to use yara-python at\nhttps://yara.readthedocs.org/en/latest/yarapython.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirustotal%2Fyara-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirustotal%2Fyara-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirustotal%2Fyara-python/lists"}