semvec/pypi-packages huggingface dataset:
nova-sdk 0.0.0.0.1
This is a template repository for Python projects that use Poetry for their dependency management.
Requires Python: <4.0,>=3.8

# nova-python-sdk

[![Release](https://img.shields.io/github/v/release/solidi-labs/nova-python-sdk)](https://img.shields.io/github/v/release/solidi-labs/nova-python-sdk)
[![Build status](https://img.shields.io/github/actions/workflow/status/solidi-labs/nova-python-sdk/main.yml?branch=main)](https://github.com/solidi-labs/nova-python-sdk/actions/workflows/main.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/solidi-labs/nova-python-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/solidi-labs/nova-python-sdk)
[![Commit activity](https://img.shields.io/github/commit-activity/m/solidi-labs/nova-python-sdk)](https://img.shields.io/github/commit-activity/m/solidi-labs/nova-python-sdk)
[![License](https://img.shields.io/github/license/solidi-labs/nova-python-sdk)](https://img.shields.io/github/license/solidi-labs/nova-python-sdk)

This is a template repository for Python projects that use Poetry for their dependency management.

- **Github repository**: <https://github.com/Solidi-Labs/nova-python-sdk/>
- **Documentation** <https://solidi-labs.github.io/nova-python-sdk/>

## Getting started with your project

Install the environment and the pre-commit hooks with

```bash
make install
```

To finalize the set-up for publishing to PyPi or Artifactory, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/publishing/#set-up-for-pypi).
For activating the automatic documentation with MkDocs, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/mkdocs/#enabling-the-documentation-on-github).
To enable the code coverage reports, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/codecov/).

## Releasing a new version

- Create an API Token on [Pypi](https://pypi.org/).
- Add the API Token to your projects secrets with the name `PYPI_TOKEN` by visiting [this page](https://github.com/solidi-labs/nova-python-sdk/settings/secrets/actions/new).
- Create a [new release](https://github.com/solidi-labs/nova-python-sdk/releases/new) on Github.
- Create a new tag in the form `*.*.*`.

For more details, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/cicd/#how-to-trigger-a-release).

---

Repository initiated with [fpgmaas/cookiecutter-poetry](https://github.com/fpgmaas/cookiecutter-poetry).
milvus-api 0.2.1.2
A Milvus API used for quickly setting up a Milvus vector database

![milvus_logo_with_a_steampunk_and_industrial_style](https://i.imgur.com/QedXqF0.jpeg)

# milvus_api
`milvus_api` is a Python library that primarily provides functionalities to manage databases, including creating collections, inserting data, searching and updating index.

## Installation
This project depends on several Python libraries. Use the following command to install the necessary libraries:

```bash
pip install pymilvus==2.4.0 milvus-model==0.2.0 pydantic==2.7.0 tqdm==4.66.2 FlagEmbedding==1.2.9 torch==2.2.2 numpy==1.24.4
```

## Usage Examples
### Creating a Database Collection

Here's how to create a new database collection using `milvus_api`:
```
from milvus_api.db_model.milvus_db import MilvusDB
from pymilvus import FiledSchema, DataType

host = 'localhost'
port = '19530'
db = MilvusDB(host, port)

fields = [  
    FieldSchema(name="id", dtype=DataType.INT64, auto_id=True, is_primary=True),
    FieldSchema(name="embeddings", dtype=DataType.FLOAT_VECTOR, dim=1024)
]

db.create_collection("my_collection", 1000, fields, "FLAT", "COSINE")
```

### Data Encoding Using the Model
Here's how to perform query encoding using the embedding model in `milvus_api`:

```
from milvus_api.embed_model.bgem3 import PyMilvusBGEM3

query = ["Are you afraid of the earthquake"]
model_name = 'bgem3_model'

# Initialize the model
bgem3 = PyMilvusBGEM3(model_name)
results = bgem3.encode(query)
```
## Release Note
- 0.2.1:(Feat): support **IVF_PQ** indexing algorithm for `switch_index`.
- 0.2.0:(Feat): add the `switch_index` operation to `MilvusDB` object.
```
from milvus_api.db_model.milvus_db import MilvusDB

db = MilvusDB(host, port)

# Assume you already have a collection with index.
db.switch_index("your_collection_name", "drop_index_name", "new_index_type", "field_name", metric_type")
```
- 0.1.4:(BugFix): Fix the logic error when do `search` operation.
- 0.1.3:(BugFix): Fix the error caused by the non-specific `field` argument during creating collection.
- 0.1.2:(BugFix): Cancel partial information of `info` function.
- 0.1.1: Modify this project structure to ensure that users can import 'milvus_api' normally.



## Contributions
Thanks to all developers who contributed to this project. If you would like to contribute code, please follow the existing code style and submit a pull request.

## Copyright and License
This project is licensed under the [Apache License 2.0.](https://www.apache.org/licenses/LICENSE-2.0)

## Other Information
This `README.md` file is now complete, including an introduction to the project, installation instructions, usage examples, contribution guidelines, and copyright and licensing information. You can save this content as the `README.md` file in the root directory of your project. If you need further modifications or wish to add additional information, feel free to let me know!