tibs 0.7.0


pip install tibs

  Latest version

Released: May 04, 2026


Meta
Author: Scott Griffiths
Requires Python: >=3.8

Classifiers

Development Status
  • 4 - Beta

Intended Audience
  • Developers

Operating System
  • OS Independent

Programming Language
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Rust
  • Python :: Implementation :: CPython

License
  • OSI Approved :: MIT License

Topic
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed

Tibs cat tibs
A sleek Python library for binary data


PyPI - Version CI badge Docs PyPI - License     Pepy Total Downloads PyPI - Downloads


tibs is a simple but powerful Python library for creating, interpreting and manipulating binary data. It is 100% written in Rust to give it excellent performance, and is from the same author as the bitstring library.

Documentation

The full documentation is available on Read the Docs.

Getting started

To install use

pip install tibs

There are pre-built wheels for most configurations - if there are issues then please let me know. Tibs works with Python 3.8 and later.

A taster

One way to get to know the library is to start a Python interactive session and try a small binary record. Tibs is immutable, like bytes; Mutibs is the mutable version for in-place editing.

>>> from tibs import Tibs, Mutibs

>>> # Four flag bits, a 12-bit integer field, then two payload bytes.
>>> packet = Tibs.from_joined(["0b1010", Tibs.from_u(3200, 12), b"OK"])
>>> packet
Tibs('0xac804f4b')
>>> len(packet)
32

>>> # Slice at bit positions, then interpret each slice however you need.
>>> packet[:4].bin
'1010'
>>> packet[4:16].to_u()
3200
>>> packet[16:].bytes
b'OK'

>>> # Search and test using strings, bytes, booleans or other Tibs values.
>>> packet.find("0x4f", byte_aligned=True)
16
>>> packet.find_all("0b10")
[0, 2, 5, 8, 17, 23, 25, 28]

>>> # Convert to Mutibs when you want to patch the data in-place.
>>> patched = packet.to_mutibs()
>>> patched[4:16] = Tibs.from_u(2047, 12)
>>> patched[-8:] = b"!"
>>> patched
Mutibs('0xa7ff4f21')
>>> patched[4:16].to_u(), patched[-16:].bytes
(2047, b'O!')

>>> # The same operations are designed to scale to large bit sequences.
>>> Tibs.from_random(1_000_000, seed=b"readme").count(1)
500480

This only scratches the surface: the docs cover construction from ints, floats, bytes and strings; endianness; searching and replacing; rotations; bit indexing; and more worked examples.

For more information see the full documentation.

Credits

The tibs library was created by Scott Griffiths and is released under the MIT License.

The Tibs cat artwork was created by Ada Griffiths and is not covered by the software license. All rights reserved.

Tibs cat

Wheel compatibility matrix

Platform CPython >=3.8 (abi3) CPython (additional flags: t) 3.14
macosx_10_12_x86_64
macosx_11_0_arm64
manylinux1_i686
manylinux2014_aarch64
manylinux2014_armv7l
manylinux2014_ppc64le
manylinux2014_s390x
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_armv7l
manylinux_2_17_ppc64le
manylinux_2_17_s390x
manylinux_2_17_x86_64
manylinux_2_5_i686
musllinux_1_2_aarch64
musllinux_1_2_armv7l
musllinux_1_2_i686
musllinux_1_2_x86_64
win32
win_amd64
win_arm64

Files in release

tibs-0.7.0-cp314-cp314t-macosx_10_12_x86_64.whl (791.0KiB)
tibs-0.7.0-cp314-cp314t-macosx_11_0_arm64.whl (686.6KiB)
tibs-0.7.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (805.1KiB)
tibs-0.7.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (814.6KiB)
tibs-0.7.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (897.9KiB)
tibs-0.7.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl (881.7KiB)
tibs-0.7.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (874.9KiB)
tibs-0.7.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl (897.4KiB)
tibs-0.7.0-cp314-cp314t-musllinux_1_2_aarch64.whl (1010.4KiB)
tibs-0.7.0-cp314-cp314t-musllinux_1_2_armv7l.whl (1.1MiB)
tibs-0.7.0-cp314-cp314t-musllinux_1_2_i686.whl (1.1MiB)
tibs-0.7.0-cp314-cp314t-musllinux_1_2_x86_64.whl (1.1MiB)
tibs-0.7.0-cp314-cp314t-win32.whl (525.7KiB)
tibs-0.7.0-cp314-cp314t-win_amd64.whl (575.7KiB)
tibs-0.7.0-cp314-cp314t-win_arm64.whl (534.5KiB)
tibs-0.7.0-cp38-abi3-macosx_10_12_x86_64.whl (803.7KiB)
tibs-0.7.0-cp38-abi3-macosx_11_0_arm64.whl (696.7KiB)
tibs-0.7.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (811.0KiB)
tibs-0.7.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (816.5KiB)
tibs-0.7.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (906.1KiB)
tibs-0.7.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (887.3KiB)
tibs-0.7.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (879.2KiB)
tibs-0.7.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl (901.8KiB)
tibs-0.7.0-cp38-abi3-musllinux_1_2_aarch64.whl (1016.5KiB)
tibs-0.7.0-cp38-abi3-musllinux_1_2_armv7l.whl (1.1MiB)
tibs-0.7.0-cp38-abi3-musllinux_1_2_i686.whl (1.1MiB)
tibs-0.7.0-cp38-abi3-musllinux_1_2_x86_64.whl (1.1MiB)
tibs-0.7.0-cp38-abi3-win32.whl (537.8KiB)
tibs-0.7.0-cp38-abi3-win_amd64.whl (586.5KiB)
tibs-0.7.0-cp38-abi3-win_arm64.whl (545.6KiB)
tibs-0.7.0.tar.gz (1.2MiB)
Extras:
Dependencies: