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.1.0.tar.gz (205.3 kB view details)

Uploaded Source

Built Distributions

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

intbitset-4.1.0-cp314-cp314-win_amd64.whl (78.4 kB view details)

Uploaded CPython 3.14Windows x86-64

intbitset-4.1.0-cp314-cp314-musllinux_1_2_x86_64.whl (522.4 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

intbitset-4.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (513.4 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

intbitset-4.1.0-cp314-cp314-macosx_11_0_arm64.whl (91.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

intbitset-4.1.0-cp314-cp314-macosx_10_15_universal2.whl (173.2 kB view details)

Uploaded CPython 3.14macOS 10.15+ universal2 (ARM64, x86-64)

intbitset-4.1.0-cp313-cp313-win_amd64.whl (76.7 kB view details)

Uploaded CPython 3.13Windows x86-64

intbitset-4.1.0-cp313-cp313-musllinux_1_2_x86_64.whl (524.6 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

intbitset-4.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (519.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

intbitset-4.1.0-cp313-cp313-macosx_11_0_arm64.whl (91.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

intbitset-4.1.0-cp313-cp313-macosx_10_13_universal2.whl (173.2 kB view details)

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

intbitset-4.1.0-cp312-cp312-win_amd64.whl (77.1 kB view details)

Uploaded CPython 3.12Windows x86-64

intbitset-4.1.0-cp312-cp312-musllinux_1_2_x86_64.whl (522.6 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

intbitset-4.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (530.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

intbitset-4.1.0-cp312-cp312-macosx_11_0_arm64.whl (91.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

intbitset-4.1.0-cp312-cp312-macosx_10_13_universal2.whl (174.8 kB view details)

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

intbitset-4.1.0-cp311-cp311-win_amd64.whl (77.7 kB view details)

Uploaded CPython 3.11Windows x86-64

intbitset-4.1.0-cp311-cp311-musllinux_1_2_x86_64.whl (557.8 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

intbitset-4.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (546.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

intbitset-4.1.0-cp311-cp311-macosx_11_0_arm64.whl (95.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

intbitset-4.1.0-cp311-cp311-macosx_10_9_universal2.whl (180.6 kB view details)

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

intbitset-4.1.0-cp310-cp310-win_amd64.whl (77.1 kB view details)

Uploaded CPython 3.10Windows x86-64

intbitset-4.1.0-cp310-cp310-musllinux_1_2_x86_64.whl (524.8 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

intbitset-4.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (513.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

intbitset-4.1.0-cp310-cp310-macosx_11_0_arm64.whl (94.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

intbitset-4.1.0-cp310-cp310-macosx_10_9_universal2.whl (178.3 kB view details)

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

File details

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

File metadata

  • Download URL: intbitset-4.1.0.tar.gz
  • Upload date:
  • Size: 205.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for intbitset-4.1.0.tar.gz
Algorithm Hash digest
SHA256 73145ff05e4227c76585ff8550638b6a083cd130010b781045d81af58f7b6920
MD5 d07f5c457e188d1db03d75302c10807f
BLAKE2b-256 83bb1d708f68dda768a3adacf7e477899cbdf5414bc292d7ab6bdfce39757035

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: intbitset-4.1.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 78.4 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for intbitset-4.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 47416d84df7ad030959077b6839f44c6b3a57387209ed161ce9350a175d78dad
MD5 99ee5a4637f4e3fd69123f09ad89a704
BLAKE2b-256 ac922fe214f9d768653109d3e41f166687069bc120adf2ca467df98007cd4034

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a37ef96d79e150a7657718880b54c6a371b2c34222852b05440554a5a6eb6920
MD5 05b935689a914831b682f7f797fe8fe2
BLAKE2b-256 622a516887bc0722c6c65e1396e1a165fe0c42e3143cb8829a5e1dfd45a65e28

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9567aa894c12fbcaea5a26204ae209de6a0dccce784e1df14becae62b9f6f184
MD5 cf5b9205cefe44a96595e5670fac8029
BLAKE2b-256 94f809d4f57b42b8f731b8edba9155f7578e615230cce49730c0f3545a135dbb

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 602d479993d45cfa5ae70924690a6abc6897aadc4c1de3b164ec5c4be9f08a9e
MD5 f79f67a177fecfa3b8a9554c3f30e1ac
BLAKE2b-256 349457b37096fe0c32e95ddb70cc453f6f9c333aa5e3ebde7ab880b2b6a5bf99

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp314-cp314-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp314-cp314-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 6592e92eb3dfec9587e0fb741bb05840f23e7388e91ca2f52d985b28f1209d2a
MD5 1ea2f342b7a99ea998de73059b259550
BLAKE2b-256 18a33b194f2e4961b68dc92a270175fe2b1030dbd0a5a69f4539f21cbdb0744e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-4.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 76.7 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for intbitset-4.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3368ebe251eafb188143655628fbae77a9983daa5e7ebd9b2ab0c9e4743d9585
MD5 3aace212164adc79e20d2d1cc93ec0e6
BLAKE2b-256 587ee8550848cfcbd2d3fb907ac586e67782def396159c81bed787be8db6a95c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-4.1.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 61707e096518fd64ab51987d8d18062819560b0686d80f4a1457c89e7b51a258
MD5 4d88a9a0961a601cc2188b16e4541f87
BLAKE2b-256 db000ab9d49ecef1b3e3cec9d4e167c78cf83bc75393d258d2bba5a6644939b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-4.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8fa86ec08e6b0968844b9b542e2217adfdb2712626ea7e3ae110587eb38d2fcb
MD5 7e4ca720f19133e1f803669c03f63c08
BLAKE2b-256 e0ac4797410ae0b758411ac8e5e0f26c4295653486f47edd8cc5cee5b8145270

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a1090f443142b28b916eb9f31e6f1e7826fe0971f8e684404411e8eb12e6eb35
MD5 7150238edb618378ce59278dd1dd6c42
BLAKE2b-256 70845f0d1faa7df2d0a9b858f95dcca147e37537c4c88f5be2ab43b4e674afb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-4.1.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 fb4507b314f028d3f7f7e76db783762d0387f2b0e67dbb6496deed1178497d3a
MD5 ca805661ea7d9c42bf23eec35b8c8bf1
BLAKE2b-256 21b92c23eda67a5329cee25106de5e4f8209892b4a90fc0d330ec0b4589006fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-4.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 77.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for intbitset-4.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9d0e4eb9b7751b5c1206dc83ac0fb9107aad2efae1829871d04bfa3516ea7d66
MD5 3e92b0ebed64428890657f02f7e6fc75
BLAKE2b-256 8631f503bdcf6e44371c6486518e833aa8ff0fd87d3216a12181613539cab491

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8b15141d02b6d4b06e3d11da39b6e4b771be80d7abdc0d2bfa878789254ae991
MD5 e120e78a0c7f1089c0606ec2b9e15b7b
BLAKE2b-256 589cd9d98017574e71151cc7aa0699789a82a28eea8ecc6c5fd6735a530b0871

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-4.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0d4c4ad3c682a7a1fb8e8f95731fae154a80c7ef5526b1450d1b9b6e1f76086c
MD5 e79e2562d861d5dd91b6815a81866b71
BLAKE2b-256 fa3fa460482b2a7d29fb7409e907904b73557c5eb5b61852c74d06f4c5e71032

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f707f42c0eb233e39bda76adf5d0b8a55c519bef1b3dbce20335a9f0f958b532
MD5 befee431d0451c953b847b8bb4a488f1
BLAKE2b-256 a90875037dd081512cd944a350f6e429cb719f2a173db7b5b0ca3f39021d578a

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 1d0a96d79a0372c2b72c1b0758a895cd8883f3c2b3194db65ecce7f642d6a31d
MD5 f85de3aff790a66f0d475c4bed1955b6
BLAKE2b-256 387db652a2b720190dd9064e2587901f1a4cf9888f1c284f8f6a51db1e0e796d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-4.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 77.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for intbitset-4.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fb3b557da5d3409dbebf603b5cca6fea2bde107a83c0806863a005532b11b306
MD5 47ea56547fcdf8ed407675f8df1561f5
BLAKE2b-256 6017d1ac571065c80b8cda53282b31c1cde1e5e3a59887381270b48d052b28f3

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9fd683303e2fcbb7e71ce077424fd3eba98f1bec567a5a046d499d6367f19351
MD5 9b943c4fe4b4a2fabda273ec652db360
BLAKE2b-256 2de97b4098bdb01b7763a7d56c1513f9a0a910fae793c56d0024e076a1071c7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-4.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 79fc82ef2a869949a8498834696937f57be9d26524537cf57a05b8f56e64159a
MD5 cdd79af02f18207336a44324ec68d0a8
BLAKE2b-256 c7d80f2085269fc74b9cc9cf3400656600b5e03bb1246a53b92bbc7cf4969ecb

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 20536475b51a5da4ab1acd075f12d5631bf55247f0c78053a1b13766608e81f7
MD5 b2b64561a534e6354aa4bbf32e604230
BLAKE2b-256 6ccf21dc8117319c1898f05028d7595381e33e4dd8a1d36e024396b619dbbb93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-4.1.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f6a868e5018e176f880ed203f93bf39ee6f60be40b5ec5ffd6391d570c152eaf
MD5 a7e124348b1c6d0cbfb2fc564595c7b4
BLAKE2b-256 e488d6de42a39f40aeea7924e02e701c81bb7fbfa2c2bfa5417c5d7d59276fce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: intbitset-4.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 77.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for intbitset-4.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9566e99c6ff1a085379160bb72c292aa7d6a93bc1941473e0cd7aa2346628b14
MD5 3c449cf01fb41dcaca95634e46fabc3e
BLAKE2b-256 397db4ade57902bb19870bda483b6cf65f10730f670925cc2bdd8a0750bd1af3

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 53589a1d9e5c71b05d76c276bcaff0b4293419ef9c884200e543811d59e72db6
MD5 e4d25bb26b41753e5ed555ee326ec1b4
BLAKE2b-256 b1069c07047f940e8981eb86109ce13be23f82f45c1d35d08a2f39e6834fcc61

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8391752082ce5abd4f67ae16a00cf83732c6b6fbcf126b3f9ab1110d0f30bf11
MD5 1eb842513ea843e46170f841a6cd1358
BLAKE2b-256 4d38bbb3610d65eeb6091087d3acf8a40abfb1a17a7421b90510a3c284a59495

See more details on using hashes here.

File details

Details for the file intbitset-4.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intbitset-4.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8965343440337ff18b3e398b8162d3034f15ad7158b15d4a5b9f29cbc92e468
MD5 fb5d1f17afc7e721ad55b45ebed54300
BLAKE2b-256 d49e19776726411b42dba93d49031594cb9a707427da3f95cd693b2a3e187b22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for intbitset-4.1.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7f22018d8840c7aa23fa7e1e126651a57e11a7c810dae1801e4498462ed7d9b6
MD5 21650330bbf55695099719e8e7c3a3a3
BLAKE2b-256 4510af18d9ac28cf2d3e83bfc1e4a65da4eba22eff533edd885f76f3547c28c3

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