Skip to content

Releases: scott-griffiths/bitstring

bitstring-4.0.2

16 Apr 13:47
Compare
Choose a tag to compare

A maintenance release.

  • Added py.typed file and converted the module to a package to let mypy find type
    annotations. Bug 248.
  • Fix to shifting operations when using LSB0 mode. Bug 251.
  • A few more fixes for LSB0 mode.
  • Improved LSB0 documentation.
  • Added build-system section to pyproject.toml. Bug 243.
  • Rewrote the walkthrough documentation as a jupyter notebook.
  • Updated the project's logo.

bitstring-4.0.1

16 Nov 14:31
Compare
Choose a tag to compare

November 2022: version 4.0.1 released

This is a major release which drops support for Python 2.7 and has a new minimum
requirement of Python 3.7. Around 95% of downloads satisfy this - users of
older versions can continue to use bitstring 3.1, which will still be supported
with fixes, but no new features.

Other changes are minimal, with a few features added.

Breaking changes:

  • Minimum supported Python version is now Python 3.7.
  • Removed ConstBitArray and BitString class aliases. Use Bits and BitStream instead.
  • The cut() method will now also yield the final bits of a bitstring, even if they
    are shorter than the requested cut size.
  • Removed default uint interpretation. This wasn't being applied uniformly - default
    is now always to return a bitstring object of the given length and not to interpret
    it as a uint. Bug 220.
  • If an overwrite goes beyond the end of the bitstring it will now extend the bitstring
    rather than raise an exception. Bug 148.

New features and improvements:

  • Type hints added throughout the code.

  • Underscores are now allowed in strings representing number literals.

  • The copy() method now works on Bits as well as BitArray objects.

  • The experimental command-line feature is now official. Command-line
    parameters are concatenated and a bitstring created from them. If
    the final parameter is either an interpretation string or ends with
    a . followed by an interpretation string then that interpretation
    of the bitstring will be used when printing it. ::

    $ python -m bitstring int:16=-400
    0xfe70
    $ python -m bitstring float:32=0.2 bin
    00111110010011001100110011001101
    
  • New pp() method that pretty-prints the bitstring in various formats - useful
    especially in interactive sessions. Thanks to Omer Barak for the suggestion
    and discussion.

      >>> s.pp()
        0: 10001000 01110110 10001110 01110110 11111000 01110110 10000111 00101000
       64: 01110010 11111001 10000111 10011000 11110111 10011110 10000111 11111101
      128: 11111001 10001100 01111111 10111100 10111111 11011011 11101011 11111011
      192: 1100
      >>> s.pp('bin, hex')
        0: 10001000 01110110 10001110 01110110 11111000 01110110   88 76 8e 76 f8 76
       48: 10000111 00101000 01110010 11111001 10000111 10011000   87 28 72 f9 87 98
       96: 11110111 10011110 10000111 11111101 11111001 10001100   f7 9e 87 fd f9 8c
      144: 01111111 10111100 10111111 11011011 11101011 11111011   7f bc bf db eb fb
      192: 1100                                                    c
    
  • Shorter and more versatile properties. The bin, oct, hex, float, uint and int
    properties can now be shortened to just their first letter. They can also have
    a length in bits after them - allowing Rust-like data types. ::

    >>> s = BitArray('0x44961000')
    >>> s.h
    '44961000'
    >>> s.f32
    1200.5
    >>> s.u
    1150685184
    >>> s.i7 = -60
    >>> s.b
    '1000100'
    >>> t = Bits('u12=160, u12=120, b=100')
    
  • Support for IEEE 16 bit floats. Floating point types can now be 16 bits long as well
    as 32 and 64 bits. This is using the 'e' format from the struct module.

  • Support for the bfloat format. This is a specialised 16-bit floating point format
    mostly used in machine learning. It is essentially a truncated IEEE 32-bit floating
    point number that has the same range but much less accuracy.

  • Removed requirement to have a colon before lengths in format strings. So for example
    'uint:12=100' can be just 'uint12=100'. The colon is still recommended for
    readability if the length isn't given as a number literal.

bitstring-4.0.0

15 Nov 19:12
Compare
Choose a tag to compare

Pulled due to a bug when using Python 3.7.

bitstring-3.1.9

20 Jul 20:30
Compare
Choose a tag to compare

July 20th 2021: version 3.1.9 released

(version 3.1.8 was pulled due to serious issues)
Another maintenance release.

  • Fixed a couple of outdated results in the readme (Issue 214).
  • Some more documentation tidying.
  • Turned off some debug code by default.
  • Fixed a couple of failing tests in different Python versions.
  • Fix for consistent pos initialisation semantics for different types.
  • Change to allow wheels to be uploaded to PyPI.
  • More work for LSB0 mode, but still not finished or documented (sorry).

bitstring-3.1.7

10 May 13:35
Compare
Choose a tag to compare

May 5th 2020: version 3.1.7 released

This is a maintenance release with a few bug fixes plus an experimental
feature to allow bits to be indexed in the opposite direction.

  • Fixing del not working correctly when stop value negative (Issue #201)
  • Removed deprecated direct import of ABC from collections module (Issue #196)
  • Tested and added explicit support for Python 3.7 and 3.8. (Issue #193)
  • Fixing a few stale links to documentation. (Issue #194)
  • Allowing initialisation with an io.BytesIO object. (Issue #189)

bitstring-3.1.6

14 Jul 08:02
Compare
Choose a tag to compare

July 9th 2019: version 3.1.6 released

A long overdue maintenace release with some fixes.

  • Fixed immutability bug. Bug 176.
  • Fixed failure of __contains__ in some circumstances. Bug 180.
  • Better handling of open files. Bug 186.
  • Better Python 2/3 check.
  • Making unit tests easier to run.
  • Allowing length of 1 to be specified for bools. (Thanks to LemonPi)

bitstring-3.1.5

23 Jun 09:48
Compare
Choose a tag to compare

May 17th 2016: version 3.1.5 released

  • Support initialisation from an array.
  • Added a separate LICENSE file.

bitstring-3.1.4

23 Jun 09:52
Compare
Choose a tag to compare

March 19th 2016: version 3.1.4 released

This is another bug fix release.

  • Fix for bitstring types when created directly from other bitstring types.
  • Updating contact, website details.

bitstring-3.1.3

23 Jun 09:53
Compare
Choose a tag to compare

March 4th 2014: version 3.1.3 released

This is another bug fix release.

  • Fix for problem with prepend for bitstrings with byte offsets in their data store.

bitstring-3.1.2

23 Jun 10:01
Compare
Choose a tag to compare

April 18th 2013: version 3.1.2 released

This is another bug fix release.

  • Fix for problem where unpacking bytes would by eight times too long