vecto-sdk


Namevecto-sdk JSON
Version 0.2.3 PyPI version JSON
download
home_pagehttps://github.com/XpressAI/vecto-python-sdk
SummaryOfficial Python SDK for Vecto
upload_time2024-01-11 09:21:35
maintainer
docs_urlNone
authorXpress AI
requires_python>=3.8
license
keywords vector-database vector-search
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
<a href="https://www.vecto.ai/">
<img src="https://user-images.githubusercontent.com/68586800/192857099-499146bb-5570-4702-a88f-bb4582e940c0.png" width="300"/>
</a>
</p>
<p align="center">
  <a href="https://docs.vecto.ai/">Docs</a> •
  <a href="https://www.xpress.ai/blog/">Blog</a> •
  <a href="https://discord.com/invite/wtYbXvPPfD">Discord</a> •
    <a href="https://github.com/XpressAI/vecto-tutorials">Tutorials</a>

<br>

# Vecto Python SDK
Official Python SDK for [Vecto](https://www.vecto.ai/), the database software that puts intelligent search and powerful models at your fingertips, allowing you to leverage the full potential of AI in mere minutes. 


## Installation
You can install the package from our latest GitHub [release](https://github.com/XpressAI/vecto-python-sdk/releases). 
```
pip install vecto-sdk
```
Alternatively you can also download the latest wheel file from the releases page.

For the token, sign up for your access [here](https://www.vecto.ai/contactus).


## Building the Wheel
If you would like to build your own wheel, run `python setup.py bdist_wheel --universal` which creates a .whl file in the dist folder. You can install that wheel file with `pip install dist/vecto-*.whl` into your current environment (if the file is in the current working directory).

## Sample Usage

For first time users, we recommend using our `VectorSpace` interface.

### Find Nearest Neighbors

```
import vecto
vecto.api_key = os.getenv("VECTO_API_KEY", "")
vector_space = vecto.VectorSpace("my-cool-ai")

for animal in ["lion", "wolf", "cheetah", "giraffe", "elephant", "rhinoceros", "hyena", "zebrah"]:
    vector_space.ingest_text(animal, { 'text': animal, 'region': 'Africa' })

similar_animals = vector_space.lookup_text("cat", top_k=3)
                        
for animal in similar_animals:
    print(f"{animal.attributes['text']} similarity: {animal.similarity:.2%}")

# Prints: "lion similarity: 84.91%"
```

### Ingest Text or Images
```
import vecto
from pathlib import Path
vecto.api_key = os.getenv("VECTO_API_KEY", "")
vector_space = vecto.VectorSpace("my-cool-image-ai")

if not vector_space.exists():
    vector_space.create(model='CLIP', modality='IMAGE') 

for animal in ["lion.png", "wolf.png", "cheetah.png", "giraffe.png", "elephant.png", "rhinoceros.png", "hyena.png", "zebra.png"]:
    vector_space.ingest_image(Path(animal), { 'text': animal.replace('.png', ''), 'region': 'Africa' })

similar_animals = vector_space.lookup_image(Path("cat.png"), top_k=1)

for animal in similar_animals:
    print(f"{animal.attributes['text']}")

# Prints: lion
```

### Looking up by Analogy


```
import vecto
vecto.api_key = os.getenv("VECTO_API_KEY", "")
vector_space = vecto.VectorSpace("word_space")

if not vector_space.exists():
    vector_space.create(model='SBERT', modality='TEXT') 

for word in ["man", "woman", "child", "mother", "father", "boy", "girl", "king", "queen"]:
    vector_space.ingest_text(word, { 'text': word })

analogy = vector_space.compute_text_analogy("king", { 'start': 'man', 'end': 'woman' }, top_k=3)

for word in analogy:
    print(f"{word.attributes['text']} similarity: {word.similarity:.2%}")

# Prints: "queen similarity: 93.41%"
```

For more advanced capabilities including management access, we recommend using the core Vecto class.

## Tutorial
We have a new Vecto tutorial! Checkout the [Vecto tutorials repository](https://github.com/XpressAI/vecto-tutorials).

## Developers Discord
Have any questions? Feel free to chat with the devs at our [Discord](https://discord.com/invite/wtYbXvPPfD)!



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/XpressAI/vecto-python-sdk",
    "name": "vecto-sdk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "vector-database,vector-search",
    "author": "Xpress AI",
    "author_email": "eduardo@xpress.ai",
    "download_url": "",
    "platform": null,
    "description": "<p align=\"center\">\n<a href=\"https://www.vecto.ai/\">\n<img src=\"https://user-images.githubusercontent.com/68586800/192857099-499146bb-5570-4702-a88f-bb4582e940c0.png\" width=\"300\"/>\n</a>\n</p>\n<p align=\"center\">\n  <a href=\"https://docs.vecto.ai/\">Docs</a> \u2022\n  <a href=\"https://www.xpress.ai/blog/\">Blog</a> \u2022\n  <a href=\"https://discord.com/invite/wtYbXvPPfD\">Discord</a> \u2022\n    <a href=\"https://github.com/XpressAI/vecto-tutorials\">Tutorials</a>\n\n<br>\n\n# Vecto Python SDK\nOfficial Python SDK for [Vecto](https://www.vecto.ai/), the database software that puts intelligent search and powerful models at your fingertips, allowing you to leverage the full potential of AI in mere minutes. \n\n\n## Installation\nYou can install the package from our latest GitHub [release](https://github.com/XpressAI/vecto-python-sdk/releases). \n```\npip install vecto-sdk\n```\nAlternatively you can also download the latest wheel file from the releases page.\n\nFor the token, sign up for your access [here](https://www.vecto.ai/contactus).\n\n\n## Building the Wheel\nIf you would like to build your own wheel, run `python setup.py bdist_wheel --universal` which creates a .whl file in the dist folder. You can install that wheel file with `pip install dist/vecto-*.whl` into your current environment (if the file is in the current working directory).\n\n## Sample Usage\n\nFor first time users, we recommend using our `VectorSpace` interface.\n\n### Find Nearest Neighbors\n\n```\nimport vecto\nvecto.api_key = os.getenv(\"VECTO_API_KEY\", \"\")\nvector_space = vecto.VectorSpace(\"my-cool-ai\")\n\nfor animal in [\"lion\", \"wolf\", \"cheetah\", \"giraffe\", \"elephant\", \"rhinoceros\", \"hyena\", \"zebrah\"]:\n    vector_space.ingest_text(animal, { 'text': animal, 'region': 'Africa' })\n\nsimilar_animals = vector_space.lookup_text(\"cat\", top_k=3)\n                        \nfor animal in similar_animals:\n    print(f\"{animal.attributes['text']} similarity: {animal.similarity:.2%}\")\n\n# Prints: \"lion similarity: 84.91%\"\n```\n\n### Ingest Text or Images\n```\nimport vecto\nfrom pathlib import Path\nvecto.api_key = os.getenv(\"VECTO_API_KEY\", \"\")\nvector_space = vecto.VectorSpace(\"my-cool-image-ai\")\n\nif not vector_space.exists():\n    vector_space.create(model='CLIP', modality='IMAGE') \n\nfor animal in [\"lion.png\", \"wolf.png\", \"cheetah.png\", \"giraffe.png\", \"elephant.png\", \"rhinoceros.png\", \"hyena.png\", \"zebra.png\"]:\n    vector_space.ingest_image(Path(animal), { 'text': animal.replace('.png', ''), 'region': 'Africa' })\n\nsimilar_animals = vector_space.lookup_image(Path(\"cat.png\"), top_k=1)\n\nfor animal in similar_animals:\n    print(f\"{animal.attributes['text']}\")\n\n# Prints: lion\n```\n\n### Looking up by Analogy\n\n\n```\nimport vecto\nvecto.api_key = os.getenv(\"VECTO_API_KEY\", \"\")\nvector_space = vecto.VectorSpace(\"word_space\")\n\nif not vector_space.exists():\n    vector_space.create(model='SBERT', modality='TEXT') \n\nfor word in [\"man\", \"woman\", \"child\", \"mother\", \"father\", \"boy\", \"girl\", \"king\", \"queen\"]:\n    vector_space.ingest_text(word, { 'text': word })\n\nanalogy = vector_space.compute_text_analogy(\"king\", { 'start': 'man', 'end': 'woman' }, top_k=3)\n\nfor word in analogy:\n    print(f\"{word.attributes['text']} similarity: {word.similarity:.2%}\")\n\n# Prints: \"queen similarity: 93.41%\"\n```\n\nFor more advanced capabilities including management access, we recommend using the core Vecto class.\n\n## Tutorial\nWe have a new Vecto tutorial! Checkout the [Vecto tutorials repository](https://github.com/XpressAI/vecto-tutorials).\n\n## Developers Discord\nHave any questions? Feel free to chat with the devs at our [Discord](https://discord.com/invite/wtYbXvPPfD)!\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Official Python SDK for Vecto",
    "version": "0.2.3",
    "project_urls": {
        "Documentation": "https://docs.vecto.ai/",
        "Homepage": "https://github.com/XpressAI/vecto-python-sdk",
        "Issues": "https://github.com/XpressAI/vecto-python-sdk/issues",
        "Source": "https://github.com/XpressAI/vecto-python-sdk"
    },
    "split_keywords": [
        "vector-database",
        "vector-search"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "58d91ab0f4242eaad28c06445de5d5d17bd475db1d0f46f8067de096a9d00914",
                "md5": "808ce4d0c61dc24a18dfafa1b83c2ed3",
                "sha256": "b63cc0616b4792f6521a11f211265cb5003a79b1fc02ce810b9be763bb0ce5b7"
            },
            "downloads": -1,
            "filename": "vecto_sdk-0.2.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "808ce4d0c61dc24a18dfafa1b83c2ed3",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 20071,
            "upload_time": "2024-01-11T09:21:35",
            "upload_time_iso_8601": "2024-01-11T09:21:35.552572Z",
            "url": "https://files.pythonhosted.org/packages/58/d9/1ab0f4242eaad28c06445de5d5d17bd475db1d0f46f8067de096a9d00914/vecto_sdk-0.2.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-11 09:21:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "XpressAI",
    "github_project": "vecto-python-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "vecto-sdk"
}
        
Elapsed time: 0.16961s