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.7.0.tar.gz (313.6 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.7.0-cp35-cp35m-win_amd64.whl (701.6 kB view details)

Uploaded CPython 3.5mWindows x86-64

yara_python-3.7.0-cp35-cp35m-win32.whl (611.9 kB view details)

Uploaded CPython 3.5mWindows x86

yara_python-3.7.0-cp34-cp34m-win_amd64.whl (681.9 kB view details)

Uploaded CPython 3.4mWindows x86-64

yara_python-3.7.0-cp34-cp34m-win32.whl (617.3 kB view details)

Uploaded CPython 3.4mWindows x86

yara_python-3.7.0-cp33-cp33m-win_amd64.whl (681.9 kB view details)

Uploaded CPython 3.3mWindows x86-64

yara_python-3.7.0-cp33-cp33m-win32.whl (617.3 kB view details)

Uploaded CPython 3.3mWindows x86

yara_python-3.7.0-cp27-cp27m-win_amd64.whl (683.0 kB view details)

Uploaded CPython 2.7mWindows x86-64

yara_python-3.7.0-cp27-cp27m-win32.whl (610.7 kB view details)

Uploaded CPython 2.7mWindows x86

yara_python-3.7.0-cp26-cp26m-win_amd64.whl (683.3 kB view details)

Uploaded CPython 2.6mWindows x86-64

yara_python-3.7.0-cp26-cp26m-win32.whl (611.0 kB view details)

Uploaded CPython 2.6mWindows x86

File details

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

File metadata

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

File hashes

Hashes for yara-python-3.7.0.tar.gz
Algorithm Hash digest
SHA256 bedb10a9be398616fc1a5d4bb14f369ed88e4dec5f6455047e3e4efee01890e0
MD5 c5873de304ae19e2457a89d09c9f41f3
BLAKE2b-256 4bb79025babf5ac6611d741586b5cf2a9e6c264b9b80c5946ec2f6c2d103a7a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 fdc05e811a90c8b0dfcb5e12ff58f675805b3783b4f030533f2b826bcdc834fc
MD5 1d2478443cc6998452d95867de9cd2bb
BLAKE2b-256 10640ca60fcf051aeab4ccbeb251256e0c4ac8c11f8d404f8ab9131448497977

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 28940a393bc26b05ba2602d107205e92f1b6125e3be7248f45f503d95f9ed36a
MD5 85847d510344ad4073bb87c138f014a6
BLAKE2b-256 3379e911738cdffea2929c24debf802d20b272dc7c21f953e75ee8af3649a04d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 bf941598cfb9871661c4ecabb5f21cf2148267aa9f2fd3555d7bd346012737ab
MD5 464c9e31175c032acc8824bdf487924c
BLAKE2b-256 08d0c6cadd5e2bbd9f2fc53860e6b39332c4cb66ba44f9f2285b330b646a3cd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 15f3db41707fed6c3ac788a3b708e600efbf015f5a13ce15279c74f7adaf0f26
MD5 a903acf8630c14a435e7990e877de654
BLAKE2b-256 1958f71c77c35571562a7f9f7e8f83daf54fcb8513fe30a8d13d28d72d9cac02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 80a211cdee7c7e689ad2b8cf5e2a168365beeaf20922f09efbfaf3a867b17022
MD5 803e6999465103c3a2d8219af8cc4e91
BLAKE2b-256 e00003a5faa876d25e75a846b8d9a68c6f75e58cd7e58513831df73147376907

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 7c5c791e0e7ddab0dee4f24c2792bc5d80b6434b1a64ceb56734eb7d1476dd5e
MD5 cdff8e46662ad4a036fd7c0481efb00b
BLAKE2b-256 e993c91194e4ef8bfa1c95cfc0f159fbcfa1d38427f4532649549d30d18aa5b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 1edaec2b91149d873057e747516228db1036aa960d2fb432a60d5f043b5d062e
MD5 e247af2baf594520e5465e90223dc4fb
BLAKE2b-256 219a4100bd409b56473e9aa5e814f0af22eb1d23cde07e50cb38d5b71dcea215

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 0a0b3c46d2f49692f5f2c55e543edc99e5363e5198d4b302fd8ced3064bade70
MD5 9f1c07e713fc122ba4971bf9f1a4a9c8
BLAKE2b-256 c4025e73278018cf3c72c37be5c190e902b0b9259326213f648bfb7f97f82d58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp26-cp26m-win_amd64.whl
Algorithm Hash digest
SHA256 beeb5f63b77a19c1d538b01b330dfd1cb9008f9b791a60f6a9b3aadf465d236f
MD5 b8750f3e91bb8c9b395506ff4e44d649
BLAKE2b-256 43932cd4efbadab93c077f416503d7c161e7cfeef73eb8b3e519210a0f9ddb25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-3.7.0-cp26-cp26m-win32.whl
Algorithm Hash digest
SHA256 1a1813d8c11292a967eeeaf6cbbe934b4200966cdd36c97a3162d80c2be76af3
MD5 1668decab76d90ca92fa769ee20b20eb
BLAKE2b-256 c249ef99b16026d130651089891850072457e0e5dcfb2a537f6f452d39eb8152

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