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

Uploaded CPython 3.5mWindows x86-64

yara_python-3.6.2-cp35-cp35m-win32.whl (608.2 kB view details)

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.4mWindows x86-64

yara_python-3.6.2-cp34-cp34m-win32.whl (613.8 kB view details)

Uploaded CPython 3.4mWindows x86

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

Uploaded CPython 3.3mWindows x86-64

yara_python-3.6.2-cp33-cp33m-win32.whl (613.8 kB view details)

Uploaded CPython 3.3mWindows x86

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

Uploaded CPython 2.7mWindows x86-64

yara_python-3.6.2-cp27-cp27m-win32.whl (606.4 kB view details)

Uploaded CPython 2.7mWindows x86

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

Uploaded CPython 2.6mWindows x86-64

yara_python-3.6.2-cp26-cp26m-win32.whl (606.7 kB view details)

Uploaded CPython 2.6mWindows x86

File details

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

File metadata

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

File hashes

Hashes for yara-python-3.6.2.tar.gz
Algorithm Hash digest
SHA256 10537b99b62a6cf8c3d917040e2e541c95f113496dcbdfeec5855b29dffdc617
MD5 ebd1baab2c9311152fb5c61a3256f381
BLAKE2b-256 523534e8f79f616a7cc3febf476bcb93e21e3577e83ac01615baf04e894cb0a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e3b88125f80806dcfe47aa95cb8a80bc4df89914cac8a774d55422827f63f0d4
MD5 b1228f586dfee905e3ca6e0f2b5063ae
BLAKE2b-256 691de55ca02f61a9411888c20f6bc21bd71788c9aa63a06c4d9486621e95224e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 ac28bfe473818235082706d9ef3dbc815938e12370f2f66d1e80688a4f509e98
MD5 b4a832e58003c9e7a1e8dc603b054e79
BLAKE2b-256 73dbd8b767615e7969a66e7fc7fd2f0f9e9d55b94392cb57050a33f6859e0a80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 0ff88b310b5d62a806ac299c50d3f8c967063cbe1a22b4d931c1992b20236c26
MD5 a5263a13fe8d137152f3dd270799b8ba
BLAKE2b-256 9a2ff8b68b80812aad2c0f634c0912da8bc93300a30f32c4f987c1fb8e22f4cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 f205292ea274d2726c99c28adffaaf2f727db2244559a4fa8d753ad2e62102ab
MD5 336ac8e839270411b2fbb65a0e6dafc0
BLAKE2b-256 63c9e77c96eda1ea282172bff43beb0cbf47e32b63559fcf60a7dea51027fbd0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 150129a64a2ff2ecf76478cb46a8578e2c98320d16876ff12808cbe8ba70c0d5
MD5 d8fd84ab4d6eafb3b96727e6045cba79
BLAKE2b-256 5309024be725af51e23d43246a1f452efb1dadb3efe671bc5100cc1d2c289b03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 1c59e99aed5418cd8676064624b3a2646887f2b11f37dc18c5a0fea991e049e2
MD5 9a516464fba93821dec19675022e9fb6
BLAKE2b-256 b3d95b05bae8bfdb6ad6abe2eb1be0c9d7279c3874697226fcfe5053cd48a0b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 3c17015608d02b6ab44f01917757deea1079fb5148443b25da1a4ee23e7df236
MD5 a19ebcb1825d5086d32bd2a052f44fef
BLAKE2b-256 a933c6b5be39e0801a09decacc086d119182e657d3f038cc07f617f7713717c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 43078b6edb9d102c2e35b3a169fe80b81f92e89507789fbe832be0936cc4da96
MD5 db3a02d0f63387a5b60bda7dfbab6d38
BLAKE2b-256 1af8fe52e3f4ff54e7b14b791edef082fb4428360edc6fe24666c438d0a955bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp26-cp26m-win_amd64.whl
Algorithm Hash digest
SHA256 c6ed741a2485f639307e80adb6fa5ca4633508472bb3ecf0fd5c329bbf89e7a0
MD5 499b4dce251fcd700555a6bf90103985
BLAKE2b-256 2ac4e54dffe47b11b50a9c40c9d09fb5e9e8ef442cbc2be114b9385bc15fffd0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.6.2-cp26-cp26m-win32.whl
Algorithm Hash digest
SHA256 fc5814b0d5ec252f355973e07c7825f736302d04ecb7d20517ba6dd0a23e7761
MD5 360a91be1d95c9d07f3d14a538a1c85c
BLAKE2b-256 26c966d2215471ec03d4df462f0f8c0374aa73a549504761bd1e2253287dcb9f

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