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-3.1.0.tar.gz (189.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-3.1.0-cp312-cp312-win_amd64.whl (79.6 kB view details)

Uploaded CPython 3.12Windows x86-64

intbitset-3.1.0-cp312-cp312-musllinux_1_1_x86_64.whl (476.1 kB view details)

Uploaded CPython 3.12musllinux: musl 1.1+ x86-64

intbitset-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (478.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

intbitset-3.1.0-cp312-cp312-macosx_10_9_universal2.whl (175.7 kB view details)

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

intbitset-3.1.0-cp311-cp311-win_amd64.whl (80.5 kB view details)

Uploaded CPython 3.11Windows x86-64

intbitset-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl (491.2 kB view details)

Uploaded CPython 3.11musllinux: musl 1.1+ x86-64

intbitset-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (494.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

intbitset-3.1.0-cp311-cp311-macosx_10_9_universal2.whl (179.6 kB view details)

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

intbitset-3.1.0-cp310-cp310-win_amd64.whl (79.6 kB view details)

Uploaded CPython 3.10Windows x86-64

intbitset-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl (464.0 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

intbitset-3.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (430.0 kB view details)

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

intbitset-3.1.0-cp310-cp310-macosx_10_9_universal2.whl (179.0 kB view details)

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

intbitset-3.1.0-cp39-cp39-win_amd64.whl (79.7 kB view details)

Uploaded CPython 3.9Windows x86-64

intbitset-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl (463.8 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

intbitset-3.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (353.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ x86-64

intbitset-3.1.0-cp39-cp39-macosx_10_9_universal2.whl (179.2 kB view details)

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

intbitset-3.1.0-cp38-cp38-win_amd64.whl (79.9 kB view details)

Uploaded CPython 3.8Windows x86-64

intbitset-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl (503.7 kB view details)

Uploaded CPython 3.8musllinux: musl 1.1+ x86-64

intbitset-3.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (374.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

intbitset-3.1.0-cp38-cp38-macosx_10_9_universal2.whl (177.0 kB view details)

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

File details

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

File metadata

  • Download URL: intbitset-3.1.0.tar.gz
  • Upload date:
  • Size: 189.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for intbitset-3.1.0.tar.gz
Algorithm Hash digest
SHA256 6e83c5ba7fda2520aa8565428bbaf842deb7293d665f3cd8281cb39254d2ff71
MD5 2ad2ac9ebff923a33574188216c8e1ee
BLAKE2b-256 171ea0de4407565ae27f5c6352392f72c0a1238f9f28b07f8cd34fbc716b0bf6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-3.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 79.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for intbitset-3.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a25c3d42dd18dd2a0e17944709183c2887a2653c616e8953a893be7a29f042be
MD5 1dc09192e127ca7f742c6e0fabd3f6dc
BLAKE2b-256 8a090c654af656144372b39c0029819e842fe80906855df458d042b7d1046c2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 4083a32b66c2e72feb697b014069a4bed16116b392574f9ced006eff1b1d743c
MD5 229337d0033d70a07f2e7284b899f10a
BLAKE2b-256 129181890541151f4cdd86cf17dfb72ff9b1c7b2ef7eb1a4f4e9f5dc2d11c453

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72763c492ade2c2aea8d34f3bec11b81f9f1e9219a1925908114898ee7fe34e4
MD5 817e4efe178efcf1d7b1d2ad95314bd5
BLAKE2b-256 742cc7e4c46adfbb3c6c87c83d4f2c630060343475a62b8f831dccca72557d80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 79d945608a6abeaa20b5511624408f2c8859f9e886fbe5e20a47ed16990d91af
MD5 ed214c9f0c53ac73ed154352ac34ca44
BLAKE2b-256 c7ff1ee747af126908232dc0c4e61a8e12883088ae806c30521509a6e73f23cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-3.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 80.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for intbitset-3.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f8d8d9ece67875f35e7860dc5103bde7c0881bb28005d12c5d2d54e3edc533b8
MD5 d6feb256a6604317d14f8386f6ee805a
BLAKE2b-256 f53a684dcbb8ac1f28ee1a4a4386d6d0851b40249b590fbfea9a58937c1eb041

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 8d669e3e90a89985cec95b87d066837a4aae604b9e280c59c1d8c6ac7784fb60
MD5 f416c3f12cb53ce3ff556417dd101e26
BLAKE2b-256 fa025f3f90b8daa430f4b520c63c321992fe365cc1ac9290066e9191f4d11c36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 353ea6b4c2f2c0aba4bd7b92bf6116fa82b16de9255b8b11a3d799c9cc0b640e
MD5 f1c6a291f5d9860957e5c7fbf260962c
BLAKE2b-256 2470b1ac992230c58501d31c6d6b50f61cf2ce72eb3a6890fc5df3d7999c5b80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 618ecb4d6aef50804ec20301a8c9c5949617c17d98e1287bb57e50644f66340a
MD5 7a7e611afb34b4342f3a5900ccf686b7
BLAKE2b-256 f7886aa0d0b1bb9ca612f7ca0d36c8377f1caaf2b3e444efdc4a2862f89444d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-3.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 79.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for intbitset-3.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3154f9d50da09eb4d6a797914b511cd027aeab058cae59d544d75218e790f118
MD5 9107270a3c65f1154273d931429ecca7
BLAKE2b-256 eb6113b0b9d9a1709ecf52a36c1ef20462846c27679bdf02ef7c0046a2bbd4de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 7509c46a0357e2700be245bd88e30d581fc7a3bbef0d3412e4c2c4bd3baca469
MD5 734c904faacd90ca3bb714f0f55eccc1
BLAKE2b-256 73e0ca420f48695d550c1ca94bb935c4984dc16b8dac6d7eda9035b8a9a2c74e

See more details on using hashes here.

File details

Details for the file intbitset-3.1.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-3.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ef8493342bab01a9ee893fb68591d4fe33be07ceced57ee65183e061bd18de37
MD5 44aa6bf320fe96f18b4190f951ac3be7
BLAKE2b-256 f388f03bdf07683b80945120bc97b755592e1d8c530f787ca6c022263641c29f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6c8780daedd455c4b05e9bf88e0280ae7fd9e62f08bc9ed8a97b49b55556ac01
MD5 d6013e43c9f1bf7efdee40c09831f1e7
BLAKE2b-256 a5962b2d5d6d208b8b20ea4cfdef0821a50e69a2eaf76f04d7847c9789bbd5c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-3.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 79.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for intbitset-3.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6b36e14f50313a197238c9bc67da16c02c7f5e76885008cd3a4c85561e2d54f9
MD5 60e3dd2fda3004d5564ace7c874688de
BLAKE2b-256 4a1d140531fe50ffc64ed07f1421c19ba8a8d81579c64b682f91f5914ad41b3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ea1973fb9fde78f273573c9e80be89d2c54afbab903a51d260d76427d50a83c5
MD5 ee2a819f56f12e060a6747d85576a086
BLAKE2b-256 1dd13225f86775ade373b044a208f8623780be79d7c70834244853e86a7520d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a358c6da657112ef045cc221ed6d214014ffa43f0b123e1390d3687d35b468d4
MD5 408a8233056a6a325134b308679840cc
BLAKE2b-256 5340bb030bb66d1e719ab247401f0a32a0d6fc3df2d6fdf7d6bff027a93f17c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-3.1.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 df05d834f1c73dbbf99be3a11011b78d4889b4cb2df91efc16d63bd1d78fa628
MD5 b5be5341fad3f3e0dfcc55dff07edacf
BLAKE2b-256 55a71bfc27a21c327e3e8e465708b9059434408bd9c8d62b60d4b6ada40b31d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-3.1.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 79.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for intbitset-3.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 723eb0cb3fa18438ab0eeb74036fd6e1b2d4997a267032863e7039e95b1524a8
MD5 1933c1494e6272131b2a214a83e6f486
BLAKE2b-256 fbeb15063ac9fef4a4624ff41d92f7fac60e83bd683e72ea37e1383b1e473ebf

See more details on using hashes here.

File details

Details for the file intbitset-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 40b678540169e2d8f9fa7802c816677e060ec15d21d3dda7ed753f4fcc50cff4
MD5 8158b9470ec37dfc891498f5d06645db
BLAKE2b-256 3eeeb4f7b951b395299db1c3bc9d4bb22a045006443b6f298a4c597cff1227ce

See more details on using hashes here.

File details

Details for the file intbitset-3.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-3.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1f951688ec54599109d15138c8a9af4c0e4e70867d8917c0e8975532fd4287d1
MD5 abab78d1edd82d1bcd2ff5d618e5795f
BLAKE2b-256 9ca4a087e1e5c1f23e21c59e6717f8c1bae0b4c8a21c1d6db9ea0678b6b3f7dc

See more details on using hashes here.

File details

Details for the file intbitset-3.1.0-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for intbitset-3.1.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 18c6d0c305c5ab6e763823a3784f4a0cced72ac4bfdbff4702f8b7eb31eae35a
MD5 cd7c455f4e317776531e12880591f02b
BLAKE2b-256 aa35d313c879974af393cc2e1c9e26c4cd1c9390b31e18db281b7738bb4f1ad9

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