NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3088 most downloaded on PyPI
Extension for the python package 'construct' that adds typing features
Last release 2 months ago
23 Jul 2026
Ships unpredictably
gaps range from 9 days to 2.2 years
Nearly every release is documented
notes for 18 of 20 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
20 releases · first in 2021
One column per quarter.
Added Subconstruct , SymmetricAdapter , Tunnel and Validator to construct_typed as subscriptable types.
New features:
Subconstruct, SymmetricAdapter, Tunnel and Validator to construct_typed as subscriptable types.csfield should only be used for constructs that cannot build from None . Every other construct should use the new csfield_noinit , csfield_const or cs
Breaking changes:
csfield should only be used for constructs that cannot build from None. Every other construct should use the new csfield_noinit, csfield_const or csfield_default.version.py, use importlib.metadata instead to get the version number.New features:
csfield_const to create dataclass fields that are excluded from constructor and have a constant value.csfield_default to create dataclass fields that have a default value.csfield_noinit to create dataclass fields that are excluded from constructor.Changes:
Computed, Default and Rebuild in conjunction with ty.Checksum, to represent that it can build from None.Organizational changes:
uv as a project management tool and poe as a task runner.Added Python 3.12 and 3.13 support to CI
fixed error message from EnumBase and FlagsEnumBase that occures since pyright v1.1.320
EnumBase and FlagsEnumBase that occures since pyright v1.1.320__new__ methods in DataclassStruct, TEnum and TFlagsEnumfixed missmatch between stub and runtime type for Array
fixed missmatch between stub and runtime type for Array
Reworked construct-stubs so that it supports pyright>=v1.1.310. To support pyright and mypy in the past, __new__ and __init__ had to be defined. Howev
construct-stubs so that it supports pyright>=v1.1.310. To support pyright and mypy in the past, __new__ and __init__ had to be defined. However, this is no longer supported by pyright. Now in most cases only __init__ is defined. Only for some special cases __new__ is used (e.g. for FormatField, Const, Hex, HexDump, IfThenElse, Switch)cs.Compiled.__author__, __version__, possiblestringencodings, hexdump, hexundump, PY)parse method (fixes #24). This requires a dependency to typing_extensions>=4.6.0.build_stream and build_file do not return anything (fixes #25).Fixed python 3.11 error when using dataclasses.asdict for dataclasses that contains an EnumBase instance. (fixes #21 )
added type hints for cs.Struct._subcons , cs.Sequence._subcons , cs.FocusedSeq._subcons , cs.Union._subcons , cs.LazyStruct._subcons , cs.LazyStruct._
cs.Struct._subcons, cs.Sequence._subcons, cs.FocusedSeq._subcons, cs.Union._subcons, cs.LazyStruct._subcons, cs.LazyStruct._subconsindexescs.Array__init__ methods for all constructs that currently only define an __new__ method__new__ instead of __init__ for EnumBase to create enum member objects (fixes #18)fixed static analysis issues so that the latest versions are supported
IfThenElse so that it represents the real implementation as a class and not a methodEnumBase and FlagsEnumBase to support individual documentation for each enum value via EnumValuefixed static analysis issues so that the latest versions are supported
os.PathLike for file namesBuildTypes of construct.Constfixed setup.py for sdist (.tar.gz file)
evaluate()IfThenElse for pyrightEnhancement for cs.Checksum, so that bytesfunc can return any object and not only bytes.
Enhancement for cs.Checksum, so that bytesfunc can return any object and not only bytes.
tstruct.py -> dataclass_struct.py
Big changes:
tstruct.py -> dataclass_struct.pyTStruct -> DataclassStructTBitStruct -> DataclassBitStructsfield -> csfieldTContainerMixin -> DataclassMixinadd_offsets from DataclassStructDataclassMixin:
cs.Container, which removed the inherited methods names like update, keys, etc and makes them usable as dataclass field names__str__ from cs.Container with a few modifications, so that the output stays almost the sameSmall changes:
values from cs.Const and cs.Default are now set as default value a TContainerMixin
values from cs.Const and cs.Default are now set as default value a TContainerMixin
adapted stubs to construct v2.10.66
adapted stubs to construct v2.10.66
adapted stubs to construct v2.10.64
construct v2.10.64added covariant for ParsedType and contravariant for BuildTypes (thanks to @ad1217)
ParsedType and contravariant for BuildTypes (thanks to @ad1217)cst.TStructField to cst.sfieldcst.TUnionField to cst.ufieldTEnum and TFlagsEnumstrip trailing new lines in documentation of "TStructField"
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →