Skip to main content
https://travis-ci.org/VirusTotal/yara-python.svg https://ci.appveyor.com/api/projects/status/gidnb9ulj3rje5s2?svg=true

yara-python

With this library you can use YARA from your Python programs. It covers all YARA’s features, from compiling, saving and loading rules to scanning files, strings and processes.

Here it goes a little example:

>>> import yara
>>> rule = yara.compile(source='rule foo: bar {strings: $a = "lmn" condition: $a}')
>>> matches = rule.match(data='abcdefgjiklmnoprstuvwxyz')
>>> print(matches)
[foo]
>>> print(matches[0].rule)
foo
>>> print(matches[0].tags)
['bar']
>>> print(matches[0].strings)
[(10L, '$a', 'lmn')]

Installation

The easiest way of installing YARA is by using pip:

$ pip install yara-python

But you can also get the source from GitHub and compile it yourself:

$ git clone --recursive https://github.com/VirusTotal/yara-python
$ cd yara-python
$ python setup.py build
$ sudo python setup.py install

Notice the --recursive option used with git. This is important because we need to download the yara subproject containing the source code for libyara (the core YARA library). It’s also important to note that the two methods above link libyara statically into yara-python. If you want to link dynamically against a shared libyara library use:

$ sudo python setup.py install --dynamic-linking

For this option to work you must build and install YARA separately before installing yara-python.

Documentation

Find more information about how to use yara-python at https://yara.readthedocs.org/en/latest/yarapython.html.

Release files for ak-yara-python 3.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ak-yara-python 3.11.0
File Size Uploaded
ak-yara-python-3.11.0.tar.gz 376.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ak-yara-python 3.11.0
File
ak_yara_python-3.11.0-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
ak_yara_python-3.11.0-cp38-cp38-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.14+ x86-64, macOS 10.9+ x86-64, macOS 10.10+ x86-64, macOS 10.9+ Intel (x86-64, i386), macOS 10.10+ Intel (x86-64, i386) Details
ak_yara_python-3.11.0-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
ak_yara_python-3.11.0-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details

Total release size: 2.3 MB

Release files / ak-yara-python-3.11.0.tar.gz

Download URL ak-yara-python-3.11.0.tar.gz
Size 376.2 kB
Tags Source
SHA-256 checksum
How to use checksums
df8f7fc7f2237ee0ba3323be58578bb205361c224fab54012f04352109ef97d2
BLAKE2b-256 checksum
How to use checksums
6afe4803c51cfdb1f2c7696780b2918080b4e11df795bb005d5e3d96e6789d36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

Release files / ak_yara_python-3.11.0-cp38-cp38-manylinux1_x86_64.whl

Download URL ak_yara_python-3.11.0-cp38-cp38-manylinux1_x86_64.whl
Size 595.7 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
3f0d4204f12dc3b6fd38fe5fd62a1ffb6992089f6342cada7258d81a50e253cd
BLAKE2b-256 checksum
How to use checksums
7e7ec1151aaebe4e02465b9bd4bee3d27f3647ba71bde687f18a8dc5a4bdfbbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

Release files / ak_yara_python-3.11.0-cp38-cp38-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL ak_yara_python-3.11.0-cp38-cp38-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 186.0 kB
Tags CPython 3.8 macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.14+ x86-64 macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
7a78279ce871bf9a3a2d14b6df385edad100bc98577701fe076ad4d6b312e325
BLAKE2b-256 checksum
How to use checksums
f9772f5c64fdee3d0e643399ddcf28cde1b1acff903ce44e768ca8cc6c0cb4cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

Release files / ak_yara_python-3.11.0-cp37-cp37m-manylinux1_x86_64.whl

Download URL ak_yara_python-3.11.0-cp37-cp37m-manylinux1_x86_64.whl
Size 594.5 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
d76f2616c6c96811c847e20195ee167ba615d1170f5b9f5caacad70146591ca3
BLAKE2b-256 checksum
How to use checksums
04af5ca427c56e7967f9c31ca55ed54c310979da9e6fab0ede357a5918d01fd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

Release files / ak_yara_python-3.11.0-cp36-cp36m-manylinux1_x86_64.whl

Download URL ak_yara_python-3.11.0-cp36-cp36m-manylinux1_x86_64.whl
Size 593.3 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
40a8af2faff2b19b47fbab0d2753c2fafea705c1c5b9293aca10370636d0f36d
BLAKE2b-256 checksum
How to use checksums
b3bc3e30fc617fc6d1e859c5eb23e56803fd0815d424fe251e2787f8e1b97658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

Release history Release notifications | RSS feed

This release

3.11.0 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page