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.4.tar.gz (405.9 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.4-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8Windows x86-64

yara_python-4.0.4-cp38-cp38-win32.whl (745.8 kB view details)

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.7mWindows x86-64

yara_python-4.0.4-cp37-cp37m-win32.whl (745.7 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.6mWindows x86-64

yara_python-4.0.4-cp36-cp36m-win32.whl (745.7 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

yara_python-4.0.4-cp35-cp35m-win32.whl (745.7 kB view details)

Uploaded CPython 3.5mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.0.4.tar.gz
  • Upload date:
  • Size: 405.9 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.4.tar.gz
Algorithm Hash digest
SHA256 1801119f55ba166ef1959a6a3b0b729c6778db8a2875c9c2e52154f2f470da51
MD5 a79df92c508e1065b0152d1f11d0a874
BLAKE2b-256 c338063356a3eafa020366e65d67160e0ee537fa5ca88e22bb5ea54258443436

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.4-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.0.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a572d850ab612fdfca540a980cdf1494bb537b5c30e0da9e8bf1d9224d6207b5
MD5 6d79642717031950ae7732c375a07681
BLAKE2b-256 9611e8dad4a4372dea80fc7231d08628d739a04b514895be180abfb8d6d8bce0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.4-cp38-cp38-win32.whl
  • Upload date:
  • Size: 745.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.0.4-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 f0642d2210af666075a551cad6fbccab7e4d08c530c7df96692679f21ac45d3b
MD5 2aceba56f20b29bce09c741bd3816efd
BLAKE2b-256 b866cbf6096dd79e935162670d10cbcbcc69133b7a85f92e575c641052d6270e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.4-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.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 57779d476586dc4b58053a1421e6550785975fff52ad0e9091bb0c9deba21035
MD5 c5001bb8b7d0ecc645356ebb479f6243
BLAKE2b-256 17f40a7338ac55edcae234f702b13dbba9895a719174acd39952606845d1c290

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.4-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 745.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.0.4-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 8cdce1a3638ad47e4f4b2eec42ab4d4a0881a231d4e5a2380296a505ad64c35f
MD5 6f8bdfa5bca17daa269e8cee7b3a6425
BLAKE2b-256 4e8ccf6aa039fde96d0ae313180f7cad76daf0bc3c367466d6ae7b8448d82f86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.4-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.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f537e8c58c0e31a9c6bc1b4fa28d1467cc4abf1e7f5e55fc20ab4a179dc3971e
MD5 bbf23021ee458405c60fb60d99a752fe
BLAKE2b-256 c7f7dce423160bb42976cee87a056bd7f870bf718a1e097406526f2cf48eb501

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.4-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 745.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.0.4-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 8205fdc7e5db7659ecb3c9df639c4626f846ad55fbb3c19725db25c78e783bbb
MD5 1378e8750b49c5210bcb58fac3eca53f
BLAKE2b-256 23948b2fd09f004a0eab5116f69e7e6dee4b936d122294d271b1bbf8800f2e0f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.4-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.4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 fa9558ee92b7e9f006953297018faa7412b2e0d94549a5b86e7ba8bc4df2622f
MD5 86684c8c1d80bcefca15449e899734fb
BLAKE2b-256 3860c8fe0e62db71f730506406995d65300660cdb6b595fd46eeccda69553dfd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.4-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 745.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.0.4-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 d6a09a03fbdea362d3b733342252225fcf700f662edc7cd661cb0769c0069556
MD5 0776cf318b7c016ae818439a84dbf2a5
BLAKE2b-256 282d517e6711b18e4f0939fe18b94bd5626b73de899f593948418d81a52bae85

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