Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Python bindings #157

Open
manazoid opened this issue Feb 20, 2025 · 1 comment
Open

Suggestion: Python bindings #157

manazoid opened this issue Feb 20, 2025 · 1 comment

Comments

@manazoid
Copy link

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)

@WerWolv
Copy link
Owner

WerWolv commented Feb 20, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants