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 Distribution

yara-python-3.8.0.tar.gz (355.2 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-3.8.0-cp36-cp36m-win_amd64.whl (708.3 kB view details)

Uploaded CPython 3.6mWindows x86-64

yara_python-3.8.0-cp36-cp36m-win32.whl (617.2 kB view details)

Uploaded CPython 3.6mWindows x86

yara_python-3.8.0-cp35-cp35m-win_amd64.whl (708.3 kB view details)

Uploaded CPython 3.5mWindows x86-64

yara_python-3.8.0-cp35-cp35m-win32.whl (617.2 kB view details)

Uploaded CPython 3.5mWindows x86

yara_python-3.8.0-cp34-cp34m-win_amd64.whl (689.0 kB view details)

Uploaded CPython 3.4mWindows x86-64

yara_python-3.8.0-cp34-cp34m-win32.whl (624.4 kB view details)

Uploaded CPython 3.4mWindows x86

yara_python-3.8.0-cp33-cp33m-win_amd64.whl (689.1 kB view details)

Uploaded CPython 3.3mWindows x86-64

yara_python-3.8.0-cp33-cp33m-win32.whl (624.2 kB view details)

Uploaded CPython 3.3mWindows x86

yara_python-3.8.0-cp27-cp27m-win_amd64.whl (689.6 kB view details)

Uploaded CPython 2.7mWindows x86-64

yara_python-3.8.0-cp27-cp27m-win32.whl (618.5 kB view details)

Uploaded CPython 2.7mWindows x86

File details

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

File metadata

  • Download URL: yara-python-3.8.0.tar.gz
  • Upload date:
  • Size: 355.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara-python-3.8.0.tar.gz
Algorithm Hash digest
SHA256 dc6d15822762e394040b1f6ffb1a627ec58b44d5a6228569689a04341387941a
MD5 9ad43529b3fcf9aadd2d981d56a6f40e
BLAKE2b-256 3a791abbc8c6408a95b97c5e319d724fafd9b98f09fd005f80503d6a3be10dc2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 708.3 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 11ffe769b19e15df9e303701f6e2892355da7a06ce2325445f499374a80df107
MD5 e54392e6fe9478767a410cdaa51d53d9
BLAKE2b-256 72fd5bc93a27ba2f613f2df3e0006457710130bca261bd64b812e9fde9fe1865

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for yara_python-3.8.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 63a9088cfd17e2980aee7875cc9ded724212fe68e73a36ed77e2b93776d955f4
MD5 fd9d4a5835734fbf1803a8112f3cbfff
BLAKE2b-256 cb8fc7d9d318aa1dc50ea021b3442d09b3462011e20697103bf60e7248561293

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 708.3 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 c9355038e7f3f069d913fb5735cdddc4723623367d6335540ab6fc7a0fd9bd6b
MD5 1f95f6774c99a065c0edec50c2a57f24
BLAKE2b-256 3f9626fc57f303f295dad731d55b04964d042fd5e14f8ff6b82fdf77a2e4c6ab

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for yara_python-3.8.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 1ce3f3c65001c916b375ea00d02d7eb630ff960bc80c8d4095693ff712c3cc76
MD5 48e57987c7c76873b11c7238297556ea
BLAKE2b-256 f2c1ae90fd7d58140afbceac6da334fa4cc1bc21a4514062da11a152ac9221cc

See more details on using hashes here.

File details

Details for the file yara_python-3.8.0-cp34-cp34m-win_amd64.whl.

File metadata

  • Download URL: yara_python-3.8.0-cp34-cp34m-win_amd64.whl
  • Upload date:
  • Size: 689.0 kB
  • Tags: CPython 3.4m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 cba0697086bf2574d23a104175c417301d3f40bc048a80be83f416880ef56d28
MD5 631b6a61de17e5fb6cf77c24ddb973ec
BLAKE2b-256 756266dbb70262fed75124ea9759b08c2dd9f0b0195a77777c94c718c1d47f7f

See more details on using hashes here.

File details

Details for the file yara_python-3.8.0-cp34-cp34m-win32.whl.

File metadata

  • Download URL: yara_python-3.8.0-cp34-cp34m-win32.whl
  • Upload date:
  • Size: 624.4 kB
  • Tags: CPython 3.4m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 fa2416a431c2f1e57a5ad20d8ad9fa688cf297edc21e275632051cf02b0ab6c3
MD5 b15cf56b0af23c92a0e48c6fb059af59
BLAKE2b-256 101906a41e0a7100a897fe1d5183eacd87fafec7a1ad41c0bb958ca1a6e0290f

See more details on using hashes here.

File details

Details for the file yara_python-3.8.0-cp33-cp33m-win_amd64.whl.

File metadata

  • Download URL: yara_python-3.8.0-cp33-cp33m-win_amd64.whl
  • Upload date:
  • Size: 689.1 kB
  • Tags: CPython 3.3m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.0-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 ee35b0b9d729ac48057c6a0213aa039814899171b933fbd267c46785bf9ff0b5
MD5 dd91a5745af114b188a555d2887bdd26
BLAKE2b-256 3642f2a84eb6f3f0aa9cc1727da4bd4610d7d196a3f01cf19d82a5f40dced7db

See more details on using hashes here.

File details

Details for the file yara_python-3.8.0-cp33-cp33m-win32.whl.

File metadata

  • Download URL: yara_python-3.8.0-cp33-cp33m-win32.whl
  • Upload date:
  • Size: 624.2 kB
  • Tags: CPython 3.3m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.0-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 2cc49a2b71815a574fa15dae0f05da31e95d2f396fda2fc61b7b868e900bec9f
MD5 cb56d25cb19058bb09b9f6acc51136d4
BLAKE2b-256 b295e4741880a7bdbf993a756abaa75b63d72daecb7134366d88c6f44e4bd834

See more details on using hashes here.

File details

Details for the file yara_python-3.8.0-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: yara_python-3.8.0-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 689.6 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 812ec0881070ec88868f9799c92e663e12f310d5954e453c0e034cdb1f5a927e
MD5 e709cf7c518c836fbbf5dd2963ac76f7
BLAKE2b-256 acc59e7b92a92af96d13ebde47c7ed3e1827653edf30ba1ce6f48e798b26c6b7

See more details on using hashes here.

File details

Details for the file yara_python-3.8.0-cp27-cp27m-win32.whl.

File metadata

  • Download URL: yara_python-3.8.0-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 618.5 kB
  • Tags: CPython 2.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 4b27c687b84ec0006dcbeba8c42158c5e2f0a53b0666ec679e991aead355cbdb
MD5 0e079cdd8c37f2472ada033498dd5856
BLAKE2b-256 1262e206e74060764c7b626203fcecf39bc78ac4ce539ea38daa61291344a677

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