Metadata-Version: 2.4
Name: tibs
Version: 0.1.2
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: File Formats
Classifier: Typing :: Typed
Requires-Dist: pytest>=7.4.2 ; extra == 'dev'
Requires-Dist: hypothesis>=6.98.13 ; extra == 'dev'
Requires-Dist: pytest-benchmark>=4.0.0 ; extra == 'dev'
Requires-Dist: pyright>=1.1.389 ; extra == 'dev'
Requires-Dist: build ; extra == 'dev'
Provides-Extra: dev
License-File: LICENSE
Summary: A Python bit manipulation library written in Rust.
Author-email: Scott Griffiths <dr.scottgriffiths@gmail.com>
License: The MIT License
	
	Copyright (c) 2025 Scott Griffiths (dr.scottgriffiths@gmail.com)
	
	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the "Software"), to deal
	in the Software without restriction, including without limitation the rights
	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:
	
	The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.
	
	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	THE SOFTWARE.
	
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: homepage, https://github.com/scott-griffiths/tibs
Project-URL: documentation, https://mutibs.readthedocs.io/

[![tibs](https://raw.githubusercontent.com/scott-griffiths/tibs/main/doc/tibs.png)](https://github.com/scott-griffiths/tibs)

A sleek Python library for your binary data

[![PyPI - Version](https://img.shields.io/pypi/v/tibs?label=PyPI&logo=pypi&logoColor=white)](https://pypi.org/project/tibs/)
[![CI badge](https://github.com/scott-griffiths/tibs/actions/workflows/.github/workflows/test.yml/badge.svg)](https://github.com/scott-griffiths/tibs/actions/workflows/test.yml)
![PyPI - License](https://img.shields.io/pypi/l/tibs)
[![Docs](https://img.shields.io/readthedocs/mutibs?logo=readthedocs&logoColor=white)](https://mutibs.readthedocs.io/en/latest/)

----

> [!NOTE]
> This library is currently pre-alpha. This documentation is part reality and part planning.

## Documentation

The API docs are available [here](https://mutibs.readthedocs.io/en/latest/).

## Why is it called tibs?

Well it's 'bits' backwards (more or less) and the name was available!

## The basics

```python
from tibs import Tibs, Mutibs
```

The `Tibs` class is an immutable container of binary data. You can create a `Tibs` from binary or hex strings,
byte data, format strings etc. A number of creation methods are provided, all of which start with `from_`:

```python
>> > a = Tibs.from_string('0b110')
>> > b = Tibs.from_zeros(16)
>> > c = Tibs.from_bytes(b'some_bytes')
>> > d = Tibs.from_joined([a, b, c])
>> > e = Tibs.from_random(1000)
>> > f = Tibs.from_joined([a, b, c, d, e])
>> > g = Tibs.from_bools([1, 0, 0])
```

The `__init__` method redirects to `from_string`, `from_bytes`, or `from_bools` as appropriate,
so above you could also say `a = Tibs('0b110')`, `c = Tibs(b'some_bytes')` or `g = Tibs([1, 0 0])` which is often more
convenient.

The `Mutibs` class (pronounced 'mew-tibs') is a mutable version of `Tibs`.
