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.0.tar.gz (295.9 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.0.1-cp35-cp35m-win_amd64.whl (698.7 kB view details)

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

yara_python-3.6.0.1-cp34-cp34m-win_amd64.whl (679.2 kB view details)

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

yara_python-3.6.0.1-cp33-cp33m-win_amd64.whl (679.2 kB view details)

Uploaded CPython 3.3mWindows x86-64

yara_python-3.6.0.1-cp33-cp33m-win32.whl (613.5 kB view details)

Uploaded CPython 3.3mWindows x86

yara_python-3.6.0.1-cp27-cp27m-win_amd64.whl (680.0 kB view details)

Uploaded CPython 2.7mWindows x86-64

yara_python-3.6.0.1-cp27-cp27m-win32.whl (605.9 kB view details)

Uploaded CPython 2.7mWindows x86

yara_python-3.6.0.1-cp26-cp26m-win_amd64.whl (680.4 kB view details)

Uploaded CPython 2.6mWindows x86-64

yara_python-3.6.0.1-cp26-cp26m-win32.whl (606.1 kB view details)

Uploaded CPython 2.6mWindows x86

File details

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

File metadata

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

File hashes

Hashes for yara-python-3.6.0.tar.gz
Algorithm Hash digest
SHA256 416a1fd90fd3388eb5480270e6b19cacd7cbabf0bb908ecf17ddb44923f3cf55
MD5 6109417854b29b447b82c7a2d182fc27
BLAKE2b-256 f9d0c8709c7589ea4e117c58e8ea864c570a935debc70598d23ce39c527d61d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 c62f67b909e4aca1a1f217b3d6e979384aa5bc4f4882a15fde95c55e97e03414
MD5 9532338d807e6b4665ca7b06af64653d
BLAKE2b-256 40775b4a117709f5b89e6131755e328e7006511aee3300b59bc3ad3e558beb84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 0487cfde6e62a080afe6eec600d185da5ea54ebaee85a96e2d0e6758880c4c3e
MD5 fcdb5168ac64e8e9dbb36d109bd2d7e4
BLAKE2b-256 449729f6bb6f1fb04b1c529860302259f1efe198f3341516c4890a6fb6f10b06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 4ff6f9c7645fb46aa88caeb6926ffbb9aca87ff99dd46f5fa4d176288e581c36
MD5 ed29cad04fbc588862e1e57cd9c8e188
BLAKE2b-256 5e2b9769c685a8ea8d61c46ca9b46177ae3ddd105466c02e4617e14697db9c9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 14ad00e52ac52d86679d5fade685e11dc2593214fea9289e4294abb8d8604b61
MD5 221982f979099d6de1cbec9f84c66aa8
BLAKE2b-256 e26fc9b35b1e50c57d6b60bcd83a9317970354e1f7871e019522348501957210

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 dbe3f7abcdb43897fc5d43a7f98323143916528214a27547325bb18d6c9a7b36
MD5 4de586015181406d320df7a0feb332e5
BLAKE2b-256 05ee389e509033bfea8494d60c93741166a4ba7836fdfe7adbadfc2295769f6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 4ad1e559a904bbf8336bcd15cdded3ea4a73d3f351ce9b493a90dbcd10fa85ec
MD5 d3bcc80c8fc12cc290b17870e53bd238
BLAKE2b-256 48cea8088e3b78cdc25d4ca7bdf7309e9091052f020b6690084727f27118a9a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 f5041a503437f600e9eda19d5097c3302ed1ea4acb8221dac9aab62da2978e7a
MD5 9d5f7c22ce8c6957b02e8db8969040b7
BLAKE2b-256 c6b4f1139bbe7824a81e37a800a3bb6ebc136f3b7590b05d39eedbb3b7b0ac29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 0772dcadb5fc7563d2c03714759fd0417bb3cb29f78a1074b25eba185da8770f
MD5 9f554a86dfb0145ca625c84d7d5143ff
BLAKE2b-256 186fb5ac9c6885f8b2ab3264bc87e273cc3cb8e040ede44c6535556ea52316be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp26-cp26m-win_amd64.whl
Algorithm Hash digest
SHA256 444d0fcb0ade0596e58e15a8a01ef5f7e650eb67691fa4e50bfc871ee4cac939
MD5 eb4843bcb96d401223bfabe0b67465be
BLAKE2b-256 58ff4c175de72fb990f570fc6a7f337c202e8922b1c5a549a7a7b24af9fc173e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.0.1-cp26-cp26m-win32.whl
Algorithm Hash digest
SHA256 677d452ca2d16d2df4d0346aa5147fb02295f9149e87a3c52d50910fa58f35da
MD5 0c917daabe1b457226e102a9f9477225
BLAKE2b-256 0d0309004537990ded71c3142094ccd01623ab4de358f293fef1639768c942a0

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