Skip to content
A pure python bitmap index.
Python
Branch: master
Clone or download
Andrew Grundy
Latest commit 2a58843 Sep 24, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bitmapindex initial code commit Sep 24, 2016
tests initial code commit Sep 24, 2016
.coveragerc initial code commit Sep 24, 2016
.gitignore initial code commit Sep 24, 2016
LICENSE
README.md update the readme to include example usage Sep 24, 2016
setup.cfg initial code commit Sep 24, 2016
setup.py get setup from setuptools rather than distutils.core Sep 24, 2016
tox.ini initial code commit Sep 24, 2016

README.md

python-bitmap-index

A pure python bitmap index.

Example usage

In [1]: from bitmapindex import BitmapIndex

# construct an empty bitmap index
In [2]: b = BitmapIndex()

# set 47 to True
In [3]: b[47] = True

# run length encoding representation of the bitmap index
In [4]: b.rle
Out[4]: '470.1.'

# list of integers representation of the bitmap index
In [5]: b.ints
Out[5]: [47]

# check if 47 has been set to true
In [6]: 47 in b
Out[6]: True

# count the number of items set to true in the bitmap index
In [7]: len(b)
Out[7]: 1

# remove 47 from the bitmap index
In [8]: del b[47]

# check the status of 47 - it should've been set to False
In [9]: b[47]
Out[9]: False
You can’t perform that action at this time.