Construct Editor
This package provides a GUI (based on wxPython) for 'construct', which is a powerful declarative and symmetrical parser and builder for binary data. It can either be used standalone or embedded as a widget in another application.
Features:
- show documentation as tooltip
- different editors for:
- Integer values
- Enum values
- FlagsEnum values
- DateTime values
- undo/redo in HexEditor and in ConstructEditor
- extensible for custom constructs
Installation
The preferred way to installation is via PyPI:
pip install construct-editor
Development
This project uses uv as a project management tool. To set up your development environment, run the following command:
uv sync
To run the unit tests, run:
uv run poe test
To run the linter/code formatter (including auto fix), run:
uv run poe lint
To run all supported type checkers (currently mypy, pyright and ty), run:
uv run poe typecheck
To run unit tests, linter/code formatter and type checkers, run:
uv run poe check-all
Getting started (Standalone)
To start the standalone version, just execute the following in the command line:
construct-editor
Getting started (as Widgets)
This is a simple example
import wx
import construct as cs
from construct_editor.wx_widgets import WxConstructHexEditor
constr = cs.Struct(
"a" / cs.Int16sb,
"b" / cs.Int16sb,
)
b = bytes([0x12, 0x34, 0x56, 0x78])
app = wx.App(False)
frame = wx.Frame(None, title="Construct Hex Editor", size=(1000, 200))
editor_panel = WxConstructHexEditor(frame, construct=constr, binary=b)
editor_panel.construct_editor.expand_all()
frame.Show(True)
app.MainLoop()
This snipped generates a GUI like this:
Widgets
ConstructHexEditor
This is the main widget ot this library. It offers a look at the raw binary data and also at the parsed structure. It offers a way to modify the raw binary data, which is then automaticly converted to the structed view. It also supports to modify the structed data and build the binary data from it.
ConstructEditor
This is just the right side of the ConstructHexEditor, but can be used also used as standalone widget. It provides:
- Viewing the structure of a construct (without binary data)
- Parsing binary data according to the construct
HexEditor
Just the left side of the ConstructHexEditor, but can be used also used as standalone widget. It provides:
- Viewing Bytes in a Hexadecimal form
- Callbacks when some value changed
- Changeable format via
TableFormat
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file construct_editor-0.2.0.tar.gz.
File metadata
- Download URL: construct_editor-0.2.0.tar.gz
- Upload date:
- Size: 84.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc9a752c1c50e0652e26e4d84cca59fc517f40867ab2a758d78348cf51293338
|
|
| MD5 |
a3c3aa1b42fd09d7c69af44de50f1c20
|
|
| BLAKE2b-256 |
824317b12ed24a8832cadfa5f5108708aee1fdf4a17dde959a5c889e96e92e38
|
Provenance
The following attestation bundles were made for construct_editor-0.2.0.tar.gz:
Publisher:
python-publish.yml on timrid/construct-editor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
construct_editor-0.2.0.tar.gz -
Subject digest:
fc9a752c1c50e0652e26e4d84cca59fc517f40867ab2a758d78348cf51293338 - Sigstore transparency entry: 2289796363
- Sigstore integration time:
-
Permalink:
timrid/construct-editor@0201f2f170bba7cd5a9d2c57a056562f184af266 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/timrid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0201f2f170bba7cd5a9d2c57a056562f184af266 -
Trigger Event:
release
-
Statement type:
File details
Details for the file construct_editor-0.2.0-py3-none-any.whl.
File metadata
- Download URL: construct_editor-0.2.0-py3-none-any.whl
- Upload date:
- Size: 104.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36abfc639ba0e932748e796da078ab0107d6e302d0c1073aa92459cc81118800
|
|
| MD5 |
da191a612bdd48237fd96e9e01a78065
|
|
| BLAKE2b-256 |
93b0d0ae4810886ca161b31c10381913220b274f13ad3a823f866313876079ae
|
Provenance
The following attestation bundles were made for construct_editor-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on timrid/construct-editor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
construct_editor-0.2.0-py3-none-any.whl -
Subject digest:
36abfc639ba0e932748e796da078ab0107d6e302d0c1073aa92459cc81118800 - Sigstore transparency entry: 2289796379
- Sigstore integration time:
-
Permalink:
timrid/construct-editor@0201f2f170bba7cd5a9d2c57a056562f184af266 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/timrid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0201f2f170bba7cd5a9d2c57a056562f184af266 -
Trigger Event:
release
-
Statement type: