PatternLanguage icon indicating copy to clipboard operation
PatternLanguage copied to clipboard

Suggestion: Python bindings

Open manazoid opened this issue 1 year ago • 1 comments

Hey, @WerWolv Nik!

Your Pattern Language is great. I like to use within ImHex software. But now I have a use case that doesn't covered at all.

A desktop application that read binary files and integrates with already existing source code based on Python language. I would like to see pypl (python pattern language) instead of PatternLanguage CLI.

The use case is that:

from pypl import PatternLanguage

with open("tests/data/test_data", "rb") as f:
    data = f.read()
with open("tests/data/test.hexpat", "rb") as f:
    patt = f.read()

pl = PatternLanguage()
output = pl.format(data, patt)
print(output) # that output is dict

What you think about that? Can it be official release in the same repo or separate repository of python bindings (at least format subcommand)

manazoid avatar Feb 20 '25 00:02 manazoid

Hey! Feel free to make a Python wrapper and open a PR with it. I think it would be a cool thing to have in general, I just don't have any experience with any of this

WerWolv avatar Feb 20 '25 09:02 WerWolv