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.0.0.tar.gz (405.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-4.0.0-py3.7-macosx-10.14-x86_64.egg (156.7 kB view details)

Uploaded Egg

yara_python-4.0.0-py2.7-macosx-10.15-x86_64.egg (138.8 kB view details)

Uploaded Egg

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

Uploaded CPython 3.8mWindows x86-64

yara_python-4.0.0-cp38-cp38m-win32.whl (747.6 kB view details)

Uploaded CPython 3.8mWindows x86

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

Uploaded CPython 3.7mWindows x86-64

yara_python-4.0.0-cp37-cp37m-win32.whl (747.4 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.6mWindows x86-64

yara_python-4.0.0-cp36-cp36m-win32.whl (747.4 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

yara_python-4.0.0-cp35-cp35m-win32.whl (747.4 kB view details)

Uploaded CPython 3.5mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.0.0.tar.gz
  • Upload date:
  • Size: 405.7 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.0.0.tar.gz
Algorithm Hash digest
SHA256 44d62b25605f45a26879375bf0d90275719e6fddc7a9fbb7ca208e425eab14a4
MD5 8e48e139406c1dc7f41b33236c7d4292
BLAKE2b-256 901efcd5c1fb3fc66290cd0fce9d5cfd8c972bd1edf3138e08c775c2f9963717

See more details on using hashes here.

File details

Details for the file yara_python-4.0.0-py3.7-macosx-10.14-x86_64.egg.

File metadata

  • Download URL: yara_python-4.0.0-py3.7-macosx-10.14-x86_64.egg
  • Upload date:
  • Size: 156.7 kB
  • Tags: Egg
  • 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.0.0-py3.7-macosx-10.14-x86_64.egg
Algorithm Hash digest
SHA256 fb074aac3625975add42521b392edb257409c06c362c64523a5feedf3fcc4380
MD5 2e8aaf3044c85366f424645962576948
BLAKE2b-256 d58895990a8a3ec6716e0b6f980425406e3d813f5a343de6b9a2b391531188a0

See more details on using hashes here.

File details

Details for the file yara_python-4.0.0-py2.7-macosx-10.15-x86_64.egg.

File metadata

  • Download URL: yara_python-4.0.0-py2.7-macosx-10.15-x86_64.egg
  • Upload date:
  • Size: 138.8 kB
  • Tags: Egg
  • 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.0.0-py2.7-macosx-10.15-x86_64.egg
Algorithm Hash digest
SHA256 b3e1ba9fd920cfa5d46fe8ab455057a17934e03aec649ac75bcc384522feddaa
MD5 1d98931a88eb618a6fdc39b19cdafa45
BLAKE2b-256 06c06799bb1546edab21cdf3feadf91ae91268418135acbcac0a647beac19e31

See more details on using hashes here.

File details

Details for the file yara_python-4.0.0-cp38-cp38m-win_amd64.whl.

File metadata

  • Download URL: yara_python-4.0.0-cp38-cp38m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8m, 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.0.0-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 210b5c79ceec1a9b43b780e36580ecad8f5ce8955a93a1253efc2090432294f6
MD5 8b62566f3ae15ecae0c22e71147198e2
BLAKE2b-256 c114d8eb4b51d3761f9cad356bc5deb3c3efc6447f8af1e9c9617cb2edbd9130

See more details on using hashes here.

File details

Details for the file yara_python-4.0.0-cp38-cp38m-win32.whl.

File metadata

  • Download URL: yara_python-4.0.0-cp38-cp38m-win32.whl
  • Upload date:
  • Size: 747.6 kB
  • Tags: CPython 3.8m, 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.0.0-cp38-cp38m-win32.whl
Algorithm Hash digest
SHA256 8e9ce8ef327f9d929b382bc3c995b0a8584468e342b3e8803a0afc35c790a11e
MD5 9e7dc1ab97fcff4c49fc3fa73eabb994
BLAKE2b-256 136aa07201e6703a1e24320c6d63e6ed2d15af4a3b5381bb0bebda5660cfa460

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.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.0.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 71585d01c34cc6aa26f713e9606da5860f0743a70cbcc0a698e86a3f9306d9b9
MD5 290b39e9667581522a80b09d2c3e425d
BLAKE2b-256 d7ab1cad8bb2b4793078143ff412bf077fa4515e895883d9e83c0b795edb8b53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 747.4 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.0.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 67a695feeacd12e85682a334c2062751cec508c7cd7906d8ff5c0185e7e34e48
MD5 31c09d8ec7c6722b76aea9920af55560
BLAKE2b-256 a7bffe792c5ee42948496cffc8d562075327b9ad90550b552fc6a3a34db98300

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.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.0.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 aa6e179b7f05267eb9806df153bb09e77836fafd8060c3dbf0be45332843589d
MD5 7143563b110c8b40248e0c0ebef15679
BLAKE2b-256 de44e45922cf9b15aff7a64c40a2bfc22073fcb2624f198052c1faa8ea747ae0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 747.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.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.0.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 e9664e988d9ef3dbfb18a8f5dd9789ce39114da24b4f0696bbc159d7ed9b48a0
MD5 c79a07c8770add37d22fb1c742bca3cd
BLAKE2b-256 abdca582fd53b9a97ed752f395e3cd4d04684749e28abc4c2a94962494800e88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.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.0.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 5b64a413911772b2e203952a148aa912c3c383cc66c8e322a8f85cabc894967f
MD5 99539ecbc19b12c13e3657e45fca24ed
BLAKE2b-256 6df94f5053736d8b2102b6d60813a9fd8f3ccb6eb2371e41a662c161d9ba1034

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 747.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.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.0.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 e73f0d317fac43136638a288817ecd49b045d7d28059758285637fd9425c5c53
MD5 7829a61bb9b68991c2e0d735b7fa81f5
BLAKE2b-256 a427b4a2b9365697869ea6431282ff6068424918f8206fdc0ec20b2d1ad3fafd

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