Metadata-Version: 2.1
Name: pybitset
Version: 0.0.1
Summary: python binding for cbitset
Home-page: https://github.com/synodriver/pybitset
Author: synodriver
Author-email: diguohuangjiajinweijun@gmail.com
License: BSD
Keywords: bitset
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Programming Language :: C
Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
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 :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: cffi >=1.0.0

<h1 align="center"><i>✨ pybitset ✨ </i></h1>

<h3 align="center">The python binding for <a href="https://github.com/lemire/cbitset">cbitset</a></h3>

[![pypi](https://img.shields.io/pypi/v/pybitset.svg)](https://pypi.org/project/pybitset/)
![python](https://img.shields.io/pypi/pyversions/pybitset)
![implementation](https://img.shields.io/pypi/implementation/pybitset)
![wheel](https://img.shields.io/pypi/wheel/pybitset)
![license](https://img.shields.io/github/license/synodriver/pybitset.svg)
![action](https://img.shields.io/github/workflow/status/synodriver/pybitset/build%20wheel)

### install
```bash
pip install pybitset
```


### Usage
```python
from pybitset import BitSet

b= BitSet()
for i in range(1000):
    b.set(3*i)

for v in b:
    print(v)
```
- use ```BITSET_USE_CFFI``` env var to specify a backend

### Public functions
```python
class BitSet:
    def __init__(self) -> None: ...
    def __del__(self) -> None: ...
    @staticmethod
    def from_ptr(ptr) -> BitSet: ...
    def clear(self) -> None: ...
    def fill(self) -> None: ...
    def copy(self) -> BitSet: ...
    def resize(self, newarraysize: int, padwithzeroes: bool) -> bool: ...
    def size_in_bytes(self) -> int: ...
    def size_in_bits(self) -> int: ...
    def size_in_words(self) -> int: ...
    def grow(self, newarraysize: int) -> bool: ...
    def trim(self) -> bool: ...
    def shift_left(self, s: int) -> None: ...
    def shift_right(self, s: int) -> None: ...
    def set(self, i: int) -> None: ...
    def set_to_value(self, i: int, flag: bool) -> None: ...
    def get(self, i: int) -> bool: ...
    def count(self) -> int: ...
    def minimum(self) -> int: ...
    def maximum(self) -> int: ...
    def inplace_union(self, b2: BitSet) -> bool: ...
    def union_count(self, b2: BitSet) -> int: ...
    def inplace_intersection(self, b2: BitSet): ...
    def intersection_count(self, b2: BitSet) -> int: ...
    def disjoint(self, b2: BitSet) -> bool: ...
    def intersect(self, b2: BitSet) -> bool: ...
    def contains_all(self, b2: BitSet) -> bool: ...
    def inplace_difference(self, b2: BitSet) -> None: ...
    def difference_count(self, b2: BitSet) -> int: ...
    def inplace_symmetric_difference(self, b2: BitSet) -> bool: ...
    def symmetric_difference_count(self, b2: BitSet) -> int: ...
    def __iter__(self): ...
    def for_each(self, func) -> bool: ...
    def print(self) -> None: ...

```
