Skip to main content

Python binding of Darts Clone

Project description

darts-clone-python

Darts-clone binding for Python 3.x.
This repository provides Cython-based pip-installable package.

Installation

pip install dartsclone

Usage

darts-clone-python is almost compatible with darts-clone.

import dartsclone

darts = dartsclone.DoubleArray()

# build index
data = [b'apple', b'banana', b'orange']
values = [1, 3, 2]
darts.build(data, values=values)

# exact match search
result = darts.exact_match_search('apple'.encode('utf-8'))
print(result) # [1, 5]

# common prefix search
result = darts.common_prefix_search('apples'.encode('utf-8'), pair_type=False)
print(result) # [1]

# save index
darts.save('sample.dic')

# load index
darts.clear()
darts.open('sample.dic')

# dump array data
array = darts.array()

# load array data
darts.clear()
darts.set_array(array)

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

dartsclone-0.10.2.tar.gz (21.7 kB view hashes)

Uploaded source

Built Distributions

dartsclone-0.10.2-cp39-cp39-win_amd64.whl (93.1 kB view hashes)

Uploaded cp39

dartsclone-0.10.2-cp39-cp39-win32.whl (79.2 kB view hashes)

Uploaded cp39

dartsclone-0.10.2-cp38-cp38-win_amd64.whl (93.7 kB view hashes)

Uploaded cp38

dartsclone-0.10.2-cp38-cp38-win32.whl (79.4 kB view hashes)

Uploaded cp38

dartsclone-0.10.2-cp37-cp37m-win_amd64.whl (91.4 kB view hashes)

Uploaded cp37

dartsclone-0.10.2-cp37-cp37m-win32.whl (77.3 kB view hashes)

Uploaded cp37

dartsclone-0.10.2-cp36-cp36m-win_amd64.whl (105.1 kB view hashes)

Uploaded cp36

dartsclone-0.10.2-cp36-cp36m-win32.whl (86.9 kB view hashes)

Uploaded cp36

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page