C-based extension implementing fast integer bit sets.
Project description
Installation
intbitset is on PyPI so all you need pip:
pip install intbitset
We provide pre-built wheels for the most common operating systems and CPU architectures. Otherwise, you will need a C compiler.
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,
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for intbitset-3.0.2-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b10313835a204476f2ba253fb4e582be5a29601e1c2b7522dace97f22d0309e |
|
MD5 | 8dedc08bf4c2b52a101b432edb1e1020 |
|
BLAKE2b-256 | 8aebba034fa51d584cfabf801b102ff8a2aaa9f96389dfe8735753bfa7414768 |
Hashes for intbitset-3.0.2-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed3d4c0a67a3db24379b17d47a0a91ffd40eb700a7577b5df05246702dd39dab |
|
MD5 | 6563f707106d98da43369ee8a714e536 |
|
BLAKE2b-256 | 425440dfe2f9b6362baf5eac7e7f3dd841d6b79e896d8832af2f0b9afe33f4c2 |
Hashes for intbitset-3.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 666d06ff5935ba5a98cbaa2f76b516c380b55e510a427c02f74f50d571d356f3 |
|
MD5 | a1921c8612ace411f434c3eceff03ee7 |
|
BLAKE2b-256 | e20f63ad2b746b9e020fe346b6d6cdfa4913dd42a4bd9306568d7d691f01d361 |
Hashes for intbitset-3.0.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2e2f20dfaeefa73a9d3cf60af32c69cbcaa6beb3ea86071cb8c827462a13623 |
|
MD5 | 52ed8640c192a1093fe977f80adcefc3 |
|
BLAKE2b-256 | ece8eab94a19be54b81039782314d33b1d7c85634c6b4a608ffb86ac97cf0810 |
Hashes for intbitset-3.0.2-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 012cf6209431e0bce3dd7579fa62cff07e7b225c65bc17b5d03852c7d57c1e86 |
|
MD5 | d924b1b205ac1f6ce56b5b546eebc563 |
|
BLAKE2b-256 | 5a21909bfbcac8d50649699c13a641eea633af24ac45bb0ac0f45d7915e11c42 |
Hashes for intbitset-3.0.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7643345a8ee1aaf228ec4b480964e1737b810f9c611d3c8960afe35d5e88daea |
|
MD5 | 3571f101e6ce8aa61eab16c94b2aa737 |
|
BLAKE2b-256 | 15a5c4cf7cda50d23393185c230dce5ecc62fbfe7f8b76569603027068f2f51a |
Hashes for intbitset-3.0.2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f779bcc0b267ce6d699d6004ae7a2ead5bea6a21c2362c9b03d69826bf4f7ed8 |
|
MD5 | 4b6e6d72bc700cc64efa6e581b9d584c |
|
BLAKE2b-256 | 94f791622b69b9eb7fb037ade0b457de1ea7cb8c431e96b1f28627bf64315287 |
Hashes for intbitset-3.0.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77772377d1d6aa4562a41ded600f1bc7804ee0506fc76ccf8fb2f4662df41371 |
|
MD5 | d3ac1c7b6e0b27b11a39f964a175b23c |
|
BLAKE2b-256 | 6de705090f2e99e21025feb5b4aeefc54acd229af9cf4113f810ceba3e913536 |
Hashes for intbitset-3.0.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f4d5b8666b2d3d69ec591ccbe16aad1f3673b8a2849ef26bb2d1f9f45ca9dc8 |
|
MD5 | a0258bf9d955dc71900f133b480da25d |
|
BLAKE2b-256 | 23dac1a87dff92c2f87bd3aec24712e1bf3a6b9de210bb3dadf723f25a2a6266 |
Hashes for intbitset-3.0.2-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 768c6becf9a898355c044646c03f8ca71acfacf7de04f2aa43eb8f84ea619f17 |
|
MD5 | 768f7b14ea6c3a3b1cf14bd323c410c5 |
|
BLAKE2b-256 | 663c2744bacc1df174d525c27a5263f952f0adcce6505dfad8a3c106144a9b89 |
Hashes for intbitset-3.0.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45c70f876e42a288be781ebd0456a80897044f4b6d0bff55f8e24077dc2eb1ae |
|
MD5 | 85416cc007e14f82449ee67b668dc076 |
|
BLAKE2b-256 | c2d3da86c94d64c1fccd8c81418d1479b0a73a2f8a85822dcd73e63ea0c4fd2b |
Hashes for intbitset-3.0.2-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6236f8488e51de6efcf1720638b4583614dbcf5b542417b7e0e91f40f2131870 |
|
MD5 | d431a9816cc3a4f16ede454c2470ae20 |
|
BLAKE2b-256 | 7d906ec559c17775129da71b321cb34d87a6d039d13decbad4b23446528c95c7 |
Hashes for intbitset-3.0.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2ca7e7b95fb7c4bf35156f196117466984e56a10616ebba9a646bc6e228af58 |
|
MD5 | db8e0092520d09cd4e60d441eb7a64a9 |
|
BLAKE2b-256 | 3c6d4e47abc96f8e2d796540b6ccb3e2ebb9e70ed80cc4887264512e3bb570bd |
Hashes for intbitset-3.0.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f979f04ed1689402b1fca7054e212962b6c3b650c2cf12b80026d8c1843e3ce2 |
|
MD5 | dfb4e0e1418b95b7ea06f3bb5b037a66 |
|
BLAKE2b-256 | f741e5eb78f4bebac2adde221ff57cd25f9edaf2ba58ee66672ebb63f07e250d |
Hashes for intbitset-3.0.2-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6cc457ed31adbdc0c6acb6ea38f63f01084a868a6260a756660f11c74aa6b2e |
|
MD5 | 70d2a1406580c228bac386525db7fdfa |
|
BLAKE2b-256 | 4d6a082b9676adee922ee7c632eb3c2b190770e02c0cf87d9889deb1e5e31ec6 |
Hashes for intbitset-3.0.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cc0350936fc813721a0a40a046b87118405cdd78c4f546171c539e8facb713d |
|
MD5 | 0643648b2120a2f1546dbb9c75a542aa |
|
BLAKE2b-256 | 6583c1b1de89ff98f57096f2fc68ada59ce998b411ea0d204b9d1b04d807da0a |
Hashes for intbitset-3.0.2-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e303dc1ffcfb178b1aa05322d0b0ac4af66ad5dc42edf3054063dd66d99d437f |
|
MD5 | c3807125af47076d9ac1f26aa03b0b3f |
|
BLAKE2b-256 | bf33354ae5c1490c12864e6f9d9a1b46cf1df643e547cc007e2e48152e71818b |
Hashes for intbitset-3.0.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b33d76a5fbb9880187ab6d7ebe2399ee723dd7535f1526095bc4d2b7af9d255 |
|
MD5 | f4711ca622f5a29f1d43a06613e249ec |
|
BLAKE2b-256 | 1f9bdf9d70d9bc534139ac65815fc68c0e65d2c2760c4581a66d886d99cc27c4 |
Hashes for intbitset-3.0.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5361fbc087a6c1e4b8a6fefdfd48c82744416b9444324090d1109966fe659ac3 |
|
MD5 | 1109c91793f73fd6154d52f66cb062fb |
|
BLAKE2b-256 | afe1cbce38ff74e3e37bd96d83af234e663a62ce06ce8ee7cdf42dc4eb2755b5 |
Hashes for intbitset-3.0.2-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65904b7aad560ecedb67f3b0c302dca2c48cbad7be171b79105e82a8bcfed62a |
|
MD5 | 799f3c39bd0267b4be82f85cf2850471 |
|
BLAKE2b-256 | 783737d4f293a5530c0058f8d2844aeca1ca4e201c1aff78a90aa029ab8cc8e3 |
Hashes for intbitset-3.0.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b234fb045c97b3226fd8657c298804bd2c5a7af0cf6d42878d3b8a75cace02f1 |
|
MD5 | 4d5b259d63bf177335adb6d38b7f413d |
|
BLAKE2b-256 | 00343b33facc38e9e5ad7ac5e60e9f791ab1b0230799f3f848062005e1999e71 |
Hashes for intbitset-3.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2d76a4b7bf4b1b64f4b6cd462a231ae819af350db373c42f8e975500ebfc20 |
|
MD5 | 31227ae5235af2405806154e7a8a7747 |
|
BLAKE2b-256 | 7b24f88d14a625078ff864e846dc0795125c51a4b37c7dbde05fd75540549d7f |
Hashes for intbitset-3.0.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6802771924237ed645adffb1079d258a99475427bd9152c9bd36be295068a84 |
|
MD5 | 03f384b894bac0859c62a525733df56e |
|
BLAKE2b-256 | fcdcb2832d1e0d845c1e94dd50b909542750230711d7ee8485347959693f7b31 |
Hashes for intbitset-3.0.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c3a340ad58e6918c64abd9d26042178c98ff44e7ab3e7fc542df223d43a8e1e |
|
MD5 | 60582132d2a63d7f30a56aa0664f7d01 |
|
BLAKE2b-256 | ee6080a5dcbd7f498217c19496487739989055d711952c21a52051609aa52a00 |