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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ff82cf11e5897790c2a72d8a11372894c4f27971c59e596f87ff3a0480eb6f4
|
|
| MD5 |
66b8ae4cbe00b8392a9bbc597d8584ee
|
|
| BLAKE2b-256 |
7dafccb4fb26a1b609a35a078d3f979a6b609a1b1035ca6d3646ff765c8e9e83
|
Provenance
The following attestation bundles were made for yara_python_stubs-4.5.5.tar.gz:
Publisher:
publish.yml on RubenEu/yara-python-stubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yara_python_stubs-4.5.5.tar.gz -
Subject digest:
1ff82cf11e5897790c2a72d8a11372894c4f27971c59e596f87ff3a0480eb6f4 - Sigstore transparency entry: 1390587266
- Sigstore integration time:
-
Permalink:
RubenEu/yara-python-stubs@e582c98854e2722614c44b430c17de6ffa5c51ba -
Branch / Tag:
refs/tags/v4.5.5 - Owner: https://github.com/RubenEu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e582c98854e2722614c44b430c17de6ffa5c51ba -
Trigger Event:
release
-
Statement type:
File details
Details for the file yara_python_stubs-4.5.5-py3-none-any.whl.
File metadata
- Download URL: yara_python_stubs-4.5.5-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ff4016d82c591a89fb1568b615f14d3ecdf2a0ccdb28cc51157a23bfb830625
|
|
| MD5 |
fdd39690344027bce8cc8a7a27e2bc1c
|
|
| BLAKE2b-256 |
b799887145b60847bba0f271f806a987327ef3104e3e037ed3f5c9cb81a5f806
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yara_python_stubs-4.5.5-py3-none-any.whl -
Subject digest:
2ff4016d82c591a89fb1568b615f14d3ecdf2a0ccdb28cc51157a23bfb830625 - Sigstore transparency entry: 1390587275
- Sigstore integration time:
-
Permalink:
RubenEu/yara-python-stubs@e582c98854e2722614c44b430c17de6ffa5c51ba -
Branch / Tag:
refs/tags/v4.5.5 - Owner: https://github.com/RubenEu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e582c98854e2722614c44b430c17de6ffa5c51ba -
Trigger Event:
release
-
Statement type: