Skip to main content

Python SDK for HIDDB

Project description

HIDDB Python SDK

The official SDK for the HIDDB vector database.

Installation

Use the package manager pip to install the SDK.

pip install hiddb

Usage

Create a collection within a database <your database_id>.

from hiddb.synchronous import HIDDB

hiddb = HIDDB("<key>", "<secret>")

# Create a collection named 'wordvectors'
hiddb.create_collection(database_id="<your database_id>", collection_id="wordvectors")

Create an index within this collection:

# Create an index on field 'vector' within the collection and dimension 300
hiddb.create_index(
    database_id="<your database_id>",
    collection_name='wordvectors',
    index_name="vector",
    dimension=300
)

Insert documents like that:

document = {
    "vector": [0.0]*300,
    "id": "my first document"
}

hiddb.insert_document(
    database_id=database_id,
    collection_name='wordvectors',
    documents=[document]
)

Search for nearest documents:

similar_words = hiddb.search_nearest_documents(
    database_id="<your database_id>",
    collection_name='wordvectors',
    index_name="vector",
    vectors=[[42.0]*300],
    max_neighbors=10
)

More examples and a more detailed documentation will follow soon 🚀

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

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

hiddb-0.1.10.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

hiddb-0.1.10-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file hiddb-0.1.10.tar.gz.

File metadata

  • Download URL: hiddb-0.1.10.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.15.0-37-generic

File hashes

Hashes for hiddb-0.1.10.tar.gz
Algorithm Hash digest
SHA256 6c7b2a320742564f21fb720992ba4cfd76191eaab11b790d852244927561e448
MD5 870c9aa1fb7b5f6acf0ea944053267ff
BLAKE2b-256 483066e748745716b80e40664e1529de43ac65325e8e9c6e2976bbc10b6edac4

See more details on using hashes here.

File details

Details for the file hiddb-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: hiddb-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.15.0-37-generic

File hashes

Hashes for hiddb-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 561d54bd1ec593aa7edddb53bd0ebc60f9048baf841edc85b62dbeea54fd3864
MD5 c7e3c3660469320f8e393a1f56f1f016
BLAKE2b-256 62faa080be6a8090310506a659334004190e3b9fd00788f574e8c01e270c1e00

See more details on using hashes here.

Supported by

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