Skip to main content

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.

cd NGT_ROOT/python
pip3 install .

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.

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.8.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (12.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

ngt-2.8.0-cp314-cp314-macosx_26_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.14macOS 26.0+ ARM64

ngt-2.8.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (12.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

ngt-2.8.0-cp313-cp313-macosx_26_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 26.0+ ARM64

ngt-2.8.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (12.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

ngt-2.8.0-cp312-cp312-macosx_26_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

ngt-2.8.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (12.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

ngt-2.8.0-cp311-cp311-macosx_26_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 26.0+ ARM64

File details

Details for the file ngt-2.8.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for ngt-2.8.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8a2e236d1d1f59237e018995fd7fde88675b634ee4e57dd96154f445442c47e8
MD5 9800496a437d260265ab8bb0120a1909
BLAKE2b-256 28e376f7ba9010d02094bd50bd61ef3304a83998043095dd7cc318120c927509

See more details on using hashes here.

File details

Details for the file ngt-2.8.0-cp314-cp314-macosx_26_0_arm64.whl.

File metadata

  • Download URL: ngt-2.8.0-cp314-cp314-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.14, macOS 26.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for ngt-2.8.0-cp314-cp314-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 2c105753aa25d044f497e361e2eb956785c9e4dae637656c59ff84afd26af6fb
MD5 652d53f0a240f4e8cce36bf6439d5def
BLAKE2b-256 0620d2beb795038f4d3bf29e939e68dcb4621d0c6f38cc30764cd7ba226e9a81

See more details on using hashes here.

File details

Details for the file ngt-2.8.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for ngt-2.8.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 308610ec0e9b558152c59849d16455cf1abcab9329caea6a33748146bcd086d3
MD5 c04219c979bab31757905a3df50b9746
BLAKE2b-256 5b6e67b49ade1ad81189f15fcc587802e5e48b9e9325777774c81e8116e5ad02

See more details on using hashes here.

File details

Details for the file ngt-2.8.0-cp313-cp313-macosx_26_0_arm64.whl.

File metadata

  • Download URL: ngt-2.8.0-cp313-cp313-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.13, macOS 26.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for ngt-2.8.0-cp313-cp313-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 c60b3e6eeda0498d5bbb1cc0c9997796390be89890c6d20ba07d91bb853d6166
MD5 a6a5a7a1603489a0f27ddd6c6fe4a761
BLAKE2b-256 b7e3ade471d0eaa8cd32590bdb1aa5c5f40f2b83b729b15bebac85b674d1a462

See more details on using hashes here.

File details

Details for the file ngt-2.8.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for ngt-2.8.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 479ada6279fb11cba3e46b74935c826df604dff25485ea0671775aec1952ca9d
MD5 ae89dd431bc984fa61dfa84cdf74b868
BLAKE2b-256 5e6ad9b64a06728a118892bf85daf48bbfbafcb77999421cd8a347a572b0d12b

See more details on using hashes here.

File details

Details for the file ngt-2.8.0-cp312-cp312-macosx_26_0_arm64.whl.

File metadata

  • Download URL: ngt-2.8.0-cp312-cp312-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.12, macOS 26.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for ngt-2.8.0-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 23e3bfe7c893db6e99316bcfbf9a5bc2e0a8f4e34ddfbedad34b610347dea447
MD5 86062e1a0f29cc4ef47934f6903d75e4
BLAKE2b-256 9ed0c965949351170ef6c34fbb58705753f90cf983b48043717634e2f532146d

See more details on using hashes here.

File details

Details for the file ngt-2.8.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for ngt-2.8.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8db24365638fef7572a45fe14f6776059df1d34897df2f8294108d28a12f6e8e
MD5 7bb17b7f4a4820b3684926f1dfe9885e
BLAKE2b-256 f5feb5e593409243245dc6d443c2d1c00b48feaa48097d791e5af407a126b6b7

See more details on using hashes here.

File details

Details for the file ngt-2.8.0-cp311-cp311-macosx_26_0_arm64.whl.

File metadata

  • Download URL: ngt-2.8.0-cp311-cp311-macosx_26_0_arm64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.11, macOS 26.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for ngt-2.8.0-cp311-cp311-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 cbb31b94344d5dbb1c977db5348ea9eaec625e8834ff6509693c7bdcc0df0537
MD5 7d644bb99a9ea3fb0aa29fc8fe2d43d4
BLAKE2b-256 d8c0c3191b66d3341aedf115e88d9861187fe764a519b67f6fed2319fc538404

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.8.0 This release

8 files

2.3.12

12 files

2.3.9

12 files

2.1.6

12 files

2.1.3

7 files

2.0.4

10 files

2.0.3

10 files

2.0.2

5 files

1.14.6

10 files

1.14.5

10 files

1.14.4

5 files

1.14.3

5 files

1.14.1

10 files

1.12.2

9 files

1.12.1

8 files

1.11.6

7 files

1.11.5

7 files

1.10.0

7 files

1.8.4

7 files

1.8.1

6 files

1.8.0

6 files

1.7.10

6 files

1.7.9

6 files

1.7.7

6 files

1.7.6

6 files

1.7.5

6 files

1.5.1

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page