Metadata-Version: 2.1
Name: yara-helper
Version: 0.3.6
Summary: A tool to parse Yara rules and help you edit Yara rules in your program
Home-page: https://github.com/b1tkeeper/yara-helper
Author: b1tkeeper
Author-email: wbhan_cn@qq.com
Project-URL: Bug Tracker, https://github.com/b1tkeeper/yara-helper/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# yara-helper

A tool to parse Yara rules and help you edit Yara rules in your program

## Demo

### Load and dump single rule

```shell
>>> rule_text = """rule person
... {
...     meta:
...         name = "James"
...         age = 18
...         is_male = true
...     strings:
...         say1 = "Hi"
...         say2 = "Nice"
...     condition:
...         all of them
... }"""
>>> info = RuleInfo.load(rule_text)
>>> info.meta['name']
'"James"'
>>> info.strings['say1']
'"Hi"'
>>> info.meta['age'] = 22
>>> info.dump()
'rule person\n{\n    meta:\n        name = "James"\n        age = 22\n        is_male = true\n    strings:\n        say1 = "Hi"\n        say2 = "Nice"\n    condition:\n        all of them\n}'
```

### Load and dump multiple rules

```shell
>>> RuleInfo.load_multiple(yara_text) # return List[RuleInfo]
>>> RuleInfo.dump_multiple(list_of_ruleinfo) # return List[str]
```
