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.3.tar.gz (426.3 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.3-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

yara_python-4.1.3-cp39-cp39-win32.whl (752.3 kB view details)

Uploaded CPython 3.9Windows x86

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

Uploaded CPython 3.8Windows x86-64

yara_python-4.1.3-cp38-cp38-win32.whl (751.9 kB view details)

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.7mWindows x86-64

yara_python-4.1.3-cp37-cp37m-win32.whl (751.8 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.6mWindows x86-64

yara_python-4.1.3-cp36-cp36m-win32.whl (751.8 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

yara_python-4.1.3-cp35-cp35m-win32.whl (751.8 kB view details)

Uploaded CPython 3.5mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.1.3.tar.gz
  • Upload date:
  • Size: 426.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara-python-4.1.3.tar.gz
Algorithm Hash digest
SHA256 348d80039c3b499ad8ec9ce02ceaef0c1d5b7282b84e3b6fe6adb6a158c8e0cf
MD5 acb778ce6d848a8c0993a939b43f80fa
BLAKE2b-256 bb52792913c765ea17bdaf3d91fb2b358a337acf8403079b57329c41f1848213

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-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/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4159c2ffe6855b8e608e1b6728a80088e2edef31f23d7c8204ce43948ba2ea9b
MD5 32c192752833c541d639f3b28992f57d
BLAKE2b-256 485c20d506d275d1331e8364a409fb9bb1bd22da42db297e910f0f717a85404c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-cp39-cp39-win32.whl
  • Upload date:
  • Size: 752.3 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 6bec7be7fdd1d91f89113cb244c2d890431b51e8411480a649d754188e4bbabc
MD5 aea8c503338d39b140d590a9e06c37c6
BLAKE2b-256 bd1a1c74cd27f7181bc63a5ab634c246a013c2df8d82e3ac711af87636883aa9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-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/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 352536454b1d415a132298d6cf8acbafa94d3f55576962a5b688dd41d0fb03e6
MD5 3b5248729db662f55c506c4c7fff2d74
BLAKE2b-256 41ed2450bf80480fd806194680f6abb238ddb2f8d2301750225d58e9e1e2145e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-cp38-cp38-win32.whl
  • Upload date:
  • Size: 751.9 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 0dde7a7458dd519e49c3c64a46dc3d1b4f614d27455f2669d4e113ff02ba6c66
MD5 08715c543b7fa2da90f4f68c1053961e
BLAKE2b-256 24e888964160f93139f0920ed9a60d723e6213eb6ec62f6c965af9d40c011d86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-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/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 da1423fa7d52498e8cb4d3c9bd1ad3237281c2aede82adbdcc8ce5a9b7fcfb7c
MD5 fa1dc100ad553bc4383e68ce8a355bff
BLAKE2b-256 1642a5951db2e6db2ea1149f57220e0b1945798f320f9101563b18f7da5af393

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 751.8 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 f89e514615b49998c27a92876a37cc57dc3c7fa9f163d5c2ea50176d7f9596b1
MD5 652ec172b66a4261b385fddf8534c96c
BLAKE2b-256 10182f2b51e50fefb074eb2c2f902ace1cb83d9a32961a28d5042a231a5cad13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-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/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b0d2ad9f7dba273b96214edc99b24cf622babe1d74af9205f82221a3a6dfdfa7
MD5 e2a572335f1cafa78d0cdaa3e041090a
BLAKE2b-256 8a3d183284d5caf023404827950feb30dde2c72af3d4a8fb9b7c8b3343dde80a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 751.8 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 79964f785ce567fe51a7f76874a8d737b8e64e414a43437289b39a17bf087165
MD5 5b70795199f98b59cf4093e9f229b9af
BLAKE2b-256 b782ece3be52dbcc0803c4a7dc2a43ae2f5cda5fd93c5247ad875d319a7efa40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-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/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 9ae9a523006fe32f46ad2144d0391fdcba1d4fb6de77437898816546e9290dd0
MD5 aae7848ae1270bacc2793b31f038c207
BLAKE2b-256 1d07c629b0fb431033e106323326e692f4fd2fd5e7488078b607dda64b154a1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.1.3-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 751.8 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for yara_python-4.1.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 ecfa95fa1e2cc4114e6043ee7760590eaf094bd83e0784bb0fd5d438899934c7
MD5 484dd48b45be3e96cf40ba3810e4905b
BLAKE2b-256 d62cd555b21d11eba8871963b488e4eae503147f68030bced5a65387cf2d593b

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