Skip to main content

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 a BitMap object with maxnum bits
  • set(pos): set the bit at position pos to 1
  • reset(pos): reset the bit at position pos to 0
  • flip(pos): flip the bit at position pos
  • count(): return the number of 1s
  • size(): return the size of the BitMap
  • test(pos): check if bit at position pos has been set to 1
  • any(): check if any bit in the BitMap has been set to 1
  • none(): check if none of the bits in the BitMap has been set to 1
  • all(): check if all bits in the BitMap has been set to 1
  • nonzero(): return indexes of all non-zero bits
  • tostring(): convert a BitMap object to 0 and 1 string
  • fromstring(bitstring): create a BitMap object from 0 and 1 string

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)

Source distribution for bitmap 0.0.7
File Size Uploaded
bitmap-0.0.7.tar.gz 3.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for bitmap 0.0.7
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.7 This release

3 release files

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page