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.2.3.tar.gz (457.2 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.2.3-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10Windows x86-64

yara_python-4.2.3-cp310-cp310-win32.whl (758.9 kB view details)

Uploaded CPython 3.10Windows x86

yara_python-4.2.3-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

yara_python-4.2.3-cp39-cp39-win32.whl (758.7 kB view details)

Uploaded CPython 3.9Windows x86

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

Uploaded CPython 3.8Windows x86-64

yara_python-4.2.3-cp38-cp38-win32.whl (758.6 kB view details)

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.7mWindows x86-64

yara_python-4.2.3-cp37-cp37m-win32.whl (758.3 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.6mWindows x86-64

yara_python-4.2.3-cp36-cp36m-win32.whl (758.3 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

yara_python-4.2.3-cp35-cp35m-win32.whl (758.3 kB view details)

Uploaded CPython 3.5mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.2.3.tar.gz
  • Upload date:
  • Size: 457.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for yara-python-4.2.3.tar.gz
Algorithm Hash digest
SHA256 31f6f6f2fdca4c5ddfeed7cc6d29afad6af7dc259dde284df2d7ea5ae15ee69a
MD5 0580fe8bb4601336f2a4a63b23cbeaa7
BLAKE2b-256 a42bd36b6399027bb888faed23e3393f4efc3568996a5c386233b364d9e701d5

See more details on using hashes here.

File details

Details for the file yara_python-4.2.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for yara_python-4.2.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 26ec1042017b3c4e12d2999ed6a33d7807013ae16c487048464b98dabfe3a7b0
MD5 d8fe2189d6eaece8c11a361f678c2f0f
BLAKE2b-256 cef91e9ca361b37f360f17a908706b7cbab16ebd76f92f875d4ae3fa164ba466

See more details on using hashes here.

File details

Details for the file yara_python-4.2.3-cp310-cp310-win32.whl.

File metadata

  • Download URL: yara_python-4.2.3-cp310-cp310-win32.whl
  • Upload date:
  • Size: 758.9 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for yara_python-4.2.3-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 d7543ff7eb7e21a815d7bc1bf2fcca24cab3548184d3257c58916628f3c89b37
MD5 f9649ff4118bd07de92f45bafe3bc911
BLAKE2b-256 7298c71c4720b57fc318202e51ec8c6a6240a7d4894a3791870b17421fd14f97

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.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/4.0.1 CPython/3.8.9

File hashes

Hashes for yara_python-4.2.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 87125ede7fbc18ae65aab550f1a36f4ebf73bb828c5d7a3dd2bb99176f0faa15
MD5 e547615ed994a30dbe4b7849dcdcadeb
BLAKE2b-256 574e722e81d24456025ec2061a4ebf7d49a53b5017635f9d4f1ccbd350aec7af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.3-cp39-cp39-win32.whl
  • Upload date:
  • Size: 758.7 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for yara_python-4.2.3-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 d6c2de71b368da053599d734c031389815a70df4b667d6dc386d1335689717d6
MD5 02c1e0fcb2cbcbf615d015f8d2a4c8e3
BLAKE2b-256 184b6a3d9faf9f6f7562892dd1a8e3b98d183e5f5a3c4dfd88c62e5662e2040a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.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/4.0.1 CPython/3.8.9

File hashes

Hashes for yara_python-4.2.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9f17e0572c49906d0b2a8f6ac20fcb46f17820a7408a5511744a844df4b2ec61
MD5 1a20a85031ff2c60c3e3e9f28923f6b0
BLAKE2b-256 716ed50bdf0eb32279a18e62dcba8618505838cd4864914b698a2dec950a0c8e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.3-cp38-cp38-win32.whl
  • Upload date:
  • Size: 758.6 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for yara_python-4.2.3-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 90db22a471b512d1adb49cec97a1356a1cf7791beeb0acab74c3187f6e8679a6
MD5 6a05469d8dac7b31e5def18821b1c80d
BLAKE2b-256 f5c4cd661ce7b7527f41755f7b59be0e3bd46118ba7fabc1a038c5bd7acc92a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-4.2.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 feac02291a584b846615aa9265f01fa458ec7e7087317ffa679bbb1a2baec85b
MD5 0d3e23bfeb6aea627bb646ec715bed2a
BLAKE2b-256 a3d37fed4ad591b955da2c033ba09b821ebe4f9c0ae30ba2bacdab4f49375a1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 758.3 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for yara_python-4.2.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 bef2f079acd459b852c0634f72cd41058766110d8900573b2d55be12d35d55db
MD5 6f250f5d84395a6a0ab39832800c9114
BLAKE2b-256 89edddc00087a75877e7d5a4340f6f5d0d14513f6fc52d8f6538624342740dcd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-4.2.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 aaad4cd4495b7605cb4e039473710ee87a151082171c4bb720086adbe548fb36
MD5 f20b077515fc72ab21487178bc020f62
BLAKE2b-256 9dc60a1b895a17b9553eecb85bed1d1182cbccc9c71f93dbfd694c14e354c5f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 758.3 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for yara_python-4.2.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 98040aa88d242632c75be87ac3a9958eb407ca30e85b513b9e22807af82ab1c8
MD5 ccfc66d5c085708231197d0d5da179d3
BLAKE2b-256 a558832ba0539e808c7e727a7a866d8c72cc1e5abe3fd48e5f281aed358d5502

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yara_python-4.2.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 113f430c5189519e13fc07d8493e3f29a1464a9be06eb7ba1b76451da620a391
MD5 eb3466dedd8181af0d6884840948af3b
BLAKE2b-256 116b31ae8736bdb83394c8b691e93b122acb0d2a129aeee02515a33cbef62993

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.3-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 758.3 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for yara_python-4.2.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 47a7de4d7dae04e5e146b79f26b7f0b7e9430cb92459b85db7f4341843974aac
MD5 37ce1c3d097253a115679576b8c8b186
BLAKE2b-256 399f840e9ba5b8399240f1d9c5717326a118ff87d98d7b8064f808bc361c9f3b

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