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.3.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.3-cp38-cp38m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8mWindows x86-64

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

Uploaded CPython 3.8mWindows x86

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

Uploaded CPython 3.7mWindows x86-64

yara_python-4.0.3-cp37-cp37m-win32.whl (747.5 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.6mWindows x86-64

yara_python-4.0.3-cp36-cp36m-win32.whl (747.5 kB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

yara_python-4.0.3-cp35-cp35m-win32.whl (747.5 kB view details)

Uploaded CPython 3.5mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 7c5de7102001c8616384edd0c7d23a2dd0a82e6e73e9794ff412fe4183297911
MD5 30f2a98c5f6576080d0366ddd6f8a35b
BLAKE2b-256 8508cbc7ab5aff4bc182f60eb400d125401148d9c7c6e87c6a299b2edae917da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.3-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.3-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 4489fb0329cbd7718f210da0bd0737952f87ab087d906c35775c2f1d2ae8e09d
MD5 c4a37ff22c9c292e62c6b1f9a235cbe0
BLAKE2b-256 96a920c8bf8babb851c39b19850d7473efc630c5337b0607daac9c7277a24eff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.3-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.3-cp38-cp38m-win32.whl
Algorithm Hash digest
SHA256 d8f5e23c682c6c3d9a92bd998dbe2a54c58ff0620503dccd06df299ac43d5aeb
MD5 2a7478cf777cf8fc47b6ea37cf52f81c
BLAKE2b-256 4a17a88d55c51b802f5679a1eb6c8baa837338e045a227fa401d81e76267d9ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.3-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.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 06921ff2ea705fc9ec51911ac329c228e6d1b67fa6ccbb991f293adfde3142a3
MD5 22d17177b9ef9d441b1c5b45f3a3b1d4
BLAKE2b-256 58dd12f109b5575f9f391d20335dd826522e077fa91cb55a8aace66b6a5118a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 747.5 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.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 296dfe3ee5127896e3edc81a7355518773b12868f4487d0e37d60e1d2438fe0b
MD5 22838c90dd8b450a55683f8942cbfb6e
BLAKE2b-256 d6dd494fa0263c7fed38b631544668e21a32ac2a5345be3a31c7a61b1fc9e491

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.3-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.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 38ca7f4f5c63dd258a43b5e466b9701702ce2a8e1ea806ae3b2fb89977a72e95
MD5 604a8ee0152257074d37b226dcb2d902
BLAKE2b-256 35f8537a1a0970e780a97c2975863148346ecca270471c7c7fac941dc4cf8bb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 747.5 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.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 709badb3fd3797d9ee6df38923caee9238c34f4dc07e49a9ed32fc8d653b698d
MD5 a6b5b3ab1642b6837bb61721de6a0c21
BLAKE2b-256 d8f9f2a248c8b8b75f8f07b36dba907410424f78195ba0c2d9ad4af871e7e71e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.3-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.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 7f9cee717d908a8c88df57731f23c28722821241855a06ef127ec1b48466d60b
MD5 947e6c778c12e9450723055cd8f501a3
BLAKE2b-256 55d9903ff50f752dd3e92e4ea5375b369f15ce475442965de8412864f068eae9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.3-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 747.5 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.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 c6086e8bfb1ad10770539a055eabdc858be96e10d05dcf6e8a07439789af0696
MD5 554d74d1baec424e24edbcb460013b8c
BLAKE2b-256 ea7e6837946e4d7671a9aaafec1f9e5a2574d5cd15966ffb7068ed9744c530c2

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