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 http://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.6.3.tar.gz (301.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.6.3-cp35-cp35m-win_amd64.whl (699.3 kB view details)

Uploaded CPython 3.5mWindows x86-64

yara_python-3.6.3-cp35-cp35m-win32.whl (608.6 kB view details)

Uploaded CPython 3.5mWindows x86

yara_python-3.6.3-cp34-cp34m-win_amd64.whl (679.7 kB view details)

Uploaded CPython 3.4mWindows x86-64

yara_python-3.6.3-cp34-cp34m-win32.whl (614.0 kB view details)

Uploaded CPython 3.4mWindows x86

yara_python-3.6.3-cp33-cp33m-win_amd64.whl (679.7 kB view details)

Uploaded CPython 3.3mWindows x86-64

yara_python-3.6.3-cp33-cp33m-win32.whl (614.0 kB view details)

Uploaded CPython 3.3mWindows x86

yara_python-3.6.3-cp27-cp27m-win_amd64.whl (679.3 kB view details)

Uploaded CPython 2.7mWindows x86-64

yara_python-3.6.3-cp27-cp27m-win32.whl (606.7 kB view details)

Uploaded CPython 2.7mWindows x86

yara_python-3.6.3-cp26-cp26m-win_amd64.whl (679.6 kB view details)

Uploaded CPython 2.6mWindows x86-64

yara_python-3.6.3-cp26-cp26m-win32.whl (607.1 kB view details)

Uploaded CPython 2.6mWindows x86

File details

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

File metadata

  • Download URL: yara-python-3.6.3.tar.gz
  • Upload date:
  • Size: 301.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yara-python-3.6.3.tar.gz
Algorithm Hash digest
SHA256 614252c90a3e03f309c91460efd2a50dd4dce4b6306eccef268d146a9c59fba2
MD5 1bc1e5c53b92bee21efe274c45da1d29
BLAKE2b-256 574aaa0aeb948bb3cd355281ee40401b6673df2f809ed36afc35993c8f02a4d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 41577bd1c1007579211b2d2a0cf478e75aa05f9ff400e258c95043cccc42412a
MD5 b9d8ec187ac5edc46f430d4b8ddecad2
BLAKE2b-256 878f553455fd4fc456da2d15ebc5a82c01530050d60c43fdda4ccc23eec4e722

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 27310434e5d57d06c2a49b5ab2bca8a19406c98aac155001aaaecd30cb2c097a
MD5 75509be4b83c0211289892f43c4ca43b
BLAKE2b-256 4ffbe25c724b3413f575a609a54c7d15b6d8627f481154deb04ad71eb4e2939c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.3-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 8529aa0b220688a2ce637d38ffbe957d9c92d8d0fa91c48df2cc06bbe83fc106
MD5 153ade92ad9d54a08bfea17eee4c687f
BLAKE2b-256 5beea3e34589d6832a6e73bba83cf133d9d6abea8241ad0b00c84ddca7922963

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.3-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 a6c1036c5188fcfd63ef277852aff404452a828d8387b0f9799475cfdb1a2bd2
MD5 12d39ee56cc6d849406275f82dbcaba0
BLAKE2b-256 6da92640b97b5bd6f898ded2562e992b9662ca875b8972a136ba4ddc23a1234e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.3-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 2a6a084fd1df2af5221f933db8b2c14d722778eae4ec410d0e88564686aa1aeb
MD5 991d3fdee11841f0f3cd45f2a53a1bba
BLAKE2b-256 0b5527b6945c029c4f055b7d65f6d9aac55d4cdfb887f63986f68b12cf009f68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.3-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 96ef6fa911919743ae9800babb804e17b42f295bffafe23be7ec74cc9480b81b
MD5 6e960fb03bfe9a4f9881e083ae61828d
BLAKE2b-256 375561bea24f958698822712b3993bd7c21d8d520f7f38a89bf9ae91bd866321

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.3-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 09749eaaf0a3ed9885d302af2690b8722ac6f64cee4573871bea1d641e1066b2
MD5 e83d62bff8e667397532526c6dea1350
BLAKE2b-256 e2d4f1babf75c2a44386b63902492675476df5b96e78a10d7ddd74a79e25b976

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.3-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 601237a5bc2d765237141effe9bf57433fa2dd377a738e9efe8e677f115149b5
MD5 f9e3ea04c02ba70b2082282b73e5beee
BLAKE2b-256 2de8b062e3fe51ef68d25b15cfb05c8d220c4a8ab53dfea14d5beb8472f54080

See more details on using hashes here.

File details

Details for the file yara_python-3.6.3-cp26-cp26m-win_amd64.whl.

File metadata

File hashes

Hashes for yara_python-3.6.3-cp26-cp26m-win_amd64.whl
Algorithm Hash digest
SHA256 eb7d33c6f1c28d44fb19cb3162ae3c7a79b4be9600277cf2f356eb94b4f722ea
MD5 a9872c46ee8dc5e7645d593d5f319207
BLAKE2b-256 02eb779350f56e36eca10209936075cc60916e4cc70866f7c7f13ac2cb23c25c

See more details on using hashes here.

File details

Details for the file yara_python-3.6.3-cp26-cp26m-win32.whl.

File metadata

File hashes

Hashes for yara_python-3.6.3-cp26-cp26m-win32.whl
Algorithm Hash digest
SHA256 3ebe3e81eb3d5823a24df8d438d3a072f9c297c0883748ae2c92b1db36bb95da
MD5 8fa616069be4738591d935645796673b
BLAKE2b-256 8cdc6fbbbb7f6973aed305e2a01a8145c8e63675a416796b8dfa7e906841d283

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