skillfed

plyara

Parse YARA rules

plyara v2.2.8 135.2K downloads/30d#11,449 on PyPI195
Permissive license DORMANT released

What it is and what it does

Plyara is a lexer and parser that converts YARA rule files into structured Python dictionaries, making it possible to programmatically inspect, transform, and analyze malware detection rules. It exposes both a library API for use in Python applications and a command-line tool for batch processing rule files into JSON. The package has no external runtime dependencies and requires only Python 3.10 or later.

Typical use cases include extracting indicators from rule sets, updating rule metadata in bulk, linting or validating rule syntax, analyzing rule dependencies, and building tooling around YARA rule management. The parser preserves both the parsed structure (rule name, strings, conditions, metadata) and the raw text of each section, allowing users to work with either representation depending on their needs.

Use it for:

  • Extract indicators (file hashes, IP addresses, domains) from a corpus of YARA rules for threat intelligence.
  • Validate and lint YARA rules in bulk to catch syntax errors or policy violations before deployment.
  • Analyze rule dependencies and imports to understand which rules depend on external modules.
  • Transform rule metadata across large rule sets (e.g., update threat levels or add tags programmatically).
  • Build custom rule analysis tools that operate on parsed rule dictionaries rather than raw text.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses YARA rule files into Python dictionary representations, enabling programmatic analysis and bulk transformation of malware detection rules.

Yes, if you work with YARA rules and need to parse or transform them programmatically. The package is stable, has no dependencies, and installs easily. Maintenance is dormant but not abandoned—the repository is still active. Be aware that the last release was over a year ago, so if you need recent bug fixes or features, check the repository's open issues first.

Install

plyara on PyPI

pip

pip install plyara

uv

uv add plyara

poetry

poetry add plyara

Installing plyara

Before you install

Low friction install with no runtime dependencies. Maintenance is dormant—last release was 554 days ago—but the repository remains active with recent commits and the package is marked Production/Stable.

License in practice

Licensed under Apache (permissive), meaning you can use, modify, and distribute plyara freely in commercial and private projects with minimal restrictions.

Quickstart

pip install plyara

import plyara
parser = plyara.Plyara()
rules = parser.parse_string('rule MyRule { strings: $a="1" condition: false }')
print(rules[0]['rule_name'])

Requires Python 3.10 or later.

Verify before relying

  • Whether the parser handles all YARA syntax variants or only a subset of the YARA specification.
  • Performance characteristics when parsing very large rule files or rule sets.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 554 days since the last release
Last repo commit
First released
Downloads 135,207/month — #11,449 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: plyara-2.2.8-py3-none-any.whl

Keywords: malware, analysis, yara

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: SecurityTopic :: Utilities

Tags

yara rule parserparse yara rules pythonyara to dictionaryyara rule analysisbulk yara processingyara rule extractionyara linting
yara-rulesmalware-analysisrule-parsing

More Utilities packages