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:

$ python setup.py build --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 Distribution

yara-python-4.1.2.tar.gz (426.1 kB view details)

Uploaded Source

Built Distributions

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

yara_python-4.1.2-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

yara_python-4.1.2-cp39-cp39-win32.whl (752.3 kB view details)

Uploaded CPython 3.9Windows x86

yara_python-4.1.2-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8Windows x86-64

yara_python-4.1.2-cp38-cp38-win32.whl (751.9 kB view details)

Uploaded CPython 3.8Windows x86

yara_python-4.1.2-cp37-cp37m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.7mWindows x86-64

yara_python-4.1.2-cp37-cp37m-win32.whl (751.8 kB view details)

Uploaded CPython 3.7mWindows x86

yara_python-4.1.2-cp36-cp36m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.6mWindows x86-64

yara_python-4.1.2-cp36-cp36m-win32.whl (751.8 kB view details)

Uploaded CPython 3.6mWindows x86

yara_python-4.1.2-cp35-cp35m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.5mWindows x86-64

yara_python-4.1.2-cp35-cp35m-win32.whl (751.8 kB view details)

Uploaded CPython 3.5mWindows x86

File details

Details for the file yara-python-4.1.2.tar.gz.

File metadata

  • Download URL: yara-python-4.1.2.tar.gz
  • Upload date:
  • Size: 426.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara-python-4.1.2.tar.gz
Algorithm Hash digest
SHA256 70d4663ed6cb4cf0c555238d13b510b8df026b849d5c70adb0bf61e00f6a58a8
MD5 f95840402643157fe7b923d2ddd08c3d
BLAKE2b-256 e513015c9a360086194cdd10c51f26ff03fe53c9b34adaa410030c6a77dd6e57

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e03f46e7674d4424651ce8b6f433462d27db5949786bc526e457e26e054ae322
MD5 61f518172fc7d89082ffc9deabb66612
BLAKE2b-256 de618f3828c24e04f923509190bd9e94383502e0e6008515c55309bbc3ff625e

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp39-cp39-win32.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp39-cp39-win32.whl
  • Upload date:
  • Size: 752.3 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 43cb225e377e9fc0dedb738b7570ec00eafcc4d7fb814e17a878ca9e715ddd12
MD5 eb68188fb4fdcba49f49a953c415706c
BLAKE2b-256 9ca1d705392bf8321a946d2aad352e17eb522024f5043b25311efac0a45fa790

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 478571c2e769c33b726585ac0b27104bdaffe76fa67b5d93d60fadf5419fdc1d
MD5 66c84d659ca94833a1c0f13277d1ab93
BLAKE2b-256 ac718b713142f526a92826ba7946e569dcafab7e34baf6f9871b7cf517dba0b5

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp38-cp38-win32.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp38-cp38-win32.whl
  • Upload date:
  • Size: 751.9 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 0af1c1332101a4e989f65e605bec4aa38c22214b0f89cefdc088534229bb2d60
MD5 ab938e4f1647765ff3cf11fb75742525
BLAKE2b-256 206d3b54b848a1562747f7543b0de95841d6605d75bfc6584e5758b43be6fda8

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 bae263dc632cbf8af2486bad321717106feebfe0e57f0ec5bdb9749bac29715b
MD5 dc5fefb4ef4c466795b3283a8c79017b
BLAKE2b-256 255178ae22777b890a438387b2e5c70f8c5ed23f84797ca4b70f4d16f9c43b0b

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp37-cp37m-win32.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 751.8 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 828df57efb120fc5b8d42760b5541cc0183f614d7337e3e456de04e2ff153767
MD5 916c6dbd90a010b90b6f97b16f1d8c88
BLAKE2b-256 a6bc12e4e2633878fa200cb1c977e8731dfc5d079b12446d858d1f53d6ab2647

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f9e772e993f82939555518570ac5fbda1a0a3eed2db1f6d3463f72cc4dbcfb83
MD5 7215bccb8bf355ce1e625074ba7d5a6a
BLAKE2b-256 a69751996fa67b0e8da5c7ab3f5797777b0db766a211ad56760deb75e61168d5

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp36-cp36m-win32.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 751.8 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 58730ff4e1b03fa1ea3670aba76b422b86629dfa322222522608012d7d2fa266
MD5 55d01977954d96999e85bb46f1487eb5
BLAKE2b-256 38084dd65ebb797f8711e9983d34f43b4c26f0337c3755bb6080e0732cf67848

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 b2f4d759d7c2d021c5dcec8bd4df350b1e49ba4bfca79e9e311fec1046ad66fb
MD5 5ff9e58d79cc718e282eaaa08b0c80a8
BLAKE2b-256 163cef7af3beeadde93ff8b84f333a171141b8fe1df40ef1f874e058810de242

See more details on using hashes here.

File details

Details for the file yara_python-4.1.2-cp35-cp35m-win32.whl.

File metadata

  • Download URL: yara_python-4.1.2-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 751.8 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 983eb1bb5529734d26eb85d4d5941260f67fba309a6b0377c7e043c6f24ba998
MD5 f8602c3a4750acbf4d2ea84a5a1b57ec
BLAKE2b-256 2739e15071f5a04bb7b5cccdaa78a68af37962d8bdddfcb325b7db95c499b677

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