Skip to main content

Python interface for YARA

Project description

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:

$ python setup.py build --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-4.3.0.tar.gz (538.0 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-4.3.0-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10Windows x86-64

yara_python-4.3.0-cp310-cp310-win32.whl (811.0 kB view details)

Uploaded CPython 3.10Windows x86

yara_python-4.3.0-cp39-cp39-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9Windows x86-64

yara_python-4.3.0-cp39-cp39-win32.whl (810.9 kB view details)

Uploaded CPython 3.9Windows x86

yara_python-4.3.0-cp38-cp38-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.8Windows x86-64

yara_python-4.3.0-cp38-cp38-win32.whl (810.7 kB view details)

Uploaded CPython 3.8Windows x86

yara_python-4.3.0-cp37-cp37m-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.7mWindows x86-64

yara_python-4.3.0-cp37-cp37m-win32.whl (810.5 kB view details)

Uploaded CPython 3.7mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.3.0.tar.gz
  • Upload date:
  • Size: 538.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for yara-python-4.3.0.tar.gz
Algorithm Hash digest
SHA256 3f85ec4730e4a337c217f96227307e625aa47fc3b5aaaa54da996f6d35c9bc42
MD5 bc938ba9b795438df3d9b235188dd2bb
BLAKE2b-256 47c523148d89227e8f2fa01d3b65094cddd36689c2aba9d6f63f8baff633138d

See more details on using hashes here.

File details

Details for the file yara_python-4.3.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for yara_python-4.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e8e425b0c9872beb54ea521d93496b6792676dd75f78635447d5d452c447a19d
MD5 0945cdbc86b5a02e57f3db0b728ab8c5
BLAKE2b-256 0372e123b00705799ba0b48d9eb70722aea14d9351a32621101e7799b9ea0ce2

See more details on using hashes here.

File details

Details for the file yara_python-4.3.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: yara_python-4.3.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 811.0 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for yara_python-4.3.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 5f7b1d0942e0622e29546bc8b9d8be48158401ef9e33921579dfaa0b225decf9
MD5 da93dc241f616a983bb2e0a824a0cd21
BLAKE2b-256 3b75f9850fd3dde889ac20bbaeca24ba657d59864aaef14be20297253eb56a2b

See more details on using hashes here.

File details

Details for the file yara_python-4.3.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: yara_python-4.3.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for yara_python-4.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 031b0028dc90e24d0f6a2df75e295a7ad696263a9b3a33eac7ab81644914fa00
MD5 a11b44e5750f4654363e29def37771f7
BLAKE2b-256 7bef964cb3c02724427f942f945d79c6912cf08461f9213cfaf7c10d23abf5d9

See more details on using hashes here.

File details

Details for the file yara_python-4.3.0-cp39-cp39-win32.whl.

File metadata

  • Download URL: yara_python-4.3.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 810.9 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for yara_python-4.3.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 4a628a70ca3a64d4d3bc462a46b4a5bb9495483e26452b1efd86d6a1d206afe7
MD5 8a5177d8353a1023cae282a39e742b3b
BLAKE2b-256 7e58e219b86b4d284aad660172e16f6a912f6cdb1aab0a3db90eaafd7000d578

See more details on using hashes here.

File details

Details for the file yara_python-4.3.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: yara_python-4.3.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for yara_python-4.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 76b26290bcde90282ab81a1df1bb5bf62951bad29f1e26a472bb9d3947266d3f
MD5 4110ba03e6d76955fa92cbaeb9de614d
BLAKE2b-256 007a186a907bce735144eb833ad0fd7713d2ca120db61075334683135afe3b3d

See more details on using hashes here.

File details

Details for the file yara_python-4.3.0-cp38-cp38-win32.whl.

File metadata

  • Download URL: yara_python-4.3.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 810.7 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for yara_python-4.3.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 58c1a503a6ddf90c53220f7c63e20708fe19815c1b89ec01f1dcac6387fd1c44
MD5 f1ed79e06e8491058cccb6b66e064879
BLAKE2b-256 a80a91f68dcd852d4be4fa93f964808fe2f6c20e865355f8cb9148c1511058c6

See more details on using hashes here.

File details

Details for the file yara_python-4.3.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: yara_python-4.3.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for yara_python-4.3.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 fec53ddbae529b2429568af783f73ae6aaf6b140b18910885b7515f6981d5691
MD5 72afb9019759d94e78c8aa008a95e058
BLAKE2b-256 47e8e8ad6b29795ee1a79255e3ae0423b4804b0d04a586914f26fa6d4f3acb99

See more details on using hashes here.

File details

Details for the file yara_python-4.3.0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: yara_python-4.3.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 810.5 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for yara_python-4.3.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 84f012361a762262777e35a763b38d2728bf0023d4d0cc547d2f919692cc937c
MD5 00030651c82327c29290bfb2890bf85c
BLAKE2b-256 4e66f18228f3f683db5fbd08168ead7e27240dc7681a27dbf7775fdb1837cea0

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