Skip to main content

Python interface for YARA

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

yara_python_dex-1.0.2-cp310-cp310-musllinux_1_1_x86_64.whl (571.0 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

yara_python_dex-1.0.2-cp310-cp310-musllinux_1_1_i686.whl (543.6 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ i686

yara_python_dex-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (571.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

yara_python_dex-1.0.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (551.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.12+ i686manylinux: glibc 2.17+ i686

yara_python_dex-1.0.2-cp310-cp310-macosx_11_0_arm64.whl (146.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

yara_python_dex-1.0.2-cp310-cp310-macosx_10_9_x86_64.whl (155.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

yara_python_dex-1.0.2-cp310-cp310-macosx_10_9_universal2.whl (299.4 kB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file yara_python_dex-1.0.2-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for yara_python_dex-1.0.2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 64b6b39d3638cb00e8a9ea2f1f2fc1cd115b9305dfbca1585ac28156fc531995
MD5 14eea0837ba129817735e1fb8d58d4a4
BLAKE2b-256 22725b33d058382a9f2f8915c263f71dd529cc048df4b7d859d8783576e1637c

See more details on using hashes here.

File details

Details for the file yara_python_dex-1.0.2-cp310-cp310-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for yara_python_dex-1.0.2-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 d22194b08bec63a7d12b2ee32b83d97572349f678c9571bb2658679d4161e035
MD5 8e9a73f55a81262e837ce0c62290875d
BLAKE2b-256 02e8072a6c2e890019d07e8649c845169e9cebe26cfe3c55862b2c04a9e42981

See more details on using hashes here.

File details

Details for the file yara_python_dex-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for yara_python_dex-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 04f62cf68c1ff1e4a3e688c837643c7dd7e3c6672a5374fde1003b3d04d1b950
MD5 653092a529a9b748c8b7cef38820c7ac
BLAKE2b-256 99f7002d930e1f633ff3035553ec846fee882dc49edaaf8e4034612f4a992ae1

See more details on using hashes here.

File details

Details for the file yara_python_dex-1.0.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for yara_python_dex-1.0.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e93611889e1291b6bdc1cecadf072a09e67f449166f703ecdfe9ddf6f0e57cd8
MD5 990a7e614b71663eb4e3f746c097390e
BLAKE2b-256 d9f709d18a49713cfd18bf94094b4b25e622e231f40be25b06a9ed2f974420a3

See more details on using hashes here.

File details

Details for the file yara_python_dex-1.0.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for yara_python_dex-1.0.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a6ed9dc5748e1b8a44fe77cd4fb2705c7e5271de320059339c96eba75ed9373
MD5 2ea1022dd2235c5266463061a81eeb4a
BLAKE2b-256 2ebdb4628127be99ad66d926856ce4f0dc768897556343254db209a871fde653

See more details on using hashes here.

File details

Details for the file yara_python_dex-1.0.2-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for yara_python_dex-1.0.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 881569176886e531e79d570d04bab0429b3e8ec6d37d22d094deb2d7dc7ee301
MD5 d1e5488f36bd56255bf664c4ed2e5863
BLAKE2b-256 70aa19a1e6b560d24a36c6325509e75820f062a9599e517a0af670cf768f7b7b

See more details on using hashes here.

File details

Details for the file yara_python_dex-1.0.2-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for yara_python_dex-1.0.2-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0bcac3da1625d437e0dfeb8a2e33a2e9f4d39f7cf11a597b94bdd7fa798a397a
MD5 897b4a7a2ac2241f51ddc69a8c6915b4
BLAKE2b-256 9bd2fa9807f46bd4b38897a180ca1c1b08b1e159f0d0d323f2ddb824995ed430

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page