Skip to main content

PEP 561 type stubs for yara-python 4.5.5

Project description

yara-python-stubs

PEP 561 type stubs for yara-python 4.5.5.

yara-python is distributed as a C extension and ships without type information. This package provides the corresponding .pyi files so that mypy, pyright, pylance, and other static analyzers can resolve the yara module's API: classes (Rules, Rule, Match, StringMatch, StringMatchInstance), module-level functions (compile, load, set_config), constants (CALLBACK_*, YARA_VERSION, ...) and exceptions (Error, SyntaxError, TimeoutError, WarningError).

Installation

pip install yara-python-stubs

The stubs are picked up automatically by any PEP 561-compliant type checker once installed in the same environment as yara-python. No imports or configuration changes are required in your code.

To install both the runtime library and these stubs together:

pip install "yara-python-stubs[runtime]"

Usage

import yara

rules: yara.Rules = yara.compile(
    source='rule example { strings: $a = "foo" condition: $a }'
)

matches: list[yara.Match] = rules.match(data=b"foobar")
for match in matches:
    print(match.rule, match.tags, match.meta)
    for string in match.strings:
        for instance in string.instances:
            print(instance.offset, instance.matched_data)

Versioning

Versions track upstream yara-python (MAJOR.MINOR.PATCH) plus an extra component (.N) for revisions of the stubs themselves. 4.5.5 corresponds to yara-python 4.5.5.

License

Apache License 2.0 — see LICENSE.

The stubs are an independent reimplementation of the public Python API of yara-python; this package does not include any code from upstream.

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_stubs-4.5.5.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yara_python_stubs-4.5.5-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file yara_python_stubs-4.5.5.tar.gz.

File metadata

  • Download URL: yara_python_stubs-4.5.5.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yara_python_stubs-4.5.5.tar.gz
Algorithm Hash digest
SHA256 1ff82cf11e5897790c2a72d8a11372894c4f27971c59e596f87ff3a0480eb6f4
MD5 66b8ae4cbe00b8392a9bbc597d8584ee
BLAKE2b-256 7dafccb4fb26a1b609a35a078d3f979a6b609a1b1035ca6d3646ff765c8e9e83

See more details on using hashes here.

Provenance

The following attestation bundles were made for yara_python_stubs-4.5.5.tar.gz:

Publisher: publish.yml on RubenEu/yara-python-stubs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yara_python_stubs-4.5.5-py3-none-any.whl.

File metadata

File hashes

Hashes for yara_python_stubs-4.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2ff4016d82c591a89fb1568b615f14d3ecdf2a0ccdb28cc51157a23bfb830625
MD5 fdd39690344027bce8cc8a7a27e2bc1c
BLAKE2b-256 b799887145b60847bba0f271f806a987327ef3104e3e037ed3f5c9cb81a5f806

See more details on using hashes here.

Provenance

The following attestation bundles were made for yara_python_stubs-4.5.5-py3-none-any.whl:

Publisher: publish.yml on RubenEu/yara-python-stubs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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