Skip to main content

String algorithms

Project description

PyPI version Build Status

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 only char
  • 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

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

pydivsufsort-0.0.3.tar.gz (182.3 kB view details)

Uploaded Source

Built Distributions

pydivsufsort-0.0.3-cp38-cp38-win_amd64.whl (162.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

pydivsufsort-0.0.3-cp38-cp38-win32.whl (130.5 kB view details)

Uploaded CPython 3.8 Windows x86

pydivsufsort-0.0.3-cp38-cp38-manylinux2010_x86_64.whl (771.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

pydivsufsort-0.0.3-cp38-cp38-manylinux2010_i686.whl (612.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

pydivsufsort-0.0.3-cp38-cp38-macosx_10_13_x86_64.whl (174.5 kB view details)

Uploaded CPython 3.8 macOS 10.13+ x86-64

pydivsufsort-0.0.3-cp37-cp37m-win_amd64.whl (160.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

pydivsufsort-0.0.3-cp37-cp37m-win32.whl (128.9 kB view details)

Uploaded CPython 3.7m Windows x86

pydivsufsort-0.0.3-cp37-cp37m-manylinux2010_x86_64.whl (674.1 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

pydivsufsort-0.0.3-cp37-cp37m-manylinux2010_i686.whl (536.2 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

pydivsufsort-0.0.3-cp37-cp37m-macosx_10_13_x86_64.whl (173.3 kB view details)

Uploaded CPython 3.7m macOS 10.13+ x86-64

pydivsufsort-0.0.3-cp36-cp36m-win_amd64.whl (160.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

pydivsufsort-0.0.3-cp36-cp36m-win32.whl (129.0 kB view details)

Uploaded CPython 3.6m Windows x86

pydivsufsort-0.0.3-cp36-cp36m-manylinux2010_x86_64.whl (674.9 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

pydivsufsort-0.0.3-cp36-cp36m-manylinux2010_i686.whl (534.3 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

pydivsufsort-0.0.3-cp36-cp36m-macosx_10_13_x86_64.whl (172.7 kB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

File details

Details for the file pydivsufsort-0.0.3.tar.gz.

File metadata

  • Download URL: pydivsufsort-0.0.3.tar.gz
  • Upload date:
  • Size: 182.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

Hashes for pydivsufsort-0.0.3.tar.gz
Algorithm Hash digest
SHA256 79cafd26ce40a934a7e0ceea124ec10e40510ef0b15ccbb35d87c80c9bfc140c
MD5 1b8bad28334d6cfd4125bb904c428a49
BLAKE2b-256 e43c71eac6d2545ac8a8a1cd5d8735e0b62a56653f5a42b1212ed940490da5fc

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 162.0 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

Hashes for pydivsufsort-0.0.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 5837078e71059532523d93745e0ca5bad063675bd2c46437166731443f75ef7a
MD5 7c04d935a565adaa955d7a9529c0d669
BLAKE2b-256 cfbecb0d5cbf9dfec233125677d9304860e080890892c5dce4316095033df765

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp38-cp38-win32.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp38-cp38-win32.whl
  • Upload date:
  • Size: 130.5 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

Hashes for pydivsufsort-0.0.3-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 6401f4d451799691f444c4b1e822a56e49f6178f78d858ff77c90cfa16d8af3d
MD5 18a4a3cdbf6525faaad076d86b62deb1
BLAKE2b-256 f845d9db360217e288f35a456aee2cf32ddae70449693cc6acd74f354e8120dd

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 771.7 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

Hashes for pydivsufsort-0.0.3-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c21d57279df09397a14b40620e6c372cae3c1a213f10cd8cad48de7962f690f2
MD5 b4beac04c80aa5e31b2e30d2dd821a22
BLAKE2b-256 abbb487924be7c232c4d1f35f6c66c35ef34b20717a0fa388c9b097a3debae85

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp38-cp38-manylinux2010_i686.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp38-cp38-manylinux2010_i686.whl
  • Upload date:
  • Size: 612.9 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

Hashes for pydivsufsort-0.0.3-cp38-cp38-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 b5f1d9da453b6a0f244e398c101519a691c6b02823c8528b338f7ab84c0b24f0
MD5 d27e1f77703c80afc5324d44d1e6da94
BLAKE2b-256 709b2fdd399eeee1660559167c339d840c20d71f4295d614ceac3a629fe83abe

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp38-cp38-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp38-cp38-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 174.5 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

Hashes for pydivsufsort-0.0.3-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 79d9d89293defee47d20b29a9be838e07a84474f97d396633e04a3a0f6a4e90b
MD5 0bc490b4306f03ef3c33dc410da7fade
BLAKE2b-256 c1fefd9f5f034a54c1beb79bfd5b0ec9fd3a5b875119fe302ac2eb02250e1dd2

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 160.4 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

Hashes for pydivsufsort-0.0.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3b16d4c390e7610f938768506254af232f64c8781f891e0065668d92e1c949c7
MD5 fac2f63de6282b28e4191673204fa1c2
BLAKE2b-256 2810ecf491e7c83e5e914ec9e3c9b2e43ae34373e31704e1fc6ad582a7d91f37

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 128.9 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

Hashes for pydivsufsort-0.0.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 1bf3f129748188ed4ffd9790d87319dadf6eed251acb85fd57dd60a94785298f
MD5 33124e4e3d7b410f175b54d0b86a2773
BLAKE2b-256 fe48983fdae57dcb189a1d4e8459499adabb249d1710504e5e6c32ca67860f1e

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 674.1 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

Hashes for pydivsufsort-0.0.3-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7c1e17586e4c603ca855594246c734a9b64b89f522c2390f299e81929764d8ec
MD5 306099d2bf085a00548ae1c07990d4f5
BLAKE2b-256 df987412f891697c6dfe218814632171376960d4fabb53bde8f22eded4a07e52

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp37-cp37m-manylinux2010_i686.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp37-cp37m-manylinux2010_i686.whl
  • Upload date:
  • Size: 536.2 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

Hashes for pydivsufsort-0.0.3-cp37-cp37m-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 3bfe00a0e641ad019e962064ba44e90c95c00d97a4e42f2e9e86c8e6ad870b9e
MD5 7a6003637c72f313227342933a117ecc
BLAKE2b-256 84e6555ae9662e5a3ad720d9738c4eb40dbee27ed41a0fa8150029e844fde09d

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp37-cp37m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 173.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

Hashes for pydivsufsort-0.0.3-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8fdbbd54e4050dc07fef748d1b64bbb31709d0a534463b8fd7bda676dbe5f100
MD5 deac7d3f6939d753b349e99607029bfc
BLAKE2b-256 44d082eb5a42935708d24b096514424b5b469dacf7167ae055ce25e6f1cad12d

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 160.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

Hashes for pydivsufsort-0.0.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d15d574085c5f91ca9072f6caa4c3c3c066f30727c862f80cffb828d7b235c23
MD5 01029543611f1ae4eda939708f318e38
BLAKE2b-256 a9f2034c8966f1be6498701f922209046ea919c4616f22a5dc121702ecd4a3df

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 129.0 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

Hashes for pydivsufsort-0.0.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 ea143ba84af593055b8576875e6a625342f55f3696d390131568900abb9a46c8
MD5 a243a4a0a169590d1db5ac1c01c3205e
BLAKE2b-256 33834d39ae62580a3114f1451116786ebfb39dcf451da5a0088923deb1608b6e

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 674.9 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

Hashes for pydivsufsort-0.0.3-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 3e1baf901dc7ba77e2023c9bcc92c7e552df06ddc6006685c9e16a32a43427b9
MD5 274e23d6f106c507a8d414263f144ef7
BLAKE2b-256 32fe8d84f755a5249f4d04d8dc8fd44b08fe25fc6eb6d73cb8909a840c1ee912

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp36-cp36m-manylinux2010_i686.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp36-cp36m-manylinux2010_i686.whl
  • Upload date:
  • Size: 534.3 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

Hashes for pydivsufsort-0.0.3-cp36-cp36m-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 5c786ab575d043d27ed20a1d53a780ebb661c5c5cc9859c54008964c67a5ce23
MD5 5de9a0cf92653e5495ab004169d4181c
BLAKE2b-256 31b908f5f47aa06d7017d09971cafdd619042f5c5a379226559cb7fe3870ec8a

See more details on using hashes here.

File details

Details for the file pydivsufsort-0.0.3-cp36-cp36m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: pydivsufsort-0.0.3-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 172.7 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

Hashes for pydivsufsort-0.0.3-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 f2524751d2e3f7785dee57a41e6384fa79424e31c84c34b754a1c74de1633f5d
MD5 c6e2ab09ce2e1c7c435a665952062b3b
BLAKE2b-256 7511055385e32be9dec59562da8c78b116431ff96ee4fb58196e3e6a411fa549

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page