Skip to main content

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

ngtpy (pybind11) reference

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ngt-2.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ngt-2.0.4-cp310-cp310-macosx_11_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

ngt-2.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ngt-2.0.4-cp39-cp39-macosx_11_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

ngt-2.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

ngt-2.0.4-cp38-cp38-macosx_11_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

ngt-2.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

ngt-2.0.4-cp37-cp37m-macosx_11_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.7mmacOS 11.0+ x86-64

ngt-2.0.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

ngt-2.0.4-cp36-cp36m-macosx_11_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.6mmacOS 11.0+ x86-64

File details

Details for the file ngt-2.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ngt-2.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33cc705a1e80613ab2e9e54d860d68ecba5ea505fa3ce57b55c5fb3d29837160
MD5 b9ee359f6e7fc89e8d6c7954420f31e3
BLAKE2b-256 358774b28bc9fbffc28aa2da52c5921f905b2f47b719ae31a9233cb5c28284c1

See more details on using hashes here.

File details

Details for the file ngt-2.0.4-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for ngt-2.0.4-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 1418d66619f2bfda5f8d53856cf2f18d6b848c955650a74a626de0ba8c9e6dd1
MD5 afde83b4fbdb6ccab46c256a98f03ca6
BLAKE2b-256 0cd130c95aa0e540f5118d455e9d266b675c4adca14ebd379009f3ce0d4f590d

See more details on using hashes here.

File details

Details for the file ngt-2.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ngt-2.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3aa0455ec83305976993072938018909e2698c6176d564b0a9bd0e95661ca9f
MD5 c704bd805af0320d6ba6ec2d5e46c02b
BLAKE2b-256 4855b336875db25aa161fe5a6473a19077cbf1ceff44594b3ea1968af938e57b

See more details on using hashes here.

File details

Details for the file ngt-2.0.4-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: ngt-2.0.4-cp39-cp39-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.9, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for ngt-2.0.4-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 aebf9ea0e5ec2df1dd7ba60bbed625331618125433b06a3e3d871cae78f1e72b
MD5 1d8904a63903d516773121f9bed195d8
BLAKE2b-256 d89d14a111fd76f69d90fd496dddac27284e41060b221c3182adeedbca5fdca6

See more details on using hashes here.

File details

Details for the file ngt-2.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ngt-2.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8dff877c6a455957101eb300c76b2257681e6a539954b17f390cc3b82bda8ebd
MD5 f9bb3ca8f89bc3fcafab4767383f7c6d
BLAKE2b-256 b56e012c5b3f0f9469b62d4f4a920483f4f66fd62f437cabd04f4dd252e118a7

See more details on using hashes here.

File details

Details for the file ngt-2.0.4-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: ngt-2.0.4-cp38-cp38-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.8, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for ngt-2.0.4-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 56731b28bdd52d6d59edb81f45d6b31771fed9b907e88e4e7756793432a289e7
MD5 6975224096dda62b7333589e265fa6ff
BLAKE2b-256 8c22fa9ee19f76391258612cb36e04ec88070d358a565202c9e5cea228eaa200

See more details on using hashes here.

File details

Details for the file ngt-2.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ngt-2.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c3b22d129dc43c889591a3bd71a43d44fd5c00033cc4e5433638156efd523860
MD5 4109f18b58c8a214226ef5bde079c5ce
BLAKE2b-256 dfaaf2129ef8117bda2166c05a746cc1cddca9cb4b8275036a2b4f4b144b71ae

See more details on using hashes here.

File details

Details for the file ngt-2.0.4-cp37-cp37m-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: ngt-2.0.4-cp37-cp37m-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.7m, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for ngt-2.0.4-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 afc291bffc996f0780f259fb3f41b1c08f8c155aba86427688bcd75ea9b10950
MD5 37fc11cab09fbfcbbda6949e68ab02da
BLAKE2b-256 1536c31c30434f7c30ee9827c5eafd7725941690f6abae5c58c77708fbc5af52

See more details on using hashes here.

File details

Details for the file ngt-2.0.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ngt-2.0.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33b1801f85c6efd9f8f746577f0b5a3e62eed949ad07695fcf55361816cb616b
MD5 c7a50be006739338fb467ab3f20d35cf
BLAKE2b-256 1812b5c6d45ed923bd4c8bfa279e9adab2c045f6599e0948949849a885d3f9af

See more details on using hashes here.

File details

Details for the file ngt-2.0.4-cp36-cp36m-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: ngt-2.0.4-cp36-cp36m-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.6m, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for ngt-2.0.4-cp36-cp36m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 d8cdfc9a862880e3b6fedf117f8bde261c7528ea61a05fe707d5474ce2c1bf9d
MD5 18077edcfc850b9eee1b17b2f4d7177b
BLAKE2b-256 a4b949e250759d22e55742ddc66bc9b8262621c18235f3d7b022633132317e03

See more details on using hashes here.

Supported by

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