Skip to main content

Python bindings for ArrowSpace (Rust) providing graph-based similarity search, signal graphs, and spectral methods for vector data.

Project description

pyarrowspace

Python bindings for arrowspace-rs. This is experimental software meant for research at current state.

This is the starting repository for arrowspace, it is made public as a showcase for the Python interface, to collect feedback and make public some results of the tests run. To run needs the arrowspace-rs Rust module in a sibling directory.

For labs and tests please see tests/

Installation

From PyPi:

pip install arrowspace

or any other way of installing a Python library.

If you have cargo installed, to compile the libraries involved (from crates.io):

pip install maturin
maturin develop

Tests

Simple test:

python tests/test_0.py

Test with public QA dataset:

python tests/test_1_quora_questions.py

There are other tests but they require downloadin a dataset separately or fine-tuning the embeddings on a given dataset. Give it a try and let me know!

Simplest Example

from arrowspace import ArrowSpaceBuilder
import numpy as np

items: np.array = np.array(
    [[0.1, 0.2, 0.3], [0.0, 0.5, 0.1], [0.9, 0.1, 0.0]],
    dtype = np.float64
)

graph_params: dict = {
    "eps": 1.0,
    "k": 6,
    "topk": 3,
    "p": 2.0,
    "sigma": 1.0,
}

# Create an ArrowSpace instance, returning the computed
# signal graph and lambdas
aspace, gl = ArrowSpaceBuilder.build(graph_params, items)

# Search comparable items
# defaults: k = nitems, alpha = 0.9, beta = 0.1
query: np.array = np.array(
    [0.05, 0.2, 0.25],
    dtype = np.float64
)

tau: float = 1.0
hits: list = aspace.search(query, gl, tau)

# Search returns a list of `(index, score`) tuples, where
# expected value from the code above show the first index
# having the top score, i.e., being nearest.

print(hits)
# [ (0, 0.989743318610787), (1, 0.7565344158360029), (2, 0.22151940739207396) ]

Download files

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

Source Distribution

arrowspace-0.23.0.tar.gz (25.3 MB view details)

Uploaded Source

Built Distributions

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

arrowspace-0.23.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (921.5 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

arrowspace-0.23.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (862.2 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

arrowspace-0.23.0-cp314-cp314-macosx_11_0_arm64.whl (782.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

arrowspace-0.23.0-cp314-cp314-macosx_10_12_x86_64.whl (824.5 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

arrowspace-0.23.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (860.6 kB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ ARM64

arrowspace-0.23.0-cp313-cp313-win_amd64.whl (701.9 kB view details)

Uploaded CPython 3.13Windows x86-64

arrowspace-0.23.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (920.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

arrowspace-0.23.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (861.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

arrowspace-0.23.0-cp313-cp313-macosx_11_0_arm64.whl (781.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

arrowspace-0.23.0-cp313-cp313-macosx_10_12_x86_64.whl (824.1 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

arrowspace-0.23.0-cp312-cp312-win_amd64.whl (702.5 kB view details)

Uploaded CPython 3.12Windows x86-64

arrowspace-0.23.0-cp312-cp312-manylinux_2_34_x86_64.whl (760.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

arrowspace-0.23.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (921.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

arrowspace-0.23.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (862.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

arrowspace-0.23.0-cp312-cp312-macosx_11_0_arm64.whl (782.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

arrowspace-0.23.0-cp312-cp312-macosx_10_12_x86_64.whl (824.4 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file arrowspace-0.23.0.tar.gz.

File metadata

  • Download URL: arrowspace-0.23.0.tar.gz
  • Upload date:
  • Size: 25.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for arrowspace-0.23.0.tar.gz
Algorithm Hash digest
SHA256 69304057a4607d5c70344ffded74b26c03583900f3ca75bfd263fa7ce8a5f306
MD5 2635231caa820743ca98e75712872d77
BLAKE2b-256 69167948cac22958cff0c6c2d0c415faf022bd794abc1ae93f046fcedcf632c5

See more details on using hashes here.

File details

Details for the file arrowspace-0.23.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18fcdb379cf51343b1b7ffe2679cbe6a6afb077f370bd636303bc7219f2f290b
MD5 d8287f2f0a85258872616681d5ac5a94
BLAKE2b-256 e90dafc90fcdab5350ed6736c452ae1e1f5f0f641cff1d0d3538ce1d873c6535

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 625583f5b591c47d7fcab395baae987ad74bed2f8d195fd1eb7e77542a492964
MD5 5598579dab3f5b169b4152a3a0180236
BLAKE2b-256 2503700552271d264e9b97c791df8dca8799ef736ef929cb47f0e85c1153a063

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 673e66e6c2b853df9da35004ab82799f0bc54c4392106376d383073d625e750f
MD5 96ae5b56dc3cee402338ae42ec0c2529
BLAKE2b-256 1c60eb0002eb3c893a354a67f78b1c9b5398383c2e702036321d85904cafe61d

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d5d0440504038a1a8889b6b7689fdd6dc2f2a53eb13b84ca30a20d8ead3839e6
MD5 1f7619232568348bcef3a5148c490408
BLAKE2b-256 b35401a05eb3a949ceb0633bc9442cf58cb7affb3723a0ab659e3b5090cbeac1

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5b3499063de3d58e200cb63a8dfffc12ddbd03cdb0092353386a1c8dbd55dbe5
MD5 fa12eaa2f41f7f1049e16f9d04994d18
BLAKE2b-256 819fb6587ea11a04ecaccb1a44c1679dac3e456d486e1b2c88b3d8083ffb123e

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: arrowspace-0.23.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 701.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arrowspace-0.23.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c59cf7cab3e7526ae01d11401d19eaf20738191aa13be3499b1d0598a851dd7a
MD5 594081767e447501f0d595aa74d161f0
BLAKE2b-256 66acf036fa6219639a4525a02fbdf6ff9c9409cee9936032164980fbc8c6995e

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp313-cp313-win_amd64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e83eb4192ca428044a3f11cb4f51846dbf629763275e6ae40e9b42fcf9540d52
MD5 201ac9e84adf9bc957debde997df6d00
BLAKE2b-256 9510d3c0b32ae0d3ec3e5e9082ff1ebc6eec95c234c6570f213132b431e3b2da

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a3f057b3e8877d77b63598b0e9729765fb525c05f9ce32ca3229a7a7d1505f1d
MD5 2359e89dd5aa94506b7fbf6d767fbbb3
BLAKE2b-256 6957b51edc2d4b3b9952ca6a80fe4b1da5fd794d5d17977e36d74d9273d3fc06

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b28f311838ff85eeb5b80bace69f1593ec93b7afd7a48a5d2cfa939d7283a55d
MD5 f399b08bdc98a8f1d05023f755dd88b3
BLAKE2b-256 dc922b6a433c08e84e26c0b4eff1c33d19a2bff7cf217a073697321e79c2166b

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 af50ae384e75122cdc9f5b012fd0c73c22701afe8454a19202f91a4dec3b6ec1
MD5 e04004d6a17e6c28ddf83cd78eb6ed26
BLAKE2b-256 63977cc218c23a66aa55de747e8c1ba579db57fa98d705386546f96c31731034

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: arrowspace-0.23.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 702.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arrowspace-0.23.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 dc174e480c31f7fdc5af55ea9f8802c0db487bf621e2835bd4533897a9dad51f
MD5 aa70b52a9c16caca19655a49df937a1d
BLAKE2b-256 ad235a14b34b9931893760fd91ed5e6d4ffb5996ef2f9b73f07ff4e23ad8e1de

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp312-cp312-win_amd64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 66e8de6966522ddc3d4ea8e8cfe0df6e2421d88281126af7b82445443a5dae29
MD5 4ef65f3f5efe9eec5ed395951aa4b96d
BLAKE2b-256 4fe31330ae056eec8efc7b0050f9e401a50a57c2f074afd28ad083fa2797701a

See more details on using hashes here.

File details

Details for the file arrowspace-0.23.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b898a7f39ca23a45be2db21bf7ec9beb1f2a56b6727e02dea3dbe075f9a84c2
MD5 0bd2f4986fa157cb6b8bab82c5d708eb
BLAKE2b-256 c224973f8f506352b676cafc233b2fd1dc0c1315d5018d541956e082639674eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b02bf35106eec143af1fe3e033d8783f2b82c06d4c298bf8d14d9de6e55d3348
MD5 29b4317c847156f0ff5cd1fb5c87c45b
BLAKE2b-256 70a65934450581c05cbde033f92f2c2d7456cf1ee2cf399a94bb1a53e5564145

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 046e896a2b57d007360eedeb7d193251b738ebf3ab12d55b8eba198823c02d16
MD5 193e475368bc198b47a4fba6bbbe2047
BLAKE2b-256 f1dfa6df2d19132de60646882f2ad7ca58ce5b3a806fc3cd70c07a076faf215c

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arrowspace-0.23.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for arrowspace-0.23.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 da20914ede04360fad124a8ddb56cbeedb339205ac6cc3ec46220ca641139f29
MD5 421ea761142b3f776ad0db3573d645c5
BLAKE2b-256 d1a1b648a3311adb594fed6b9ea3c65f4ae65dddcd2232edb763e27433842851

See more details on using hashes here.

Provenance

The following attestation bundles were made for arrowspace-0.23.0-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on tuned-org-uk/pyarrowspace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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