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

ak-yara-python-3.11.0.tar.gz (376.2 kB view details)

Uploaded Source

Built Distributions

ak_yara_python-3.11.0-cp38-cp38-manylinux1_x86_64.whl (595.7 kB view details)

Uploaded CPython 3.8

ak_yara_python-3.11.0-cp38-cp38-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (186.0 kB view details)

Uploaded CPython 3.8 macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.14+ x86-64 macOS 10.9+ intel macOS 10.9+ x86-64

ak_yara_python-3.11.0-cp37-cp37m-manylinux1_x86_64.whl (594.5 kB view details)

Uploaded CPython 3.7m

ak_yara_python-3.11.0-cp36-cp36m-manylinux1_x86_64.whl (593.3 kB view details)

Uploaded CPython 3.6m

File details

Details for the file ak-yara-python-3.11.0.tar.gz.

File metadata

  • Download URL: ak-yara-python-3.11.0.tar.gz
  • Upload date:
  • Size: 376.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for ak-yara-python-3.11.0.tar.gz
Algorithm Hash digest
SHA256 df8f7fc7f2237ee0ba3323be58578bb205361c224fab54012f04352109ef97d2
MD5 76d43c40038bc36e5aeb04a86d7a9bd3
BLAKE2b-256 6afe4803c51cfdb1f2c7696780b2918080b4e11df795bb005d5e3d96e6789d36

See more details on using hashes here.

File details

Details for the file ak_yara_python-3.11.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: ak_yara_python-3.11.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 595.7 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for ak_yara_python-3.11.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3f0d4204f12dc3b6fd38fe5fd62a1ffb6992089f6342cada7258d81a50e253cd
MD5 97667036ea485babff79726f87928aa5
BLAKE2b-256 7e7ec1151aaebe4e02465b9bd4bee3d27f3647ba71bde687f18a8dc5a4bdfbbb

See more details on using hashes here.

File details

Details for the file ak_yara_python-3.11.0-cp38-cp38-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for ak_yara_python-3.11.0-cp38-cp38-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 7a78279ce871bf9a3a2d14b6df385edad100bc98577701fe076ad4d6b312e325
MD5 20f37bc4327d7357b222b6505bda1b1c
BLAKE2b-256 f9772f5c64fdee3d0e643399ddcf28cde1b1acff903ce44e768ca8cc6c0cb4cd

See more details on using hashes here.

File details

Details for the file ak_yara_python-3.11.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ak_yara_python-3.11.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 594.5 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for ak_yara_python-3.11.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d76f2616c6c96811c847e20195ee167ba615d1170f5b9f5caacad70146591ca3
MD5 83d002963bf750198d2e1146a3fdb972
BLAKE2b-256 04af5ca427c56e7967f9c31ca55ed54c310979da9e6fab0ede357a5918d01fd6

See more details on using hashes here.

File details

Details for the file ak_yara_python-3.11.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ak_yara_python-3.11.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 593.3 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for ak_yara_python-3.11.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 40a8af2faff2b19b47fbab0d2753c2fafea705c1c5b9293aca10370636d0f36d
MD5 6887024efa63577d65652a4ab946e7d5
BLAKE2b-256 b3bc3e30fc617fc6d1e859c5eb23e56803fd0815d424fe251e2787f8e1b97658

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page