Skip to main content

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.

Preview

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:

Screenshot of the example

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

construct_editor-0.2.0.tar.gz (84.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

construct_editor-0.2.0-py3-none-any.whl (104.4 kB view details)

Uploaded Python 3

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

Hashes for construct_editor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fc9a752c1c50e0652e26e4d84cca59fc517f40867ab2a758d78348cf51293338
MD5 a3c3aa1b42fd09d7c69af44de50f1c20
BLAKE2b-256 824317b12ed24a8832cadfa5f5108708aee1fdf4a17dde959a5c889e96e92e38

See more details on using hashes here.

Provenance

The following attestation bundles were made for construct_editor-0.2.0.tar.gz:

Publisher: python-publish.yml on timrid/construct-editor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file construct_editor-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for construct_editor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36abfc639ba0e932748e796da078ab0107d6e302d0c1073aa92459cc81118800
MD5 da191a612bdd48237fd96e9e01a78065
BLAKE2b-256 93b0d0ae4810886ca161b31c10381913220b274f13ad3a823f866313876079ae

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page