String algorithms
Project description
pydivsufsort
: bindings to libdivsufsort
pydivsufsort
prebuilds libdivsufsort
as a shared library and
includes it in a Python package with bindings.
Features:
- bindings to
divsufsort
that return numpy arrays - handle almost any integer data type (e.g.
int64
) and not onlychar
- additional string algorithms
Installation
On Linux, macOS and Windows:
python -m pip install pydivsufsort
We provide precompiled wheels for common systems, and a source distribution for Unix systems. Manual compilation on Windows might require some tweaking, please create an issue.
Usage
from pydivsufsort import divsufsort, kasai
print(divsufsort(b"abcd"))
inp = np.array([1, 4, 2, 4, 5, 2, 2])
sa = divsufsort(inp)
print(kasai(inp, sa))
Testing
pytest
Technical details (for performance tweaks)
libdivsufsort
is compiled in both 32 and 64 bits, as the 32 bits version is faster. pydivsufsort
automatically chooses to use the 32 bits version when possible (aka when the input size is less than 2**31-1
).
The precompiled libraries use OpenMP. You can disable it by setting the env variable OMP_NUM_THREADS=1
, and it will yield the same performance as the version compiled without OpenMP
The original libdivsufsort
only supports char as the base type. pydivsufsort
can handle arrays of any integer type (even signed), by encoding each element as multiple chars, which makes the computation slower. If your values use an integer type that is bigger than required, but they span over a small contiguous range, pydivsufsort
will automatically change their type (see #6).
Acknowledgements
- Yuta Mori for writing libdivsufsort
- Sean Law for initiating this project and contributing
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
File details
Details for the file pydivsufsort-0.0.2.tar.gz
.
File metadata
- Download URL: pydivsufsort-0.0.2.tar.gz
- Upload date:
- Size: 175.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0446eb566400f65ccab966a1ce1476c656711aedeffec5d68421e7489ddb33f |
|
MD5 | 379116d2d539834ee7461ba8042f746e |
|
BLAKE2b-256 | 29da64b18919c1476a01b8aa49fda1d2256f494965034b0656172d1ded1e0399 |
File details
Details for the file pydivsufsort-0.0.2-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 155.2 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e41ff8703ab5818de361f29f67a68658f14cda798b546b51407cd876114398ea |
|
MD5 | 0674d1457ffe853a70ce7907f5247066 |
|
BLAKE2b-256 | 22622fbca8ff48c08c7e09c4d9eeddb891c0ffc9eb7a38423cedc68fcfa8a100 |
File details
Details for the file pydivsufsort-0.0.2-cp38-cp38-win32.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp38-cp38-win32.whl
- Upload date:
- Size: 125.8 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86060b158f77070bd7b9b89098adfe31f112d0f52e26b6ea8ef586a898e0d9ee |
|
MD5 | ea085d239f820f21bdaec39c04cdd748 |
|
BLAKE2b-256 | 01be071f8ab0688ae76dcaf04aeaf3e9ffe62421964df356105e20a4d474e436 |
File details
Details for the file pydivsufsort-0.0.2-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 730.5 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c11cabdc18465d3ad5be3fdff879cfeef6ec893c6d5e8a4c6f547a10df7104d1 |
|
MD5 | d03035c4a057c0f899486070325dbecf |
|
BLAKE2b-256 | d9b6fbad1fe7c035304b9cbe35f73b67ef769d7dbbb02a781e58b973da912eb3 |
File details
Details for the file pydivsufsort-0.0.2-cp38-cp38-manylinux2010_i686.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp38-cp38-manylinux2010_i686.whl
- Upload date:
- Size: 572.0 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29fd380a7cadd33a5aeda6aaf986446c839647761ef5abac1503c6f1af2bd401 |
|
MD5 | c3eaee21a4b2e692b0722d184c6c4515 |
|
BLAKE2b-256 | 67f7931f771134edebdb3759a1e8531989c85fd7d900912a3bab95aa61f0b790 |
File details
Details for the file pydivsufsort-0.0.2-cp38-cp38-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp38-cp38-macosx_10_13_x86_64.whl
- Upload date:
- Size: 165.4 kB
- Tags: CPython 3.8, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00fd8c205dc3edb90195a3e1f22497b3c2502e13cc3f7168b2a8d1e388feb8a0 |
|
MD5 | 9cf3138736ca0bebed051ab5fa7d09ea |
|
BLAKE2b-256 | 81bddc74270c084b444c31a170b5803ec0517169fd6b59e909b25718f36c4375 |
File details
Details for the file pydivsufsort-0.0.2-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 153.3 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf8a7089105825b2939580106e8bb14a8810f87a281d062dff95539d037c61f1 |
|
MD5 | 1c1b1ce040043c2bdb66119fd6b0ab12 |
|
BLAKE2b-256 | a8fc67a4e18ad66dc4b34f5d43ff5681081a653204c32482cb72b9834c1de951 |
File details
Details for the file pydivsufsort-0.0.2-cp37-cp37m-win32.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp37-cp37m-win32.whl
- Upload date:
- Size: 124.1 kB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28b7e7d69223b9b123757d5ef8231db071aa21d4751cc9a4572c21c350b8ed65 |
|
MD5 | a65aba0cb4e058d94b85457ff671d82b |
|
BLAKE2b-256 | ca41fbd69023d557434d6bc857b02bd6b12ab3daba99846e27dc145d87d08125 |
File details
Details for the file pydivsufsort-0.0.2-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 640.5 kB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12fe886c43bcceab1d96fdfdc46e58268d3e823943301dec5a6b0b5d0b94eae3 |
|
MD5 | 4badecb118f5cb786d603aa81ee7abc1 |
|
BLAKE2b-256 | 1c912e14c34cbbc2c9cf44ced9b316e05347bd85ed65affb5509dd2b7136efb8 |
File details
Details for the file pydivsufsort-0.0.2-cp37-cp37m-manylinux2010_i686.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp37-cp37m-manylinux2010_i686.whl
- Upload date:
- Size: 508.8 kB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 619b5972af3e419fefc46ed8a125edfc6d8f4ba1a231a66b7bb5b9d8b1f2bb11 |
|
MD5 | 7be9e5eb8418abf103bc89a74f78f88f |
|
BLAKE2b-256 | e3b9709f6a5d3d6471c6119edddfb9caa76405e0edfd30fa25a9c06cf4c18915 |
File details
Details for the file pydivsufsort-0.0.2-cp37-cp37m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp37-cp37m-macosx_10_13_x86_64.whl
- Upload date:
- Size: 163.3 kB
- Tags: CPython 3.7m, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50584d1a78e0c8c3ea32fb3af040499e105d441ea2d610fce2a4018253370766 |
|
MD5 | d5fa37ee46adba2d8698820e980da341 |
|
BLAKE2b-256 | a1fb54afd052b954521cc079d8d4ab16ec70326a269a7f2a12eb880a8be03843 |
File details
Details for the file pydivsufsort-0.0.2-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 153.3 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0744da0bcdd61264356469a2e5e89dfa84b8e6691ecbec4cd29edf7d15f9257c |
|
MD5 | d44afe2a195039502b73437bffbf1a11 |
|
BLAKE2b-256 | 4dd2c5013b7a6aca3ff8f6bc2b80ddff1fb831071d113b25002f71330d3fde29 |
File details
Details for the file pydivsufsort-0.0.2-cp36-cp36m-win32.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp36-cp36m-win32.whl
- Upload date:
- Size: 124.2 kB
- Tags: CPython 3.6m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 022920286fbdf489fcc20746643eb747e1e4e9c24c6fdeb5dff9eaef172e6559 |
|
MD5 | e79bbddb572a45df4b9e3748b1d6009c |
|
BLAKE2b-256 | 0b86e5fac04a53375f98b7d524fade7ef957a96fb382c6f750816d3850d0d9a7 |
File details
Details for the file pydivsufsort-0.0.2-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 639.5 kB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7018a07fe427fc795c46b9656e601ddccd03bf9f0bc715efee25547558700972 |
|
MD5 | b54bf1afdabd6d9581d12eff6a0385d2 |
|
BLAKE2b-256 | 3457f1e0f7f80a7c7af55d099de483e3500650458b4c138cc8f2449fc32c8895 |
File details
Details for the file pydivsufsort-0.0.2-cp36-cp36m-manylinux2010_i686.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp36-cp36m-manylinux2010_i686.whl
- Upload date:
- Size: 508.4 kB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e20161806fd9905fef59ec20ebde396630e3d858a9d01d4d5b2da85273255be |
|
MD5 | 6721cb14b4a89aca2cbef4a7bf1a80c6 |
|
BLAKE2b-256 | 03b479e368564f883588626ca18402a8bed4302a3c250da61a87e850bcb5c947 |
File details
Details for the file pydivsufsort-0.0.2-cp36-cp36m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: pydivsufsort-0.0.2-cp36-cp36m-macosx_10_13_x86_64.whl
- Upload date:
- Size: 167.6 kB
- Tags: CPython 3.6m, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b75a4511820389c49416f6b1b3437a4813a192f2c22bd7321489cd27905a8776 |
|
MD5 | 6d89295d123f8f8fb14201ae131a919e |
|
BLAKE2b-256 | f4ac7f411a7eb6afc64ffb87f75f626f788d0ccc0510e7ecfb9cd81f031177e1 |