Skip to main content

C-based extension implementing fast integer bit sets.

Project description

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

pip install intbitset

We provide pre-built wheels for the most common operating systems and common 64 bits CPU architectures. Otherwise, you will need a C compiler if you build from sources.

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])

Additionally, intbitset supports:

  • The pickle protocol,

  • The iterator protocol

  • intbitset can behave like a sequence that can be sliced.

  • Natural min and max. Because the integers 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 and the intersection, union and difference of intbitset``can be up to 5000 faster for dense integer sets than the standard library ``set.

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:

pip install -e .[tests]
pytest

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 regenrated C source and update the CHANGELOG.rst

License

Copyright (C) CERN and others

SPDX-License-Identifier: 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-4.0.0.tar.gz (193.0 kB view details)

Uploaded Source

Built Distributions

intbitset-4.0.0-cp313-cp313-win_amd64.whl (80.4 kB view details)

Uploaded CPython 3.13 Windows x86-64

intbitset-4.0.0-cp313-cp313-musllinux_1_2_x86_64.whl (479.5 kB view details)

Uploaded CPython 3.13 musllinux: musl 1.2+ x86-64

intbitset-4.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479.9 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

intbitset-4.0.0-cp313-cp313-macosx_10_13_universal2.whl (166.7 kB view details)

Uploaded CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64)

intbitset-4.0.0-cp312-cp312-win_amd64.whl (80.8 kB view details)

Uploaded CPython 3.12 Windows x86-64

intbitset-4.0.0-cp312-cp312-musllinux_1_1_x86_64.whl (484.6 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

intbitset-4.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (486.4 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

intbitset-4.0.0-cp312-cp312-macosx_10_9_universal2.whl (169.2 kB view details)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

intbitset-4.0.0-cp311-cp311-win_amd64.whl (81.3 kB view details)

Uploaded CPython 3.11 Windows x86-64

intbitset-4.0.0-cp311-cp311-musllinux_1_1_x86_64.whl (500.0 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

intbitset-4.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (501.2 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

intbitset-4.0.0-cp311-cp311-macosx_10_9_universal2.whl (170.2 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

intbitset-4.0.0-cp310-cp310-win_amd64.whl (80.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

intbitset-4.0.0-cp310-cp310-musllinux_1_1_x86_64.whl (469.6 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

intbitset-4.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (434.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

intbitset-4.0.0-cp310-cp310-macosx_10_9_universal2.whl (169.2 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

intbitset-4.0.0-cp39-cp39-win_amd64.whl (80.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

intbitset-4.0.0-cp39-cp39-musllinux_1_1_x86_64.whl (469.5 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

intbitset-4.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (356.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

intbitset-4.0.0-cp39-cp39-macosx_10_9_universal2.whl (169.6 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

File details

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

File metadata

  • Download URL: intbitset-4.0.0.tar.gz
  • Upload date:
  • Size: 193.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for intbitset-4.0.0.tar.gz
Algorithm Hash digest
SHA256 c141edaa1c17b91c2987537e269d955ab6bdc3966af3deb6e1e0d20edbd09dd2
MD5 a625dceef38d3d7d803b45ac5c24d843
BLAKE2b-256 97281461048d37d258c820ed7db3cbb847f5cf39830a1ef671e6ac33b62f3607

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e740c9abd06de912e06f3d941afc2640b51a9b9bdf3213b7b6f68b371ca4bf96
MD5 bba99b14dad847937b41b6bdbd2097c4
BLAKE2b-256 fa0a71d2854265f61730a00e916e6238f0d223323613999f06b3607718327f7c

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 673ed77360c5b1131f8e7968a54b5f06dc41335357f0fca7f5568a54c5bdb1db
MD5 842803d25f85945d68083fbc59e33f7f
BLAKE2b-256 6ad7f97dd910c861a997bdb7c635c62f092b1d11bab5d2895db738297db77e61

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8cc4831d34bc50b159bdb158453e4730b9dba7ea605b47f92421d30ca54fcc0a
MD5 c0599b6487ed1fcc9ff6eae2b77e937a
BLAKE2b-256 31d2d616114d3a3006b239292d86963ecbc4836699e2b70596941b873b60d333

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 c0bfe1d4ff53cb4b157059a49edf06ffa486d1ca08b73f1473273d4c57652850
MD5 dad0f43683b15c2459d0d555ce191f8b
BLAKE2b-256 ef9c10cb23829db5c1fcb2855fc9ffda89e4a4996352a93cf3f95ff4fb3dfae5

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9436ce5ae5cec6308ece0b717e2861b9fcbc88b58b39d012c00d88246a391022
MD5 1556f0b26394b9f6ac677c52de046111
BLAKE2b-256 0c85eadf49b4e7c9b9095540f56ca785d34fb16bebc8d34c0b63ae0dc721cb66

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 2740fa12d45b0632adef9b466aa923fbfaa7883a0879902c1d6f3e3db85fa506
MD5 b9c7ad16e8cf1a04f42e5024ea83732f
BLAKE2b-256 f94f73eb717c4de20f457127e89804e526b3715682ff5859e1e3d89b9a7bf031

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee02a57a012e27c14f6368a59055eec799a892059594f313747b10138709a595
MD5 22649d36858ebc1b46ed93c0b2c63597
BLAKE2b-256 64f216035b3539585b3ab18c2d5f1515b0f3f6326ce77b88f58eef07043c5c96

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 981d7662f717c87241bd7a7ec46b15255cb3f31b4bbd00e6a289f71e52a37488
MD5 3c87093fb0dfdf2ba348135c499d6945
BLAKE2b-256 0956c08b0a8c74fa352223e196e48f079870574458e30321b6d43b78cd77e030

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f905d1e10ead1fc206b7772461565261ba984a4d230435d5ba68e59e93f27285
MD5 1cdc2642cdc14039f2f48ca9a9a9ca5c
BLAKE2b-256 df73dafb5387a9835a2c07e65b5c0686516b0e2604c5f1270aa260f11148117e

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 6022b0c30ec79616b41d9d70f099034852250dd7426e7d819e6434714f194755
MD5 55e9a112a2ebbc30152dd2d0314077e3
BLAKE2b-256 86ec526fb74bfeb9be56bf742d1446f98aeebc3caf9c48b04fdccccd849863f9

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81f6b8d0d53166e092e69437a67c6704fa94cca95d7d210a3f94a451d135812b
MD5 124f6bf59d16076ca3fef0914d73af81
BLAKE2b-256 016f1597e5b9e162985d57ad8942bb621004d4f3900a6c4b3872c70b181381a0

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0b09317654ace0ddc39133379885c86111476eb64088cdba1befa4c798d1e1fd
MD5 f244652306bb494f9dbb4a492f6b5e7f
BLAKE2b-256 05341eb6d6ccf0d574ee1748a49360c886d7e90c05918330dcd34e67aa14f9e7

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7ec6c3a2928ca8e4c574ceed628214c00465f1610cd4f69e7015e12fc0f6fb52
MD5 e0a153f8989e40c789c946e9e6a08e72
BLAKE2b-256 876cddadcd330cd877b0c7b3ef396d0d0ceee6516964b8b190722a3ed5108349

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 7ee3cf2f266fb5c6e5d06687cfc87d0977875a8cd26380fd49fe777eb06a86e1
MD5 4dc48d0cea58daa3eea1589f818b6beb
BLAKE2b-256 5289568d2d96255b3e8fbe3f8304df740a3ca64aa7aa390460d5d1630f7d6b3b

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 73d8190230c066ec65cc22042e807fb2c7716a71c1e55132e8dfc14b3d7c2cd9
MD5 6fd2ac4b0663f57a7eea5a318a20c2da
BLAKE2b-256 854707ea172457cf17d8874525172f20b33f31861c1a7b0b0f2ea27bfd5a9bc7

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 eb747e5806f90604db989bdd0e00a013398ec0c50a555757344585f13e94795e
MD5 f72b776ff2a11cbdead3511a7c297f0f
BLAKE2b-256 ec1bd28d9bd6ad407309c4cc6a6a29233c708299addab19f24c7a27d2cf3a9a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-4.0.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 80.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for intbitset-4.0.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b4a1e71e48fdaf49409468e712bdba139232d980607d187643360643b7bcff96
MD5 7d5512a6476cafc1aa4e41af2ce329b2
BLAKE2b-256 d00695913c0536a41a93ac0265bfd239df5f7744a72d0c7c0334e67b6b4457c5

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 6b3ec32e4770b91c033406173488dafd8dce0b16aa748b777ff9444b8897f5f0
MD5 4055c6228a2e10e3b363498b5d265aed
BLAKE2b-256 60c8270e681c7d4083a39b881e9d6823408359088f4f723e9fa6703701fc079e

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7d8c4f4fdc358e53b32fe7f77b723ea30bf385f50c2cfeab14f03e291dbbae5b
MD5 72d6e374560795d0039ed7443dcb0710
BLAKE2b-256 1daa77ab6516da099360fd31153649bf02203e70d51c65b83bf6d6447cb9df20

See more details on using hashes here.

File details

Details for the file intbitset-4.0.0-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for intbitset-4.0.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1b5622e8a531129f5db770ecd1c8070a378a3db3527c777f7f4d0cc615499753
MD5 f889fb45d9c176093b3f9e3b1eca2b3a
BLAKE2b-256 3ea6403ab02ac103d881912b81b2d4568423f28dfda19d9a97246189a7f0f61b

See more details on using hashes here.

Supported by

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