Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python interface for YARA

Project Description

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.

Release History

Release History

This version
History Node

3.7.0

History Node

3.6.3

History Node

3.6.2

History Node

3.6.1

History Node

3.6.0

History Node

3.5.0

History Node

3.4.0.00

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
yara_python-3.7.0-cp26-cp26m-win32.whl (611.0 kB) Copy SHA256 Checksum SHA256 cp26 Wheel Nov 10, 2017
yara_python-3.7.0-cp26-cp26m-win_amd64.whl (683.3 kB) Copy SHA256 Checksum SHA256 cp26 Wheel Nov 10, 2017
yara_python-3.7.0-cp27-cp27m-win32.whl (610.7 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Nov 10, 2017
yara_python-3.7.0-cp27-cp27m-win_amd64.whl (683.0 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Nov 10, 2017
yara_python-3.7.0-cp33-cp33m-win32.whl (617.3 kB) Copy SHA256 Checksum SHA256 cp33 Wheel Nov 10, 2017
yara_python-3.7.0-cp33-cp33m-win_amd64.whl (681.9 kB) Copy SHA256 Checksum SHA256 cp33 Wheel Nov 10, 2017
yara_python-3.7.0-cp34-cp34m-win32.whl (617.3 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Nov 10, 2017
yara_python-3.7.0-cp34-cp34m-win_amd64.whl (681.9 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Nov 10, 2017
yara_python-3.7.0-cp35-cp35m-win32.whl (611.9 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Nov 10, 2017
yara_python-3.7.0-cp35-cp35m-win_amd64.whl (701.6 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Nov 10, 2017
yara-python-3.7.0.tar.gz (313.6 kB) Copy SHA256 Checksum SHA256 Source Nov 10, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting