Skip to main content

SQLModel-like library for Milvus

Project description

PyMilvusModel

Inspired by SQLModel, PyMilvusModel:

is a library for interacting with Milvus databases from Python code, with Python objects.

and follows the same paradigm, using Python type annotations and powered by Pydantic

Example Usage

from typing import List, Optional
from typing_extensions import Annotated
from pymilvus import MilvusClient, DataType
from pymilvusmodel import MilvusIndexParam, MilvusField, MilvusModel


class ExampleModel(MilvusModel):
    indexes: list[MilvusIndexParam] = [
        MilvusIndexParam("vector", "IVF_FLAT", "vector_index", metric_type="COSINE", params={
            "nlist": 128
        })
    ]
    id: Annotated[
        Optional[int],
        MilvusField(name="id", dtype=DataType.INT64,
                    is_primary=True, auto_id=True)
    ] = None
    vector: Annotated[
        List[float],
        MilvusField(name="vector", dtype=DataType.FLOAT_VECTOR, dim=2)
    ]


MILVUS_CLIENT = MilvusClient("http://localhost:19530")
MilvusModel.metadata.create_all(MILVUS_CLIENT)
print(MILVUS_CLIENT.list_collections()) # ['ExampleModel']

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

milvusmodel_py-0.1.0b0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

milvusmodel_py-0.1.0b0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file milvusmodel_py-0.1.0b0.tar.gz.

File metadata

  • Download URL: milvusmodel_py-0.1.0b0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for milvusmodel_py-0.1.0b0.tar.gz
Algorithm Hash digest
SHA256 158c80ec19ceef610daa85bd8d666a1e4d7aa849956c09fe5b0423447bd665dc
MD5 a90d30bf937b3a8305e299773b29ad29
BLAKE2b-256 067316c70cf0a73eedf31894c2457637475fc45b493445476bd13e1ead189975

See more details on using hashes here.

Provenance

The following attestation bundles were made for milvusmodel_py-0.1.0b0.tar.gz:

Publisher: python-publish.yml on brianferri/PyMilvusModel

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

File details

Details for the file milvusmodel_py-0.1.0b0-py3-none-any.whl.

File metadata

File hashes

Hashes for milvusmodel_py-0.1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 8da01adbc8630c034c11c37e789ba7dc475fe8acdbd9d4c053a1702ba45114e5
MD5 d2c09b1a8557a41a5c5ffde0d432cfd0
BLAKE2b-256 519c55ab8101b28f6f81ea04d03b5091a48aee5cce24c2dca5f98c259ea04cf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for milvusmodel_py-0.1.0b0-py3-none-any.whl:

Publisher: python-publish.yml on brianferri/PyMilvusModel

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