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

Uploaded CPython 3.10Windows x86-64

yara_python-4.2.0-cp310-cp310-win32.whl (758.6 kB view details)

Uploaded CPython 3.10Windows x86

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

Uploaded CPython 3.9Windows x86-64

yara_python-4.2.0-cp39-cp39-win32.whl (758.5 kB view details)

Uploaded CPython 3.9Windows x86

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

Uploaded CPython 3.8Windows x86-64

yara_python-4.2.0-cp38-cp38-win32.whl (758.2 kB view details)

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.7mWindows x86-64

yara_python-4.2.0-cp37-cp37m-win32.whl (758.1 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.6mWindows x86-64

yara_python-4.2.0-cp36-cp36m-win32.whl (758.1 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

yara_python-4.2.0-cp35-cp35m-win32.whl (758.1 kB view details)

Uploaded CPython 3.5mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.2.0.tar.gz
  • Upload date:
  • Size: 453.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara-python-4.2.0.tar.gz
Algorithm Hash digest
SHA256 d02f239f429c6c94e60b500246d376595fbed8d9124209d332b6f8e7cfb5ec6e
MD5 af223eda0d8f8416e0add1f7bfb8612e
BLAKE2b-256 c9d9f0e15174adae818a8dd9bb5989a8343abc3a1df29757c5b1f00aecdd1276

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 76f711603de6a66a42be4501219288353397b032d6239b01a34e2bbcce4a2e50
MD5 9fc4eb1c2b9277ad8fa4c2d8c10e54ab
BLAKE2b-256 2cc8f3efcb654e76dc87e665dedb5853b8de94d82da91141794b38b4c5a5a71c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 758.6 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 1faec6480be87964056ac19cddae052da4c88755426c81c83bce53ed7d57ebfe
MD5 2e900f66e17178797df282e24cf7fa03
BLAKE2b-256 b7980400b4daec2d3b131441c2ee64f8ccd9fd54608c08ea2292509034f86cc0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.0-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/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a92dc977e5e6add276ebdf5c8e0ddae7a79a85993c407a9c1d198dab518116e6
MD5 a0936f7135e14a5eec005a6e3d3b6c30
BLAKE2b-256 4ad9c3cd87f1460805d91ea29af1953d79a7e108e669015fc7c02e17e97a4e67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 758.5 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 e5adfdcf01e2cc6bc07603eaadb314cf3515cab577e529db86c4de7bf9b327dd
MD5 9b7dd3598105417c34ef62b50539d8e4
BLAKE2b-256 b9eda29760b48d58a70e5a6667e845abe5f1dfe9ba15adb59070330192709e19

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.0-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/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4853d0bf9a320fd98f5a0beb94eb651639073f8ccc2e2f40c132c66f3ed64d74
MD5 41468057a8a653225e725dd170492871
BLAKE2b-256 2c31b65f37129d7aa7c1cfaf22cc1fa81219cd15af0dcef84704779fe0a8e691

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 758.2 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 5da322141985e95f5018856603761ad908c3eb6dd8add566066c082fca8b4541
MD5 23f3cf7a0a80cfadcab393240fc4d067
BLAKE2b-256 6ab00cb7bf376bf48e7b447bfdac4a60f5f44a3d61226cf59cd6a44d507fbca4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.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/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 963e089f5d70d614408d08830a9244f3146a63c87a2daedc130af72f6569d2af
MD5 24ef0c725616d3c064a4eb591d1b5906
BLAKE2b-256 430085c48864cbda24d631720ec9133aa583bd65145cfff588d8d2ff8d1248a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 758.1 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 0de9d9482a6def6ef719ac9024dceae89809fa05d02656518a146374df93eb94
MD5 f3d336306fa89d20e4c6093109328226
BLAKE2b-256 b4f390707ef83c3d78d516f3e225f3ca8f1ca39cfb411a8c4ccfbfc27cc2a03e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.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/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9d43bb5a5148f1c50e972e8fc4653620d63bb0d1cb02701d41fa580eb44a1bcf
MD5 7fca5cf697d5c88b0c064b9dce22a65a
BLAKE2b-256 5ea9895562f876c1c6dd12991940e748813e277c3ea43d4ec5ee790be35de518

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 758.1 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 c4c147495267a26b2d5fc39a486e1561bc501b170f973ab1ab0f39f2c00791da
MD5 bb357841223f0e72912d3910550a41ca
BLAKE2b-256 38d8d71c358e3fa0bbf408834d90af13a0a274e64f6f5b9a7db7ce318d2cbb8f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.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/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 300581837e17114432d52599075bb8348dc2ce3e9ec8d3c325f5a797424791a4
MD5 8f5b7fe980619d57289881969b450c55
BLAKE2b-256 d03766bf5df8aced98f974b9e5b439f75d6308c29c242604cdcdf43b09af3a81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.2.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 758.1 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for yara_python-4.2.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 cabef9144d35357ba9815f6ecacfaeed05fa2cc2a2ae0a0c37766839500555d9
MD5 54edca9fc3dabd4796e5a66f209ed8dd
BLAKE2b-256 8ca515905e3ffc8c5acda213db71c8a2d7a9c3d28f2947bb54170b5585f3106b

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