bitstring is a Python module that helps to make the creation and analysis of binary data as simple and natural as possible. Objects can be constructed from integers (big and little endian), floats, hex, octal, binary, byte data, iterables, or files. They can be sliced, joined, reversed, packed, unpacked, inserted into, overwritten, and otherwise operated upon with simple functions or slice notation. They can also be parsed, searched, and navigated in, similar to a file or stream. Internally the data is efficiently stored as byte arrays. It is available for Python 2.6 and later (including Python 3).
| Tags | Python Software Development Libraries Python Modules |
|---|---|
| Licenses | MIT/X |
| Operating Systems | Windows Mac OS X Linux |
| Implementation | Python |
Recent releases


Release Notes: This release has a fix for a problem where unpacked bytes could be eight times too long.


Release Notes: This release fixes a bug in which bitstrings could be modified by being used in an append.


Release Notes: This is a minor update that contains a couple of new features and a few bugfixes. A new 'pad' token is introduced for skipping unwanted bits, and clear and copy methods have been added to mutable classes.


Release Notes: This is a minor update that contains a few bugfixes.


Release Notes: This is a major update which breaks compatibility in a couple of areas. It removes the leading 0x, 0o, 0b for hex, oct, and bin properties, renames ConstBitArray to Bits, changes stepping in slices to a more conventional meaning, and adds a new readto method.