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.10.0.tar.gz (366.7 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.10.0-cp37-cp37m-win_amd64.whl (711.4 kB view details)

Uploaded CPython 3.7mWindows x86-64

yara_python-3.10.0-cp37-cp37m-win32.whl (618.6 kB view details)

Uploaded CPython 3.7mWindows x86

yara_python-3.10.0-cp36-cp36m-win_amd64.whl (711.4 kB view details)

Uploaded CPython 3.6mWindows x86-64

yara_python-3.10.0-cp36-cp36m-win32.whl (618.6 kB view details)

Uploaded CPython 3.6mWindows x86

yara_python-3.10.0-cp35-cp35m-win_amd64.whl (711.4 kB view details)

Uploaded CPython 3.5mWindows x86-64

yara_python-3.10.0-cp35-cp35m-win32.whl (618.6 kB view details)

Uploaded CPython 3.5mWindows x86

yara_python-3.10.0-cp34-cp34m-win_amd64.whl (689.4 kB view details)

Uploaded CPython 3.4mWindows x86-64

yara_python-3.10.0-cp34-cp34m-win32.whl (624.1 kB view details)

Uploaded CPython 3.4mWindows x86

yara_python-3.10.0-cp33-cp33m-win_amd64.whl (689.5 kB view details)

Uploaded CPython 3.3mWindows x86-64

yara_python-3.10.0-cp33-cp33m-win32.whl (624.2 kB view details)

Uploaded CPython 3.3mWindows x86

yara_python-3.10.0-cp27-cp27m-win_amd64.whl (690.4 kB view details)

Uploaded CPython 2.7mWindows x86-64

yara_python-3.10.0-cp27-cp27m-win32.whl (619.1 kB view details)

Uploaded CPython 2.7mWindows x86

File details

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

File metadata

  • Download URL: yara-python-3.10.0.tar.gz
  • Upload date:
  • Size: 366.7 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.10.0.tar.gz
Algorithm Hash digest
SHA256 2da1d94850cbea1dd9db1cc7d54bb36a69cd6a33bbc0caf003497b6a323e3e10
MD5 f0f9b9e0a8b6e75a7b83e5af3214dab4
BLAKE2b-256 1d93688492dcedbd57a9c0b4074aa47d39ac5f5e7411a8ce69b23e57a801e638

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 711.4 kB
  • Tags: CPython 3.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.10.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 0bf33b91e0dacaff8590631f6459fdb084271de4cb1d0ecbeff2401f9ae20d5c
MD5 735d0f91861d8a98dc9ce9ba40e2d06b
BLAKE2b-256 d741028e4dd242d28707e577bebe4d0dc76fb025cabc4a0489581ea1f60722d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 618.6 kB
  • Tags: CPython 3.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.10.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 fb74b068109ec359197abcabfe5d777e36aa7c42ed9bdec3c93de1c40c215b03
MD5 b1c927821be4b00a8abd8e5d6dc489a9
BLAKE2b-256 c65444e158626193f04c799b986192230d879093ed7701c718a570defbba9ce1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 711.4 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.10.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 0a81aef159adf9a233bf52168cb7ed63edd3213162c1e88aa234a252b46efcf7
MD5 ea199630ae12be386c8571b3feec9b1b
BLAKE2b-256 f3e8f3a18768541d576ae38f291a11e021f379fb3649fa3e21478adc782bdf7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 618.6 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.10.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 04a2a9e31668aa20e8ad4e3cd8273b9216391f0e98704ce6637758f644837f78
MD5 e5d90d0947e780a1484d5ae9a006c2ff
BLAKE2b-256 500db1df4f0c67b1f6d9fbc27311c7a214c6c5e00b9b9ca443b6936ebda78476

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 711.4 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.10.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 759e11705345d0bc429bedb59ce63ccdab1959f5ec44f6fbc1a24a59f224fd30
MD5 89aab043c5199aa0698f53a327d30131
BLAKE2b-256 ca5e559773b5c626a4a9ac03719ec4fac219511ed5f37713c03180a6b376ce5a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 618.6 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.10.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 7980282496d73d5854ead8d0cb134b1437bf1c6bf920bbe8dbafcaca0dc8a482
MD5 67ff01de1db8603c893facc660a662bd
BLAKE2b-256 f9b4a68bd29781bf9500a1a9cf17b1c50b85ef2427291e5e965e1cee86737f97

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp34-cp34m-win_amd64.whl
  • Upload date:
  • Size: 689.4 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.10.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 6266b2798a6d8df34182658e00556de9a73fcd5fa736a936a4184a0d7dffa41e
MD5 0df9e7fe70c3de1cd3078ba02026bd4d
BLAKE2b-256 a11354745351a2e7083301c79a4dc92d7649f6637860b16a81165be70595356c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp34-cp34m-win32.whl
  • Upload date:
  • Size: 624.1 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.10.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 71abafd7ae3fe30d2c5beb3ccdd6cb3a7f9a6f4edbc2d8f120ad40d4ff35383a
MD5 e10513a73e04378aa900e4089751062c
BLAKE2b-256 b1c78a5b6be128f536981792141356a96db6f0a7c01937c8d86bb37dd537062a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp33-cp33m-win_amd64.whl
  • Upload date:
  • Size: 689.5 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.10.0-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 cd4b6da645a210dab5beff948effbab2861d5620b2fcd3724f1182870154ca4d
MD5 c75a9a0fb35d2691f355331e7211cf96
BLAKE2b-256 338567a22d2cddc9225730877934a13f9c8d7a2a27057fdfa5de608daf19ad24

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp33-cp33m-win32.whl
  • Upload date:
  • Size: 624.2 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.10.0-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 16bbd479078f3cce33b4966c112913c0c9a7d22d0a63df23e06be5a84e51d5f4
MD5 30a066fe08c4a6ac01ccb3c0aa6d00d4
BLAKE2b-256 c4674e1c2bef1687726cd5556058ceaf92e339216a4b68a3e7d5193229022e9d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 690.4 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.10.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 024fb818ece339a378c562b3b49c28bf861b004ab5c57e488556d49bcd8ab76d
MD5 39496a2b59cb8cdab3c34afc27cf005f
BLAKE2b-256 25df17760aea417d926799ed83f1c0b14910d6552f3bffd94ca179ab4b77aa91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.10.0-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 619.1 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.10.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 c5385f28efd42ec615870f30572576b6e3cc12d08025178c9040979244e42eb3
MD5 dafe92ff8dd2c996887c35568b64f153
BLAKE2b-256 96a8ecbc6aa55107d915bd0685579b9ad9126c15eca3c0e0180268ee128b8f79

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