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.11.0.tar.gz (376.8 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.11.0-cp37-cp37m-win_amd64.whl (713.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

yara_python-3.11.0-cp37-cp37m-win32.whl (621.1 kB view details)

Uploaded CPython 3.7mWindows x86

yara_python-3.11.0-cp36-cp36m-win_amd64.whl (713.0 kB view details)

Uploaded CPython 3.6mWindows x86-64

yara_python-3.11.0-cp36-cp36m-win32.whl (621.1 kB view details)

Uploaded CPython 3.6mWindows x86

yara_python-3.11.0-cp35-cp35m-win_amd64.whl (713.0 kB view details)

Uploaded CPython 3.5mWindows x86-64

yara_python-3.11.0-cp35-cp35m-win32.whl (621.1 kB view details)

Uploaded CPython 3.5mWindows x86

yara_python-3.11.0-cp34-cp34m-win_amd64.whl (691.6 kB view details)

Uploaded CPython 3.4mWindows x86-64

yara_python-3.11.0-cp34-cp34m-win32.whl (626.7 kB view details)

Uploaded CPython 3.4mWindows x86

yara_python-3.11.0-cp33-cp33m-win_amd64.whl (691.7 kB view details)

Uploaded CPython 3.3mWindows x86-64

yara_python-3.11.0-cp33-cp33m-win32.whl (626.8 kB view details)

Uploaded CPython 3.3mWindows x86

yara_python-3.11.0-cp27-cp27m-win_amd64.whl (693.0 kB view details)

Uploaded CPython 2.7mWindows x86-64

yara_python-3.11.0-cp27-cp27m-win32.whl (621.9 kB view details)

Uploaded CPython 2.7mWindows x86

File details

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

File metadata

  • Download URL: yara-python-3.11.0.tar.gz
  • Upload date:
  • Size: 376.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara-python-3.11.0.tar.gz
Algorithm Hash digest
SHA256 24cd492d6bf8ecedb128f5b02886770be9df03bd1b84ab06a978d45bb1a8ff92
MD5 d85bf317b504b5ffba9f0ab1f30a0825
BLAKE2b-256 7936349593ae9f4e52fb1cad5576d3915f1394cc09661f1260e4d8abbdb4db76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 713.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8d255349d69d833bca604b4215bdf499c87357172512273feb934f6442b8e6b2
MD5 8e73dced7635f529110ae68fb41b90b3
BLAKE2b-256 0b5ddca9722886d14b3f71e4dd4848c5b1663976a34094e002433f37e8c984d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 621.1 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 1d35c7f606465015de02143dfa4e1ad2f4ee85fdb5d5af756b51b2bac62ac7bc
MD5 796272738942402bef351657454eeb04
BLAKE2b-256 1d922aba24fc5cebf0e214e47f3e9e258768a3650f8c29af5e5ee163fd00186e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 713.0 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 6f90bb264470235549e1bb4e355fa82895409cd46f27aceecaddfbf55e66ed71
MD5 6036fee66803ff20be7fd033adb2d9e9
BLAKE2b-256 757b5e7667fa3142d4d7a903f04612dbadf826181e317c00a7f46e0bf566a36a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 621.1 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 e4124414d3cff9a10669569a89f585f81c8114b283ab48b2e756e0347a89de0a
MD5 220746efe2e35bce6657751511e72acc
BLAKE2b-256 5dd63a9602f9afb145b24559762555b97f71e14f015ee7322bcb453198bb3138

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 713.0 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 105d851e050b32951ee577148c7f1b18c0a7c64432fef8159069191d522fba86
MD5 1c03700b1b0da3ee588e7b111e346868
BLAKE2b-256 c46951ce13d4e8926e21c029afadf05842b3e85a368ba303e813475bfc4b587c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 621.1 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 58cfc837e7769811afbfb19b1db952ec01e50cdbf9df576fb587e1e343694526
MD5 295b48d6dbadc30cb47f00fe8860218b
BLAKE2b-256 7af0a6e9df070a90ee0d594b8ac190f1c3b9d260ae6afd0031cd6ddd888c862c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp34-cp34m-win_amd64.whl
  • Upload date:
  • Size: 691.6 kB
  • Tags: CPython 3.4m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 f104f0bb21a0867f22e750bb4e05de629ec9f37facc84daf963385a86371b0d9
MD5 da9397e625972e5d0599e71300a07188
BLAKE2b-256 e10589be04beb63fc8d5ed5b23efac3491323e47267086415b1869ff6f4d8230

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp34-cp34m-win32.whl
  • Upload date:
  • Size: 626.7 kB
  • Tags: CPython 3.4m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 5b8d708751a66d1507d819218d06baccdf5527c147c2bd3062f087e2f367a17d
MD5 6e29deee0d3a7200419d561d2264b923
BLAKE2b-256 ad9f369dd48f356579018b8d41c1a4043ca5f0a82c4dae448501a9c08f29fcd0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp33-cp33m-win_amd64.whl
  • Upload date:
  • Size: 691.7 kB
  • Tags: CPython 3.3m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 c919ee656139ed46a0056e8a3de179bbc98d42a2be6fb85c95b1e2ec65396b34
MD5 bead1a42c2e624723553226cb5873151
BLAKE2b-256 8fefeecbc98f549ad7c6a6ef2e802a1ad9c171d35332d5646eec93422b8f4dbc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp33-cp33m-win32.whl
  • Upload date:
  • Size: 626.8 kB
  • Tags: CPython 3.3m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 9e4fafc327e3a343c545dcf5f173fa8bc712aebffe5f034d205c0bac1f1c5df6
MD5 e96e2f67448ee1b4754d2d5e7a635111
BLAKE2b-256 27b07953da85a20facda3fc340bb64393f8b8f1f271c02c5f09680f8d3b92c67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 693.0 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 70d39c2238c5854e7cd8f11595317dc4d89417e88035d8acca24bcc58a93150f
MD5 038e286a8a06771b59e0ae65a05598cc
BLAKE2b-256 eaa5bf7ae2555e01d9ebace494aa55a1a9b9dd8fcaac817b52a62b58ab7e5a07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-3.11.0-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 621.9 kB
  • Tags: CPython 2.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yara_python-3.11.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 8e44f9600607cb1d74a0f26df5d0a1c06ea54f4601206124f47f1bbb58e6a374
MD5 a8d096b87dbebde32509290afcd3d64b
BLAKE2b-256 195e035622a6d02b84cb5e84844215f119b44d55e686f80c317165a2677d5fb5

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