.
Project description
BitMap for python
This package provides a BitMap class which is an array of bits stored in compact format.
Installation
bitmap can be installed from pip:
$ sudo pip install bitmap
Functions
BitMap(maxnum): construct aBitMapobject withmaxnumbitsset(pos): set the bit at positionposto 1reset(pos): reset the bit at positionposto 0flip(pos): flip the bit at positionposcount(): return the number of 1ssize(): return the size of theBitMaptest(pos): check if bit at positionposhas been set to 1any(): check if any bit in theBitMaphas been set to 1none(): check if none of the bits in theBitMaphas been set to 1all(): check if all bits in theBitMaphas been set to 1nonzero(): return indexes of all non-zero bitstostring(): convert aBitMapobject to0and1stringfromstring(bitstring): create aBitMapobject from0and1string
Examples
from bitmap import BitMap
bm = BitMap(32)
print bm.tostring()
bm.set(1)
print bm.tostring()
bm = BitMap.fromstring("00011101")
print bm.tostring()
bm.flip(1)
print bm.tostring()
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
bitmap-0.0.7.tar.gz
(3.4 kB
view details)
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bitmap-0.0.7.tar.gz.
File metadata
- Download URL: bitmap-0.0.7.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/2.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7fb8fcdade2223348132c108619f93178b563f584ed552aa5d3c6f946958a2d
|
|
| MD5 |
12d443f62dbb6a54d8aa48e32ddba62a
|
|
| BLAKE2b-256 |
5c4216842f4fdaabd710fbe7b2577a016f4ac9b5b3076e29611f96716c5a672b
|
File details
Details for the file bitmap-0.0.7-py3-none-any.whl.
File metadata
- Download URL: bitmap-0.0.7-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e768adb29a7429729e79c0bd59d6351b47b65b6fc7478c239e07fefdc4dfc49
|
|
| MD5 |
85aec86f94dfc2788f02b4400878587d
|
|
| BLAKE2b-256 |
3a180cf0116c3faf5023a6e971549055d42907020bca37320b3ada380e07f3ff
|
File details
Details for the file bitmap-0.0.7-py2-none-any.whl.
File metadata
- Download URL: bitmap-0.0.7-py2-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/2.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee994535356cf18f82793823a873ae4feb6074e3cd7b443176ca4e208d59f9f7
|
|
| MD5 |
1193bba266786999dc01b17151ac500e
|
|
| BLAKE2b-256 |
0f0caaf4bce788435605e40d0f5f4f3c7077337254fbce6c308386a8f18f350f
|