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:

$ 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.1.0.tar.gz (425.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-4.1.0-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

yara_python-4.1.0-cp39-cp39-win32.whl (752.2 kB view details)

Uploaded CPython 3.9Windows x86

yara_python-4.1.0-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8Windows x86-64

yara_python-4.1.0-cp38-cp38-win32.whl (751.8 kB view details)

Uploaded CPython 3.8Windows x86

yara_python-4.1.0-cp37-cp37m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.7mWindows x86-64

yara_python-4.1.0-cp37-cp37m-win32.whl (751.7 kB view details)

Uploaded CPython 3.7mWindows x86

yara_python-4.1.0-cp36-cp36m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.6mWindows x86-64

yara_python-4.1.0-cp36-cp36m-win32.whl (751.7 kB view details)

Uploaded CPython 3.6mWindows x86

yara_python-4.1.0-cp35-cp35m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.5mWindows x86-64

yara_python-4.1.0-cp35-cp35m-win32.whl (751.7 kB view details)

Uploaded CPython 3.5mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.1.0.tar.gz
  • Upload date:
  • Size: 425.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara-python-4.1.0.tar.gz
Algorithm Hash digest
SHA256 f5d95c4dd5d954972a06aadcf59aa2f427c5593376dcf550b349a09106c2dc48
MD5 d4df55e94aa1d55d2d63653ac4977c62
BLAKE2b-256 10406647bc7d16819d5a6fe27bba5dba15c4d6c35eb9bbb7b535cec62fa7f89f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 7dd2aaf0c0bb8d8399d74b60bbb23cb90863ae4faf2d22fb72141b7884daa618
MD5 0bd873e6fa2e1c731636cf931c0aa93d
BLAKE2b-256 7aea1143d22c6f601f69dc05b41e6686f58aec2aa7b372316670ddce1a380085

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 752.2 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 27f3b563630fbba5f53c5ace4cf524104aa41159abf76f8dd08a4e7c95f5dcd3
MD5 ba8207e2fab9f35cdddd7d8b7073f55e
BLAKE2b-256 a2827ce5db451c66902cbe153843f70f960014f3033f39d41ed9f532d90a7613

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 1fdef9272aadf92f0a24eb83b748c20e6d019da113ac45d2363e1760866caee4
MD5 f1814fed0caa3dbecce4c7ae8b98385b
BLAKE2b-256 10922dc817e16775b9ef4da0c4e7c21d7c4bc75f2ecbf0f9a1379b8e1ab08cbd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 751.8 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 71fa094c07298264fa334e6137f05eda00ff973610999aad741896638d82a70c
MD5 f0961f825318f3bb392a49053e1467b9
BLAKE2b-256 79cdd07ace5343cfa54659447b66bf2dbe6090e8b3f93a484aada3093c28b4ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f00eaa7861833148912f0f80b4a1a6d3bbf39d59a4b1ace7be2d5e56b484177c
MD5 271c14d46d8fabfd8114cd8f45de23c3
BLAKE2b-256 61ce20c49a3cab398a7ca70bd447badc9c5a75bfb94770b8f8b1a49a34f34c4d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 751.7 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 082df8e6cd4e61f67019846961096045d235cf7a4c05db1677452bfdd66c068b
MD5 caa999eb647e7bc3585d6b111fcf69a3
BLAKE2b-256 79790908478fbac70d87339f9e1bd32942793679dd7c45753c3ea5e65647cc3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f7fa1776106bcb870a9ef604ae17f45b58bb69a0a60ccde46a1bb08529117bbd
MD5 14621395fa830ec30c38859f78d45099
BLAKE2b-256 a1320744b61450a5b358c0a58942b04f89651218380aa78892c0559bc7124efb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for yara_python-4.1.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 11bc15b4a3ffce7adb59fc75963fd74a6c462174a85c5cdbb7add5dabb838657
MD5 e29fab481f28a48a1229cfcbd88cd098
BLAKE2b-256 4620a92ecd2b468949970ef59ef42ab53833b35502b1b53193281ada55752d4a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.16

File hashes

Hashes for yara_python-4.1.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 3c5603ba2ee8297725e17dfad5942872636d105f588543c12d0ff69f19dcb86f
MD5 6b3de4958774169f4fd18268e3f4c585
BLAKE2b-256 ab5af51ff09393a44424038cea1a9ed9b9b4b1ac700f7ea6dec28b396a25154e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for yara_python-4.1.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 9a9640f3628870fbccd4d6887d6b2cf70ebc8d29085bdf245215d00221a58c6d
MD5 2ebed1e1d96543c00985d33407332760
BLAKE2b-256 6ebad7e7b28d6027a5d988b9c6e61c7237cac6903df1d40c246afef1b5cd3f17

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