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.1.tar.gz (297.5 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.1-cp35-cp35m-win_amd64.whl (698.9 kB view details)

Uploaded CPython 3.5mWindows x86-64

yara_python-3.6.1-cp35-cp35m-win32.whl (607.9 kB view details)

Uploaded CPython 3.5mWindows x86

yara_python-3.6.1-cp34-cp34m-win_amd64.whl (679.4 kB view details)

Uploaded CPython 3.4mWindows x86-64

yara_python-3.6.1-cp34-cp34m-win32.whl (613.6 kB view details)

Uploaded CPython 3.4mWindows x86

yara_python-3.6.1-cp33-cp33m-win_amd64.whl (679.4 kB view details)

Uploaded CPython 3.3mWindows x86-64

yara_python-3.6.1-cp33-cp33m-win32.whl (613.6 kB view details)

Uploaded CPython 3.3mWindows x86

yara_python-3.6.1-cp27-cp27m-win_amd64.whl (678.8 kB view details)

Uploaded CPython 2.7mWindows x86-64

yara_python-3.6.1-cp27-cp27m-win32.whl (606.0 kB view details)

Uploaded CPython 2.7mWindows x86

yara_python-3.6.1-cp26-cp26m-win_amd64.whl (679.2 kB view details)

Uploaded CPython 2.6mWindows x86-64

yara_python-3.6.1-cp26-cp26m-win32.whl (606.2 kB view details)

Uploaded CPython 2.6mWindows x86

File details

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

File metadata

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

File hashes

Hashes for yara-python-3.6.1.tar.gz
Algorithm Hash digest
SHA256 37066d324db8931aa9ad06690667529c2f68260ab43493df679444c66b44ed71
MD5 e571cccf790cb66b41ec007c4d984c6b
BLAKE2b-256 b5c9b697a1f876203b4290271d065d3b8428746655dad65f421ccb48af0cfbc2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 81ff97b618c64936be1983357d9afa0dc9e4f6c8825d0cecf723117934916ef2
MD5 f1364a91f89a295a032d2b9e3a184805
BLAKE2b-256 db89ed4d56a5704717098b8fd2c843026d66ef297a00bdf9d9362ec914eb74d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 8e084bb7ac711a8244630c6f251424e4e61334ebb5ce8bbfe91750470a937bde
MD5 995e28e302d72fcb216c194a9c7e39a3
BLAKE2b-256 96112f60dae1382b84ce3b741bd763d799d4191b2c2a9835a38d55db6cda02ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 aa93b5e6e3b1f666ef5f622ab9ba1e85d661f6e2609e40b00f496a98a49e1a20
MD5 33bc2ca97e9d7867d89ec349751eb098
BLAKE2b-256 ff653dbd003554dd7b5634a611464e2315a55da5f2c773972a367e13de7fc698

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 f4dadf53c682b531072da6cc2a15dd3511a7251ed2b9b56ef52988bc988d6479
MD5 ef6af60485755210f462cd05186e4ca6
BLAKE2b-256 d83515488fdcfdd65366d36eaf676fa789f42fa2a0c1e7466eb33987af797edc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 5c047dd96592505787b8750688978aba10a88adbfd03abb53c6a6dd06649d129
MD5 fcc34d093398b00e5cc614af9f732c38
BLAKE2b-256 0f5cb73d2af0576eba49cfe9b7ab0ba7fe1ca9f59c49d43f4ed880b600cdd200

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 cf5748f7ae1e632eae13674dedd68a4bd5cebed5ac36a8a8e9d40c649e49349f
MD5 17968fa054b0c00c13307c29334c6b1e
BLAKE2b-256 cf7142fbfb5d30693bf90ede2908faf5a70830ed0d2402c4b86a5326020aa7d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 b41c852bb033d40675dcbc32fe1812db31543abd2350e6b6a8fd27b3022ec06f
MD5 f095e7cdd5dcfca98fa9cf145a5e2841
BLAKE2b-256 ee7cdbdb8abcb132ac3e6baf8071b9e2c2f3e5afa229ace06d6d6794678f0f59

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 093b4fd5c19dea85f6aa70d2b075fe7c43c6fdcc76d2ce80dcd620abbc99e207
MD5 09faccbb36fbb51d3f5c3582612d9fdb
BLAKE2b-256 5ddb1dcb1fb1845f3eeee74e3082cd033fcb3bb5c630536ebd286bf3ec7bfef8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp26-cp26m-win_amd64.whl
Algorithm Hash digest
SHA256 fe745e224583b3df154daaba3b87f06e509630efb6f48eb33be52feef8c54a70
MD5 05342b27f9acd93ae5a818b0ac580da4
BLAKE2b-256 815395a938735e0fd30605b48bcf95aae42127b929ce189524f2d5d13291a59b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.1-cp26-cp26m-win32.whl
Algorithm Hash digest
SHA256 cdbc61c8e5add4612c619c186e5dfa4978158f1fa45aa877cace6d8422f3b36e
MD5 31b9dfec6a60ab76bbb2caa44bd6d33f
BLAKE2b-256 e4057b8b1ac73dda7e83aedb8ae315154df7dd74f07fa4277315c52ed36a3b5a

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