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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8Windows x86

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.0.5.tar.gz
  • Upload date:
  • Size: 406.8 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.5.tar.gz
Algorithm Hash digest
SHA256 1bc5d27879a7b5680356eda5858ff26d2e78c472c2922de29820039e5fb439e1
MD5 1fd656d4c9c26f3ca01ff16b21ae2f50
BLAKE2b-256 2c3d13c449f629f4861bc091a1a2461700f24f17031dfe432ee2abdb9660e852

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.5-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.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6c2de959714606eff19bc74640d9f4ce77b6f5b6420dab2c4f965245335a7680
MD5 103d21fddb19d3a78c942660b76e7a8e
BLAKE2b-256 bb8f4e6f082c203edda2cec01b3968d3f4d09da48342c25fdd8e4f6cee86e088

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.5-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.5-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 07e700833860b4f6c07c05764abecd9ff7b294069e0e4368befaece62ede103c
MD5 1f3dd7d7e005f93d8c90c25197792cd2
BLAKE2b-256 752f506ac7de33f257c4dc0d73ed75f1b6e710ba6b0868f6170efe6e813496aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.5-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.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 537c7fc04c5ce100c2b6f5005b8985ade3b1ce9a4ab1988f3c07d5a738e6da44
MD5 bf258bbc90a39d7474a574c65186a435
BLAKE2b-256 17d5700134999e94e7c41c3e3643338455e5652b4fec9398bc3ccf858b7a8d07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.5-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.5-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 8fb5ddc1e3b23a35483d6d71688612c5972f98b73b5d17184350112ed23b6594
MD5 3901b7e12ac5ae32a4ca74ae7ce4bb2f
BLAKE2b-256 31a68ca405c0e8a1434f17ff85ab1331a0b6ed95886ee25c8439c511d9301149

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.5-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.5-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 ea34861772b752418b58a24e0a5b924ca05ec9e180499065bf6407036674ebed
MD5 5974909af12f8a72a47d7185fa3de90e
BLAKE2b-256 a476c3d15f03a0a5a1b293aa6b3f5facf1bee954e3486c175020a93cae0692f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.5-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.5-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 bf20847dff0ced7f3fcac586a6074aeabb1be5c5377161d6309eae77c0af2fbc
MD5 f8e87bb8d656d1c7dd2d0bbc0bb8281b
BLAKE2b-256 4a794f9b50ce19d7c253ae9c48f70f271764fee84f96b3c7f91fc6f0a5743362

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.5-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.5-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 270e4ec59b1ca4dfd0be07e3c959a1462e855d3dd7ce7d9da93ae18050a32ab7
MD5 ea8ae0a45d71e8d748dfb1175cc8711f
BLAKE2b-256 d0672c0f41b4ddf8b2db1b80a2d9b73a44485ee97757b01d73dd6154c6ce4a62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.5-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.5-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 9e48106eb9f98e0300b105e9a32f37ade2106fe5c52120d50a63e0c7a3ad235b
MD5 0b847dafcac24bd8cddee95651f8a1ed
BLAKE2b-256 30a5b85d915dd2bcf12dc5d6b3d7658a922bea790054e7736375e57b9a724610

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