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.8.1.tar.gz (355.5 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.8.1-cp36-cp36m-win_amd64.whl (708.8 kB view details)

Uploaded CPython 3.6mWindows x86-64

yara_python-3.8.1-cp36-cp36m-win32.whl (617.4 kB view details)

Uploaded CPython 3.6mWindows x86

yara_python-3.8.1-cp35-cp35m-win_amd64.whl (708.8 kB view details)

Uploaded CPython 3.5mWindows x86-64

yara_python-3.8.1-cp35-cp35m-win32.whl (617.4 kB view details)

Uploaded CPython 3.5mWindows x86

yara_python-3.8.1-cp34-cp34m-win_amd64.whl (689.1 kB view details)

Uploaded CPython 3.4mWindows x86-64

yara_python-3.8.1-cp34-cp34m-win32.whl (624.4 kB view details)

Uploaded CPython 3.4mWindows x86

yara_python-3.8.1-cp33-cp33m-win_amd64.whl (689.2 kB view details)

Uploaded CPython 3.3mWindows x86-64

yara_python-3.8.1-cp33-cp33m-win32.whl (624.4 kB view details)

Uploaded CPython 3.3mWindows x86

yara_python-3.8.1-cp27-cp27m-win_amd64.whl (689.7 kB view details)

Uploaded CPython 2.7mWindows x86-64

yara_python-3.8.1-cp27-cp27m-win32.whl (618.4 kB view details)

Uploaded CPython 2.7mWindows x86

File details

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

File metadata

  • Download URL: yara-python-3.8.1.tar.gz
  • Upload date:
  • Size: 355.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara-python-3.8.1.tar.gz
Algorithm Hash digest
SHA256 8c76531e89806c0309586dd4863a972d12f1d5d63261c6d4b9331a99859fd1d8
MD5 ddb97e4f2f08f1ba74ca4747c9ed7d26
BLAKE2b-256 a630ab9cf60194ad9fdc0d134f4621de4cad0d8b3e6fdfa990c8b06676d901ff

See more details on using hashes here.

File details

Details for the file yara_python-3.8.1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: yara_python-3.8.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 708.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 a48e071d02a3699363e628ac899b5b7237803bcb4b512c92ebcb4fb9b1488497
MD5 ac7957898fecf26c24e3a00228bff7dc
BLAKE2b-256 c66bb900894f9c9bf9aaa9d8054d6ad5be5b3e03e83efb38451dbfb9ee8020b7

See more details on using hashes here.

File details

Details for the file yara_python-3.8.1-cp36-cp36m-win32.whl.

File metadata

  • Download URL: yara_python-3.8.1-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 617.4 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 9735b680a7d95c1d3f255c351bb067edc62cdb3c0999f7064278cb2c85245405
MD5 5ac1f842797a60f99263d56e326bab09
BLAKE2b-256 e90f602ef4059aa0d817f4ad7f8865357e0db2a843dcafe1ee912246229772ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.1-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 708.8 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 b67c0d75a6519ca357b4b85ede9768c96a81fff20fbc169bd805ff009ddee561
MD5 a58b52bb8ae3ba306515f770f42aabcf
BLAKE2b-256 4c62635a04591b26fc5222c4ee16cac0b3d9eca4c97cfcf766f29d0a179afc39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.1-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 617.4 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 997f104590167220a9af5564c042ec4d6534261e7b8a5b49655d8dffecc6b8a2
MD5 d04eba5f0d14599616f4ffcbc09228c9
BLAKE2b-256 e912554eccfed154277de5b062c6aefff3adf1965b16322d85bf8658881934e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.1-cp34-cp34m-win_amd64.whl
  • Upload date:
  • Size: 689.1 kB
  • Tags: CPython 3.4m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 7cb0d5724eccfa52e1bcd352a56cb4dc422aa51f5f6d0945d4f830783927513b
MD5 1b613e767753d3c75a4c7a829a561f47
BLAKE2b-256 3d0e16f67963f558bf11c3e4faeab41d9b49e6fe87ae070bd3095133d364196f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.1-cp34-cp34m-win32.whl
  • Upload date:
  • Size: 624.4 kB
  • Tags: CPython 3.4m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 0a0dd632dcdb347d1a9a8b1f6a83b3a77d5e63f691357ea4021fb1cf1d7ff0a4
MD5 16478fa7af6fb7dcc603124d1c55ac7b
BLAKE2b-256 43d4b913be0ba7a5261a71bcbb7b3929f62b2f87b3fbb5138fbb69120c03d869

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.1-cp33-cp33m-win_amd64.whl
  • Upload date:
  • Size: 689.2 kB
  • Tags: CPython 3.3m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 0423e08bd618752a028ac0405ff8e0103f3a8fd607dde7618a64a4c010c3757b
MD5 f362f93360e39ae2615d947b3108c2d0
BLAKE2b-256 869cf8bfd8fff97171e37ae0d02aa23f49379056cc417b6e795aae1838d32842

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.1-cp33-cp33m-win32.whl
  • Upload date:
  • Size: 624.4 kB
  • Tags: CPython 3.3m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 728b99627a8072a877eaaa4dafb4eff39d1b14ff4fd70d39f18899ce81e29625
MD5 43b360b33d51f40a2c7348e006724b12
BLAKE2b-256 9ff18258325ea4c709fe7bc54b7c50776585b1498bf130700749931506eef063

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.1-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 689.7 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 9472676583e212bc4e17c2236634e02273d53c872b350f0571b48e06183de233
MD5 aa0224456631332b480cd8f67a3cec49
BLAKE2b-256 104175273be09cfc93311c3276046e4759ab205aa90aa09f773f20ec22b80463

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.8.1-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 618.4 kB
  • Tags: CPython 2.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/18.5 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.10

File hashes

Hashes for yara_python-3.8.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 03e5c5e333c8572e7994b0b11964d515d61a393f23c5e272f8d0e4229f368c58
MD5 19378c23f1ba191f6ee7a838a0b2cdde
BLAKE2b-256 916c7f39e7ae3e2011f83d75e65534d65ca1be7bed7f80aef07d10f1dce65b3f

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