Plyara

Latest version: v2.2.7

Safety actively analyzes 701533 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 5

2.0.1

Patch release, no functional changes.

* Add support for Python 3.5. (51 from hillu)

2.0.0

Major release: v2.0.0.

Changes

* Parsed "meta" sections now return individual native Python types, rather than always strings. (See migration notes below).
* Parsed "meta" section is now represented as an ordered list of dictionaries with a single key, rather than an unsorted dictionary. (See migration notes below).
* Refactored static methods of the `Parser` class into a new `plyara.utils` module.
* Now strips extra quotes from strings in the "strings" section, and adds a new key called "type" to string dictionaries that will be one of "text", "byte", or "regex".

Migration Notes

When migrating from v1.x to v2.x, there are some changes you may need to account for in your plyara usage.

Native Types and Metadata List

YARA:


meta:
MyString = "Test"
MyInt = 10
MyBool = true


Before:

json
"metadata": {
"MyBool": "true",
"MyInt": "10",
"MyString": "Test"
},


Now:

json
"metadata": [
{
"MyString": "Test"
},
{
"MyInt": 10
},
{
"MyBool": true
}
],


String Quoting and Type

YARA:


strings:
$a = { 00 00 00 00 00 00 }
$b = "test"
$c = /test/


Before:

json
"strings": [
{
"name": "$a",
"value": "{ 00 00 00 00 00 00 }"
},
{
"name": "$b",
"value": "\"test\""
},
{
"name": "$c",
"value": "/test/"
}
]


Now:

json
"strings": [
{
"name": "$a",
"type": "byte",
"value": "{ 00 00 00 00 00 00 }"
},
{
"name": "$b",
"type": "text",
"value": "test"
},
{
"name": "$c",
"type": "regex",
"value": "/test/"
}
]


Utils Functions

Before:

python
import plyara

with open('test.yara', 'r') as f:
parser = plyara.Plyara()
rules = parser.parse_string(f.read())

for rule in rules:
Don't do this!
print(parser.rebuild_yara_rule(rule))


Now:

python
import plyara
import plyara.utils

with open('test.yara', 'r') as f:
parser = plyara.Plyara()
rules = parser.parse_string(f.read())

for rule in rules:
Do this instead!
print(plyara.utils.rebuild_yara_rule(rule))

2.0.0rc.1

Release candidate 1 for plyara v2.0.0. Full context: 45.

Barring any issues, this will become v2.0.0 on Feb 1.

1.4.1

Patch release to address a bug.

* Fix dependency error on some Python versions. (47 from anlutro)

1.4.0

Minor release with new features and bugfixes.

* Fix a bug where line number in raised exceptions was sometimes incorrect. (35)
* Fix a bug where anonymous arrays caused an exception. (37)
* Support `xor` string modifier. (44)
* Optionally return native object types in parsed rules. (12)

1.3.3

Patch release to address a bug.

* Added missing support for match length operator (!). (32)
* Correctly handle invalid conditions with `` or `!` operators on zero-length (missing) string names. (34)

Page 3 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.