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

Uploaded CPython 3.8mWindows x86-64

yara_python-4.0.2-cp38-cp38m-win32.whl (747.5 kB view details)

Uploaded CPython 3.8mWindows x86

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

File details

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

File metadata

  • Download URL: yara-python-4.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 c446e15a7ef1de56129eb311b3a920417ea3c3b4806b6ba979136bf861fa51d9
MD5 efb4061b02a5b1556e34d24cd4790b3c
BLAKE2b-256 5f3223a3234978d746acfad00f306b13446a1935c52ec74a033416f457328239

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.2-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.2-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 2199f11e3f14dd176a4ccf3e9d46a366f9a8723cd95066eb4e22625d1774da3e
MD5 9e10873a08fefd029d857f9dec30008d
BLAKE2b-256 a1f4572ec37bca6019d6666351f36a3809d4c46510e2c9c3a3f8ac4c7f670704

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.2-cp38-cp38m-win32.whl
  • Upload date:
  • Size: 747.5 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.2-cp38-cp38m-win32.whl
Algorithm Hash digest
SHA256 da37edad1e724cf586be0c78451cc3e3e3673b28676ed423e750f5cb793f22ee
MD5 8ce64e8583523638bef578b245714ae5
BLAKE2b-256 6aeeb2332f1f22c69eb063a8cc26925b9749b8964b3cd9040f99095ea89fec17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.2-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.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3843ffead5b88a62582173f74f7277c0765b1d60ae55583ab95b31361fc24715
MD5 f866ef9ad88aaf4280c9ab5485542360
BLAKE2b-256 a22b08e41537a1ed09a45e839d0055ebdd31c1a5f0d2ebf4819a8cfe9a75354d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.2-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.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 b0aa7135fef4ef2ede35d425ff777feeed174f3171faa520daa7bd99b54e082b
MD5 0d4092ddfcbfae5cc2ae40645c8b4d58
BLAKE2b-256 c0c42c4e22bf9941dd87868114af1ede69ec8652830dc828b8e7ff3b15492774

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.2-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.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 cd18d31cd044a7e383c63617f4a1c7047209b14312ab527a3741eaca79f3f88c
MD5 5d34705f74f63f5e381c2ba45ae7bd8b
BLAKE2b-256 99d50d2746c5567e5ce999da0a94f3215315d81beb0ffbe452cf37502dda5a34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.2-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.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 b34cf660918e90351829ae68c7dd3bd4927cd39a4f05fc37966da50abbbb9468
MD5 940f310015cf634e3d51a55bac81c5b6
BLAKE2b-256 7a5af26128f10a7f2350623c51896bb40eca14a9930186984c9b17c83cf924dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.2-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.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a8f403a9c9180532258ca3f01c04b9fb12907003bd0840524c7188c10f6989ae
MD5 e9eb7cd2d5bace490e931b7fdcf1390b
BLAKE2b-256 a9bdda0308f209df9ee1c0b17731cc25e5692341f48f52668e5f7cc14bb09fd8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yara_python-4.0.2-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.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 7c8fc1275c77551bdef057b5b5b243896ca21b42e15ed9416884bffe4bec584b
MD5 4000e0e4df58a89a53659dd30878592a
BLAKE2b-256 210d522ec9d664657384e37dc93e5370061555885db8314fc5539ecb77b2f0be

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