Skip to main content

C-based extension implementing fast integer bit sets.

Project description

https://img.shields.io/travis/inveniosoftware/intbitset.svg https://img.shields.io/coveralls/inveniosoftware/intbitset.svg https://img.shields.io/github/tag/inveniosoftware/intbitset.svg https://img.shields.io/pypi/dm/intbitset.svg https://img.shields.io/github/license/inveniosoftware/intbitset.svg

Installation

intbitset is on PyPI so all you need is a C compiler and pip:

pip install intbitset

Documentation

The intbitset library provides a set implementation to store sorted unsigned integers either 32-bits integers (between 0 and 2**31 - 1 or intbitset.__maxelem__) or an infinite range with fast set operations implemented via bit vectors in a Python C extension for speed and reduced memory usage.

The inbitset class emulates the Python built-in set class interface with some additional specific methods such as its own fast dump and load marshalling functions.

>>> from intbitset import intbitset
>>> x = intbitset([1,2,3])
>>> y = intbitset([3,4,5])
>>> x & y
intbitset([3])
>>> x | y
intbitset([1, 2, 3, 4, 5])

intbitset additionally support the pickle protocol, the iterator protocol and can behave like a sequence that can be sliced. Because the intergers are always stored sorted, the fist element of a non-empty set [0] is also the min() integer and the last element [-1] is also the max() integer in the set.

When compared to the standard library set class, intbitset set operations such as intersection, union and difference can be up to 5000 faster for dense integer sets.

Complete documentation is available at <http://intbitset.readthedocs.io> or can be built using Sphinx:

pip install Sphinx
python setup.py build_sphinx

Testing

Running the tests are as simple as:

python setup.py test

Running the tests on multiple Python versions:

pip install tox
tox

Development

To regenerate the C code with Cython:

pip install cython
cython intbitset/intbitset.pyx

Then commit the regenarted C source and update the CHANGE.rst

License

Copyright (C) CERN and others

SPDX-License-Indetifier: LGPL-3.0-or-later

intbitset is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

intbitset is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with intbitset; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

In applying this licence, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction.

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

intbitset-2.4.1.tar.gz (152.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

intbitset-2.4.1-cp39-cp39-win_amd64.whl (68.4 kB view details)

Uploaded CPython 3.9Windows x86-64

intbitset-2.4.1-cp39-cp39-macosx_10_14_x86_64.whl (78.0 kB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

intbitset-2.4.1-cp38-cp38-win_amd64.whl (65.8 kB view details)

Uploaded CPython 3.8Windows x86-64

intbitset-2.4.1-cp38-cp38-win32.whl (59.2 kB view details)

Uploaded CPython 3.8Windows x86

intbitset-2.4.1-cp38-cp38-macosx_10_14_x86_64.whl (76.8 kB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

intbitset-2.4.1-cp37-cp37m-win_amd64.whl (63.9 kB view details)

Uploaded CPython 3.7mWindows x86-64

intbitset-2.4.1-cp37-cp37m-win32.whl (57.6 kB view details)

Uploaded CPython 3.7mWindows x86

intbitset-2.4.1-cp37-cp37m-macosx_10_9_x86_64.macosx_10_10_x86_64.whl (76.6 kB view details)

Uploaded CPython 3.7mmacOS 10.10+ x86-64macOS 10.9+ x86-64

intbitset-2.4.1-cp36-cp36m-win_amd64.whl (63.8 kB view details)

Uploaded CPython 3.6mWindows x86-64

intbitset-2.4.1-cp36-cp36m-win32.whl (57.6 kB view details)

Uploaded CPython 3.6mWindows x86

intbitset-2.4.1-cp36-cp36m-macosx_10_9_x86_64.macosx_10_10_x86_64.whl (81.1 kB view details)

Uploaded CPython 3.6mmacOS 10.10+ x86-64macOS 10.9+ x86-64

intbitset-2.4.1-cp27-cp27m-win_amd64.whl (61.5 kB view details)

Uploaded CPython 2.7mWindows x86-64

intbitset-2.4.1-cp27-cp27m-win32.whl (56.1 kB view details)

Uploaded CPython 2.7mWindows x86

File details

Details for the file intbitset-2.4.1.tar.gz.

File metadata

  • Download URL: intbitset-2.4.1.tar.gz
  • Upload date:
  • Size: 152.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1.tar.gz
Algorithm Hash digest
SHA256 44bca80b8cc702d5a56f0686f2bb5e028ab4d0c2c1761941589d46b7fa2c701c
MD5 4f76e100da761aa92188151c0dbdec60
BLAKE2b-256 693b4cec80656a4194ffcad1526b7056c2c5c82ef9cd9ecc41bb959e84a738d6

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 68.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1c9195b6795e40e35706af9c6d08664a53cf7ddf4b614b70564ebb0a78cd62a8
MD5 04bb472a55dad0686af835e9965f9c98
BLAKE2b-256 02e7bca0cad2bb39afbddfa4b23e5234ee6528261975cf186898852a4377d31f

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 78.0 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 1a6d8f296a833620ecde74ac5b6b5623d53cdc80c2c2bd2b528df5d7704b83dc
MD5 4bb9bd8bc10a1472f4fd1be9a0034258
BLAKE2b-256 0f6979dd0d57384c1beb0582e26d78e9adcfa85afd37848967903253c9520187

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 65.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 91b157166978ee0b342f63cf1b4de29759260a9ab7f9bb5d37d5250af07d770d
MD5 169f0d1c57a1fa66345a1a20735ace46
BLAKE2b-256 b72c0f45ae6cbda55acbfdbe881c7786d04bc5afcf637d00399ac00f751057f9

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp38-cp38-win32.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp38-cp38-win32.whl
  • Upload date:
  • Size: 59.2 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 6f91ee074c3ce836b35c84852f3b180a96d08f6558ba16f5563982cf3fff9c4a
MD5 df22b9e0e7ff61b79c29fdecbfa36847
BLAKE2b-256 ce7a63f88ddf260b80d35be8509f5f74dff6e4e19cd3c77cdbfec69cfab7b8aa

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 76.8 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4aa695962cd6fc86f07fe3fb881082e964fe512b3b96cfbb9edadc5af0972abe
MD5 860008560b2cad2bee27c8c2c237e702
BLAKE2b-256 24e64df4cb747addbe6d224e8bd5fa80dc5729deb0a420263fb725632467dd52

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 63.9 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6ffb7b4832cdf21f57e3619536970726770bf9ba775a4a4b25d9618c220f0ddd
MD5 a5af0b0093ca9a375e4064f283a6a9e1
BLAKE2b-256 42c5156d62255cfa890d0da34c4d226652c98b88b72c33cd7a1ac7085a986ff0

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp37-cp37m-win32.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 f8cabafeea7ce1f13d034976fafd356a2a38f46ed26ee2cbb6b50639883975f2
MD5 a4dea70362496cd7ba3483865a68b2a6
BLAKE2b-256 401202f5ecd78fa380b3744813d46c5c34a21de9267080cd18e7311127ddb1d9

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp37-cp37m-macosx_10_9_x86_64.macosx_10_10_x86_64.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp37-cp37m-macosx_10_9_x86_64.macosx_10_10_x86_64.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: CPython 3.7m, macOS 10.10+ x86-64, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp37-cp37m-macosx_10_9_x86_64.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 bc3ae9678eed3674efe547c76d6dccbaac8d2a9bc4c989efe793b538a0c26b52
MD5 6b2778aa0f2007fe54b609b0a8b4ad31
BLAKE2b-256 30c08396a3438e2b4acf74dcab74975d19ceebfc09a074fa3276c2520498f956

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 63.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 86e2472c333ea24eb0d1640815fa5c48620a17e221efd76bf332d891b27bf3ac
MD5 8e81ca33ff10f7a89ce321fb459d2b7e
BLAKE2b-256 56e92ec78530db21a7b78e028bf306126312e06508aae8023ac68186f9e1f0b5

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp36-cp36m-win32.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 23397ee757478f5328cb5ab342b2d829f716425c6d0a12e6d845b23788104e49
MD5 2381a081636e67cef3402b32d8df7c93
BLAKE2b-256 b8a527815ba2fa0b8eb1c73069cc36ccee8592878f9b24cb59a0bb2a24edd2ee

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp36-cp36m-macosx_10_9_x86_64.macosx_10_10_x86_64.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp36-cp36m-macosx_10_9_x86_64.macosx_10_10_x86_64.whl
  • Upload date:
  • Size: 81.1 kB
  • Tags: CPython 3.6m, macOS 10.10+ x86-64, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp36-cp36m-macosx_10_9_x86_64.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 d2fe4a94863655e44b3b16e96020c765a73d75eba641f0657b10783b5006fe7a
MD5 f97c934e05d72f58b3c74e975eb4b874
BLAKE2b-256 ca5f8629f589b8128daa9beed94cdd39050cc0b2a2f15ea0900e9d235d8b9a5b

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 61.5 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 31b86c74f1b6c83c0b6de10d3e4c05a7307dd39ada11047d3b216cbedba4d0c4
MD5 fbff5d7f2cd44be9e6adeb2aa3d63fbb
BLAKE2b-256 a1fc74987b867e81b3babf9756173bcd6b5d31603a3bb25f32ec363888a16cd5

See more details on using hashes here.

File details

Details for the file intbitset-2.4.1-cp27-cp27m-win32.whl.

File metadata

  • Download URL: intbitset-2.4.1-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 56.1 kB
  • Tags: CPython 2.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for intbitset-2.4.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 d0cfcdbf4ad14d9e32a11a10574e8b09ae6501d852ee514ebd50e016fe608051
MD5 524cf96b92c65bf9e56df96edf98ad23
BLAKE2b-256 9fc58cd6a26845ee6093271837e1309984db36f0eb3ef246eeef2af99caf7efa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page