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()
Metadata
Release files for bitmap 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bitmap-0.0.7.tar.gz | 3.4 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bitmap-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
| bitmap-0.0.7-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 11.1 kB
Release files / bitmap-0.0.7.tar.gz
| Download URL | bitmap-0.0.7.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7fb8fcdade2223348132c108619f93178b563f584ed552aa5d3c6f946958a2d
|
|
BLAKE2b-256 checksum How to use checksums |
5c4216842f4fdaabd710fbe7b2577a016f4ac9b5b3076e29611f96716c5a672b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / bitmap-0.0.7-py3-none-any.whl
| Download URL | bitmap-0.0.7-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e768adb29a7429729e79c0bd59d6351b47b65b6fc7478c239e07fefdc4dfc49
|
|
BLAKE2b-256 checksum How to use checksums |
3a180cf0116c3faf5023a6e971549055d42907020bca37320b3ada380e07f3ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / bitmap-0.0.7-py2-none-any.whl
| Download URL | bitmap-0.0.7-py2-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
ee994535356cf18f82793823a873ae4feb6074e3cd7b443176ca4e208d59f9f7
|
|
BLAKE2b-256 checksum How to use checksums |
0f0caaf4bce788435605e40d0f5f4f3c7077337254fbce6c308386a8f18f350f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|