C-based extension implementing fast integer bit sets.
Project description
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:
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 regenarted C source and update the CHANGE.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.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15406981007db25c9c8e0405694a4707b5017cdd4777f319a8b3b0e22c857051 |
|
MD5 | 2cc011d02e259ec77a0f961fb5b8e5eb |
|
BLAKE2b-256 | 1e8face0859ec44c71640f4654a428ad1fc1a650317ece368d8a82fd72fe80e9 |
Hashes for intbitset-3.0.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58b655b95f5fdf376c6a78028f432b75d5c14b61f6c7d353280d1b21a7f630e1 |
|
MD5 | bcf8a82d6cb52917cc90a56b82956b78 |
|
BLAKE2b-256 | 100df1e75e453255b4d53075ee08b75399c747617677b9ab2848241dfa8d1dc0 |
Hashes for intbitset-3.0.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c46c71f93e05306bad96c4589d6f794cb7ceb45d5515de474faef2d27217b85b |
|
MD5 | 09d5143e45e93446ea54ada51a94aee4 |
|
BLAKE2b-256 | f7b6192a8cfd21f23ab8735890b7e5b71ea46045e11e1ac205e36c4753ec987d |
Hashes for intbitset-3.0.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8001d160de8c05fb9375ea40060cf1ad9145f7cc6f3fa4522d74fbbac35f9f6 |
|
MD5 | 874fb383f9f270e51fcc567e6215757a |
|
BLAKE2b-256 | 34e10587865de83c70553a0ff64c14c3ec35f2caadb8a5a278dd8f0fd8986766 |
Hashes for intbitset-3.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7c51ffd6ecb12698b06525f49e95d986c4d822ffbbfa08eb0528b591fb1e4fb |
|
MD5 | 59a9bc7f4856ea88e6f78d0d926273ac |
|
BLAKE2b-256 | 31ceee7d88194f4546216333867c97dac01c78238a256d72b6eadbe53c89fb60 |
Hashes for intbitset-3.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe2c31fdfaa7283412d3e395b597993396cc5c7191eba86913bfd87cb9b39172 |
|
MD5 | 40434a093d458767ae80b87f268fcf49 |
|
BLAKE2b-256 | a1eb0195ba36fe6ea962c0be6d82222bfdad05ab5877d8e7694120845d12e329 |
Hashes for intbitset-3.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e8dfba7ffddc5833c76001e42af1f3d0f9816bae1d1a69c787781e710f9533c |
|
MD5 | 1535df52f0d2335daa3aa41784312210 |
|
BLAKE2b-256 | 81be640b3935dfb586b761a43cf01296cc2c3a3cc3d3eb1567baa7341a731282 |
Hashes for intbitset-3.0.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36632b5c46a056f4f4c952033b1198bf1e94ca367bebbc44e344ca272f0e0e70 |
|
MD5 | c99fbd79b4600025ca2d10ec644d9f68 |
|
BLAKE2b-256 | ec15ed29c6010166836732120d4501016c04d8a82fa911e0d260d99ae8e3b288 |
Hashes for intbitset-3.0.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b60e47acf1b0e81496626339f1695838cba683fd48ec8bae8db65f28e6c5be3 |
|
MD5 | b6732c55e06e5217287255b8eb3f7909 |
|
BLAKE2b-256 | 92bdd4451d091d3121d8061620db0cd2c1a3dfbd8e53c1948033739aa6b6096c |
Hashes for intbitset-3.0.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaebc1c6f4f1cbf9ff258d2b9d51bfef0abcbb5da78cae619620788540a1f92b |
|
MD5 | adcd15e6daa194731e56dd08431ae7b3 |
|
BLAKE2b-256 | f8954b7f5dab1ff82bac7b0367d8541f0ea77f67577a76c97f7643c4827f67aa |
Hashes for intbitset-3.0.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19689a42f97a7aae36dc5091298c65551b9d2f01a82af520429532812ffaf80b |
|
MD5 | fd8d3ff36c4030bb1ab39bb2e89ac006 |
|
BLAKE2b-256 | e4d360ade93e46c2ebd2c5bb82c456e10a2d264e769e4adb6577b3e9882e03e6 |
Hashes for intbitset-3.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d288345a85ec3536faa223a784a4d4e74ea1ea7be1032e535b7665da3dd2f12 |
|
MD5 | b032f4921d485662c265dbcfae048256 |
|
BLAKE2b-256 | d20cf79c3a3f0941ff3bedca3a346984ece770d2e2c42f065822b1369dab5657 |
Hashes for intbitset-3.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acaad7fbac5f03b416b187490299b1e1d2e83f63391352014a889cf57e4c5014 |
|
MD5 | f599dd0136f0b78dbfb24e806f5146c0 |
|
BLAKE2b-256 | ffdd8e255a1ca3be167a64449d0aa1de8aad83c3e8591c0af5c306704cfed46e |
Hashes for intbitset-3.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7304332e8381599c8b7c531ae2e308809fa1578c7548211f7e37d1b82bee42de |
|
MD5 | 2159041c9762829a582812cd70c42202 |
|
BLAKE2b-256 | 2f95845d7d33412ac8043e0fda7258277520a9f8b72d2bc21e1c64cc1b1746e1 |
Hashes for intbitset-3.0.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07d3f19193205850fcbb23d5f53a305ccbf69b946bc81e74613900c4dca69525 |
|
MD5 | 53bc701008951cc56fbd37187a18e0cb |
|
BLAKE2b-256 | 009b34d3c9f23170565ee0c4916af9720a3f30919ab65cc53591c0840c10193e |
Hashes for intbitset-3.0.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b217880320286119c793d399f70d08ea9ad0633944dca3f2636ea5927f5860c9 |
|
MD5 | d19993e4a86121c679c58a2bfb3140ea |
|
BLAKE2b-256 | 447c460593bb7d1b0387598b555b230f095940057a011c75fd0a8a72de09a547 |
Hashes for intbitset-3.0.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6604bd2f7649fbb779b1bf4f5618491d1ef2923dba112ebdbbbb948500df25b6 |
|
MD5 | b1380e3e975e58de51d903a7884bdfb1 |
|
BLAKE2b-256 | 7b4f31dbb7012a5b3087e66908e10dc5719a8e3c29f1ed8f3fcd8e8a17ca724b |
Hashes for intbitset-3.0.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1d946e94a355e91237142e4066446ce1bdd4c43be9db5058fda228f127eff8e |
|
MD5 | 741bc634c92e66885a18b6888c2eaf1a |
|
BLAKE2b-256 | 4f23ca115fd8897487743bd67aa52a75b0d6af9c5be7eb2365e4dd8fb7572469 |
Hashes for intbitset-3.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b587bc486669bc74d6963e8821d4a4e4461e73f83362bbdeee680539d3227001 |
|
MD5 | 4936635a6cc0e6de184a44473a369470 |
|
BLAKE2b-256 | be1a22ba856e09835bd6fa5fc6b02e29f5ba784e1f0d3dddcf85cd9b4e953c17 |
Hashes for intbitset-3.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b16bbad2cb2de10d199a3e34ee4dcaadf51fcb6192c6f96c589a6c13761b8362 |
|
MD5 | c3de9f2fd94a00ddd2ea8e717d3fa8f6 |
|
BLAKE2b-256 | 8ade37745f0ea8940d8e0ee2a0990e4b3dd74c4991070efb66b287dc177e059a |
Hashes for intbitset-3.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 437fc048f24f3344e95e444392706f1fca5cb119d54e5e770881a37d56a80d3f |
|
MD5 | e87161f4d0c743665f42d2b7a8bf0d0a |
|
BLAKE2b-256 | db3311fcf586f822a284ad2fb3c45e6b05b2cf379d1314ad811eb189a69db412 |
Hashes for intbitset-3.0.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da0fc5218758a897e6ad8e3116b46fa0c8d3359133d353b41d55ac4a3f38c523 |
|
MD5 | ea824c7f04045613fd17df182c7eb334 |
|
BLAKE2b-256 | ac354c2ac9e34fc8f505c8ba9c3163653cf1aa96159d2357ba3ce85827efb67f |
Hashes for intbitset-3.0.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d03a6850e7a9d5f1a7270aee9b64b8c7178e7a4610ea6f06580ac42033548cf |
|
MD5 | 8dbe1e5aa06f6e576be9ea348f29195d |
|
BLAKE2b-256 | 478138c88147bce8513cf3c81856b47221b8bd6857446a30a1ea6af4aae68a14 |
Hashes for intbitset-3.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1cc53ee9df8dff254c4ce659f3d86684ea659b7794dd4a17d6b7a882896de19 |
|
MD5 | a9bbe28cb45f32281b7a579130c03c9f |
|
BLAKE2b-256 | 35ecf03d2d3998b776beba7c6c99c1a411e25b8a3404586931284af196580b11 |
Hashes for intbitset-3.0.0-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d060a900f0c9785c7527b8c5cd0d5c6ad8ba14e2a757637e3b1cacc86131484d |
|
MD5 | 9be7e6cb70e7689c1dedaa9ae8f0632b |
|
BLAKE2b-256 | 042c2e289cad2c76c33d518ca6c96b889c55ac11bb7180f1fde02b1673d73cf5 |
Hashes for intbitset-3.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b87a0637535db3128b333b3c060c8097083f177447f082404b5a971e9dcd043 |
|
MD5 | 1348651e9174e8acfbbe81a9590cb067 |
|
BLAKE2b-256 | d9499580a0635120c90f5a02eadea62aa191bb17df55fc5d67d407796f114a52 |
Hashes for intbitset-3.0.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f574f132a9a01f79d79e8ea345c5068d347c51da7856bce09124f5102be559c3 |
|
MD5 | ddb0970dfa712747491ee39e59201894 |
|
BLAKE2b-256 | bca40b069e9868b9e65172f744c531dfcf84bace282fa766003a49116c518a36 |
Hashes for intbitset-3.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bca02e94ea9d592a5869c0e31432b6a82070f4668ec296d2f24250a1a3c7bf5 |
|
MD5 | 07fc7d918aecd2d8b8ff568565b28b6b |
|
BLAKE2b-256 | f85aa534a776a288122d570c8cd9d05aedcf8654ab1288763c167a8173ac4a7a |
Hashes for intbitset-3.0.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1335a82d4262cfaa59b2819f0ca7bdd6e674968d8fcfd9e91f543d6cb21f24af |
|
MD5 | 03de22e0b2d4b730e153cee154d5e771 |
|
BLAKE2b-256 | 40d0913a61818c0acd35409255409c6277911a01c0225a17f89ec90bacd0cf53 |
Hashes for intbitset-3.0.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaa9dd54b440f46e26bcb0aeeb267720f7f9878a2406476820bdcfd93b03354f |
|
MD5 | a6acdb391687673e80756d516df1c70c |
|
BLAKE2b-256 | 1e9f12267de2787e032e4a304301434508d9e50cc9c8691aa31e0b21c4440ca1 |
Hashes for intbitset-3.0.0-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e55f2fd7b13383dce3c9f8a6284a2474a7f96e33cd425b643d58222854f37597 |
|
MD5 | 022375ec0549bf3708ccc6f71b1fb952 |
|
BLAKE2b-256 | 9799491ae9db2134288aef18b8b047bd713891b86faf46a270a6315825833f8a |
Hashes for intbitset-3.0.0-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9ecfd42dbae7554724eb74ebc4749ed9099f661470b995bcd144ad08f7d6619 |
|
MD5 | 8aeb6128f6116cbeaeba6f01ff6728ef |
|
BLAKE2b-256 | 00424e95f48fdef0e34ab76b951c25447da4e21f57c794e38080f433459c776f |
Hashes for intbitset-3.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55453fc8f9f8f3462b3d5f49fa7737c16aa9754431ee58661a383a7508ae5eb2 |
|
MD5 | f9fbbea335f5c238a47b2200590e1771 |
|
BLAKE2b-256 | 8200c4fb6de7660967037cd30ad7cbd299d9837ad8054c901c089ec67fe88eea |
Hashes for intbitset-3.0.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97382c8abb18cd9640ba898d8ba58ff226a34117eb0822ea01180e70d75b0b19 |
|
MD5 | 0dd0d21760018896c7ffdd084f63ce20 |
|
BLAKE2b-256 | 7addf97d083f3a0d5ba6fa73456cb5db6b7a98c8d4df16ab73106adbf8e910af |
Hashes for intbitset-3.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9229c4a8c689d29fb956f48dbe6f6361ffe0b860e60a09e7eab5fa3104cdc0cc |
|
MD5 | 2e053e451f5018d756832b96983e4365 |
|
BLAKE2b-256 | 4378e5123f419a481a1493bf930e54cd105867b3c77e6c72bc0d735b453cf0f9 |