Registry / serialization / tibs
library2.0.1pypypi✓ verified 24d ago

tibs is a sleek Python library designed for creating, interpreting, and manipulating binary data. Written 100% in Rust for excellent performance, it provides efficient handling of bit sequences. The current version is 0.6.0. Releases appear to be event-driven rather than on a fixed cadence, with a focus on performance and robust binary data operations.

pip install tibs
INSTALL
IMPORT
SIG · TIBS
T
tibs
serializationpythonv2.0.1
Install
1.7s avg
Import
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 21MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Tibs
from tibs import Tibs
Mutibs
from tibs import Mutibs

This quickstart demonstrates how to create immutable `Tibs` and mutable `Mutibs` instances from various sources like binary strings, hexadecimal strings, and bytes. It also shows how to efficiently combine multiple `Tibs` objects using `from_joined`.

from tibs import Tibs, Mutibs # Create immutable Tibs instances a = Tibs.from_bin('0110') b = Tibs('0xabc') # Constructor can infer from string/bytes c = Tibs.from_bytes(b'\xff\x00') print(f"Tibs from binary: {a.to_bin()}") print(f"Tibs from hex: {b.to_hex()}") print(f"Tibs from bytes: {c.to_hex()}") # Create a mutable Mutibs instance muti = Mutibs.from_bin('1010') muti.append('01') print(f"Mutable Tibs after append: {muti.to_bin()}") # Combine multiple Tibs instances efficiently data_parts = [Tibs('0b1'), Tibs('0b010'), Tibs('0b1100')] combined_tibs = Tibs.from_joined(data_parts) print(f"Combined Tibs: {combined_tibs.to_bin()}")
Debug
Known issues
gotchaInstances of `Tibs` are immutable. Repeatedly concatenating or appending to a `Tibs` instance using operators like `+=` is an anti-pattern, as it creates a new instance in memory on each operation, leading to poor performance.
fix
For efficient concatenation of multiple `Tibs` instances, use the `Tibs.from_joined()` class method. If you require a mutable sequence of bits, use the `Mutibs` class instead, which supports in-place modifications.
affects: All versions (0.1.0+)
gotchaWhen constructing `Tibs` instances directly with string representations of binary or hexadecimal values (e.g., `Tibs('0110')`), you must include the '0b' or '0x' prefixes. Methods like `Tibs.from_bin()` or `Tibs.from_hex()` handle this prefixing implicitly.
fix
Always use `0b` for binary strings (e.g., `Tibs('0b0110')`) and `0x` for hexadecimal strings (e.g., `Tibs('0xabc')`) when passing them to the `Tibs` constructor. Alternatively, use the explicit class methods like `Tibs.from_bin('0110')` or `Tibs.from_hex('abc')`.
affects: All versions (0.1.0+)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tibs'
The 'tibs' package is not installed in the current Python environment or the environment is not activated.
fix
Install the 'tibs' library using pip: `pip install tibs`
error: can't find rustc
The Rust compiler (`rustc`) is not installed or not available in the system's PATH, which is required to build the `tibs` library from source.
fix
Install the Rust toolchain using `rustup.rs` before attempting to install `tibs`. Follow instructions at `https://rustup.rs/`.
ImportError: cannot import name 'BitVector' from 'tibs'
The class 'BitVector' does not exist or is not directly exposed under that name in the 'tibs' top-level package; the correct class name is 'BitVec'.
fix
Use the correct class name `BitVec` when importing: `from tibs import BitVec`
TypeError: argument 's': 'int' object cannot be converted to 'PyString'
The `BitVec.from_string()` method expects a string argument, but it received an integer, leading to a type conversion error in the underlying Rust implementation.
fix
Ensure you provide a string value to `BitVec.from_string()`. For example, use `BitVec.from_string(str(123))` if you intend to convert an integer to its string representation.
Upgrade
Version history
2.0.1latest on PyPI · released Aug 13, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
tibs — pip install tibs · libregistry