python NGT
Project description
python NGT
Install
Python binding with pybind11 (ngtpy) is installed as follows.
pip3 install ngt
You can install the python bindings from source code. You MUST install the NGT library according to the README before installing the python bindings as follows.
pip3 install pybind11
pip3 install numpy
cd NGT_ROOT/python
python3 setup.py sdist
pip3 install dist/ngt-x.x.x.tar.gz
Please note that the search speed of the ngtpy packages from PyPI is slower than that of the ngtpy that is built on your computer so that the package can be run on older CPUs.
Documents
Simple samples
ngtpy (pybind11)
ngtpy(pybind11) can reduce the processing times than ngt(ctypes). It is more effective especially for the short search time.
import ngtpy
import random
dim = 10
nb = 100
vectors = [[random.random() for _ in range(dim)] for _ in range(nb)]
query = vectors[0]
ngtpy.create(b"tmp", dim)
index = ngtpy.Index(b"tmp")
index.batch_insert(vectors)
index.save()
results = index.search(query, 3)
for i, (id, distance) in enumerate(results) :
print(str(i) + ": " + str(id) + ", " + str(distance))
object = index.get_object(id)
print(object)
See also sample.py.
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 Distributions
Built Distributions
File details
Details for the file ngt-2.1.6-cp312-cp312-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc2474e730a6769b018e08933fe17e6d7da7b137875cbbb2b679f56947379846 |
|
MD5 | adcfac1a675145082d431f4f4571bbf8 |
|
BLAKE2b-256 | 8ce5237d48570f9fb56dcaa6984278d7ab73dcc1669a21c5b215779732c9451d |
File details
Details for the file ngt-2.1.6-cp311-cp311-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e11d9c6942f617e17b1b02c31d1a87619acbd9e4b2cd5f76ba9179c0a04c2af |
|
MD5 | 1893bd749f24df6cde502c0aeaa36e3a |
|
BLAKE2b-256 | b255dbacc595a7474c03f9e130964158ca8283778c89c0ca50152f6bc160e76f |
File details
Details for the file ngt-2.1.6-cp310-cp310-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b879ca7161f18d35a9151a0cdf40bd2188a55cf5b50e43624d0600ff54ca855b |
|
MD5 | af6a083cef0df436243a3595d42c2670 |
|
BLAKE2b-256 | 53be2c06a9677fe55fa905ec1f828c4251ea5ae6506f4907c5edce56f1f1f9e7 |
File details
Details for the file ngt-2.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 9.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66c137f92587f50d03d52b6c781c9542fbe03952499a28c221bea867239553f7 |
|
MD5 | 971e57618d24eb77bfc11477db8f74fc |
|
BLAKE2b-256 | bace4153944ad9a04944b441d6ff601a9abd4bb766d0f6cfeab9548feef5f20b |
File details
Details for the file ngt-2.1.6-cp39-cp39-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd61817e6a8d83e302b214441eaac80adaccec65563cc0af47556110547bb24e |
|
MD5 | c5319a5a38a4e5f6a7945f323867e26e |
|
BLAKE2b-256 | affc87db642c105c441da1d31914451bc439ea61474a7d127ce663c77e648d56 |
File details
Details for the file ngt-2.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 9.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af959e0829c8a984ef88d40e7029126b9fbdec0d1d9255b4f5e75f72ee127e6b |
|
MD5 | b2d9db26ff1f471aee012d2850fbaaef |
|
BLAKE2b-256 | 0a009403556f7e036f5715ae25a61d341bcee69d79b96f5030c93a59e690fc7a |
File details
Details for the file ngt-2.1.6-cp38-cp38-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp38-cp38-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab1baed81016c0a1c3f05f4229d703dcf9ac030f0684b26e5dd0b5b8a16985af |
|
MD5 | 528ce659faeb94c1127e72817f0af655 |
|
BLAKE2b-256 | be6b8b7d1700b20c4949c595bdf33bdd7674e89db12a6a411d89f6f2d19778c6 |
File details
Details for the file ngt-2.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 9.7 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90fff123dfbbb1c5880d837f07f3d4a6732e40621dcfe302064301e5ff761f94 |
|
MD5 | 599a2f5ec554687d3f819b5346df76f4 |
|
BLAKE2b-256 | 6f61f863ebe23608fdd7f8410fae9734f7c928656a2147fcc3bb0ea3bf4ec8ca |
File details
Details for the file ngt-2.1.6-cp37-cp37m-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp37-cp37m-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 11.0 MB
- Tags: CPython 3.7m, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 146a5c6f772682f81b068de287eb66649f49d58006d32d36d8d408c9c7a3d600 |
|
MD5 | 6d5ccbbe77fc8a254185a9bc89a515c7 |
|
BLAKE2b-256 | 243ac1f9305d942cb39a6975f06c582926bfeea53e9694c82025872b57255a06 |
File details
Details for the file ngt-2.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 9.8 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af490ccfd8d1350829c8e7d2bf9133265f9725d8e99e19297ac92740d5c42225 |
|
MD5 | 77c6ff84cf115919487ad4cbbb9486de |
|
BLAKE2b-256 | 080519821cf49e3239c8b191764655962f6b13f2a0959f4a9c6545f073ccac4d |
File details
Details for the file ngt-2.1.6-cp36-cp36m-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp36-cp36m-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 11.0 MB
- Tags: CPython 3.6m, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2beb6c34f1d3ec441e4209eeca4eb22b56c64ecc1b070737e58354a30c5853ee |
|
MD5 | f2d364285cfcd19d4ffd5dde34b0c99b |
|
BLAKE2b-256 | c18f93e82e424d0023728430e6b970757ddfe8d2b2ce1de6a3fc019bc0547c96 |
File details
Details for the file ngt-2.1.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ngt-2.1.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 9.8 MB
- Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d679d05c55da8b9d5e46451e332a1e7b12e11d25fba4cb3b2d52b3efb3bece3 |
|
MD5 | 8556607a32ac8899d8a56459dc712df5 |
|
BLAKE2b-256 | 6e16e12c675e5c5e7b567e57901a0aea301415b181444aeb32bcd46b527d4b3c |