A C-based bitmap implementation.
Project description
cbitmap
A C-based bitmap implementation.
Install
pip install cbitmap
Basic Usage
import
from cbitmap import Bitmap
init a bitmap
# pass a number to init a bitmap
size = 100
b = Bitmap(size)
# or load a bitmap from disk
path = '/path/data'
b = Bitmap.load(path)
set
b = Bitmap(100)
b.set(10)
get
b = Bitmap(100)
b.set(10)
print(b.get(10)) # True
print(b.get(1)) # False
print(b.get(100000)) # False
delete
b = Bitmap(100)
b.set(10)
print(b.get(10)) # True
b.delete(10)
print(b.get(10)) # False
Persistence
b = Bitmap(1000)
path = '/path/data'
b.dump(path)
b = Bitmap.load(path)
len(b) == 1000 # True
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cbitmap-0.0.2.tar.gz
(34.6 kB
view hashes)
Built Distributions
Close
Hashes for cbitmap-0.0.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5665a107db39b7e9e53745e93681db0f9ce0752ddad5f6bef8c787515827bb |
|
MD5 | ffcc080997d42f02183101bcc1e569ab |
|
BLAKE2b-256 | 504ec6085fbdc84bb4c38ffb3cebddedbe4a3839ba97fbab8dcbd5041e87ea06 |
Close
Hashes for cbitmap-0.0.2-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 742aca945dd85abcb3d2c2894d754b0898be99c061918914ef2a41c4428b2288 |
|
MD5 | 4ff12172c695de1173ba48b1384c83ea |
|
BLAKE2b-256 | 3a99021dc4d95f8025588f536755841565bfea935b740bf19c619debcd117ef7 |