Skip to main content

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.

Metadata

Release files for yara-python-stubs 4.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yara-python-stubs 4.5.5
File Size Uploaded
yara_python_stubs-4.5.5.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yara-python-stubs 4.5.5
File Interpreter ABI Platform
yara_python_stubs-4.5.5-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / yara_python_stubs-4.5.5.tar.gz

Download URL yara_python_stubs-4.5.5.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1ff82cf11e5897790c2a72d8a11372894c4f27971c59e596f87ff3a0480eb6f4
BLAKE2b-256 checksum
How to use checksums
7dafccb4fb26a1b609a35a078d3f979a6b609a1b1035ca6d3646ff765c8e9e83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.

Transparency log

Release files / yara_python_stubs-4.5.5-py3-none-any.whl

Download URL yara_python_stubs-4.5.5-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ff4016d82c591a89fb1568b615f14d3ecdf2a0ccdb28cc51157a23bfb830625
BLAKE2b-256 checksum
How to use checksums
b799887145b60847bba0f271f806a987327ef3104e3e037ed3f5c9cb81a5f806
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.5.5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page