semvec/pypi-packages huggingface dataset:
jbai_clinet 2026.1.808
Auto-generated Python client
Requires Python: >=3.10

# Grazie API client

## Installation

```shell
$ poetry install
```

## Usage examples

Create the client:
```python
import os

from openapi_client import JbaiPlatformClient, JbaiAuthType, JbaiEndpoint

client = JbaiPlatformClient(
    endpoint=JbaiEndpoint.STAGING,
    auth_type=JbaiAuthType.USER,
    api_key=os.getenv("GRAZIE_USER_TOKEN_STGN"),
)
```

### LLM API

Get the list of LLM profiles:
```python
response = client.get_llm_profiles_v9()
for profile in response.profiles:
    print(profile)
```

Use LLM chat:
```python
# noinspection PyTypeChecker
for response in client.post_llm_chat_stream_v9(
        request=ChatModelsStreamV9Request(
            prompt="test",
            profile="openai-gpt-4",
            chat=V5LLMChat(
                messages=[
                    LLMChatUserMessage(content="Tell me a joke about programmers"),
                ]
            ),
        )
):
    print(response)
```

Use `AsyncJbaiPlatformClient` for asynchronous execution:
```python
async def main():
    # noinspection PyTypeChecker
    async for response in client.post_llm_chat_stream_v9(
            request=ChatModelsStreamV9Request(
                prompt="test",
                profile="openai-gpt-4",
                chat=V5LLMChat(
                    messages=[
                        LLMChatUserMessage(content="Tell me a joke about programmers"),
                    ]
                ),
            )
    ):
        print(response)

asyncio.run(main())
```

### Tasks API

Get tasks roster:
```python
response = client.get_task_roster()
for task in response.ids:
    print(task)
```

Call a task (optionally specify a task tag via custom header (valid only for STAGING)):
```python
# noinspection PyTypeChecker
for response in client.post_text_improve_shorten_v5(
        headers={
            JbaiHeader.GRAZIE_TASK_TAG: "openai-chat-gpt"
        },
        TextImproveShortenV5Request(
            parameters={
                "text": "This is a simple example sentence that could be made shorter and clearer.",
                "lang": "en",
            }
        )
):
    print(response)
```

P.S. Most modern IDEs support auto-import functionality, which can simplify the discovery and import of data model classes.

## Data models documentation

See [MODELS.md](./MODELS.md)
topk-sdk 0.7.5
Python SDK for topk.io
Requires Python: >=3.9
Keywords: topk, search, vector, keyword, bm25

![TopK](https://qdmy0nqdjsamgtso.public.blob.vercel-storage.com/topk-logo-light.svg)

# TopK Python SDK

**Full documentation is available at [docs.topk.io](https://docs.topk.io).**

The **TopK SDK** provides a Python API for managing collections, inserting and deleting documents, and running powerful search queries. With **automatic embeddings** via `semantic_index()`, you can perform **semantic search without needing to manage vector embeddings manually**.

TopK’s **query language** is designed to be simple yet expressive, allowing you to search using **semantic similarity, keyword matching, and filters—all in a single query**.

## Features

- **Automatic embeddings**—no need for external vector models.
- **Create and manage collections** with custom schemas.
- **Perform hybrid search** using **semantic similarity, keyword search, and filters**.
- **Upsert and delete documents** within collections.
- **Automatic schema validation** and easy collection management.
- **Intuitive Python API** for seamless integration.

## 1. Install the SDK

Install the TopK SDK via **pip**:

```bash
pip install topk-sdk
```

## 2. Create an API Key

To authenticate with TopK, you'll need an **API key**:

1. Go to the <a href="https://console.topk.io" target="_blank">TopK Console</a>.
2. Create an account and generate your API key.

> **Keep your API key secure**—you'll need it for authentication.

## 3. Create a Collection

Collections are the primary data structure in TopK. They store documents and enable queries.

### **Initialize the Client**

```python
from topk_sdk import Client

client = Client(api_key="YOUR_TOPK_API_KEY", region="aws-us-east-1-elastica")
```

### **Define and Create a Collection**

```python
from topk_sdk.schema import text, semantic_index

client.collections().create(
  "books",
  schema={
    "title": text().required().index(semantic_index()),  # Semantic search enabled on title
  },
)
```

> **Note:** Other fields can still be upserted even if they are not defined in the schema.

## 4. Add Documents

Now, add documents to the collection. **Each document must have an `_id` field**.

```python
client.collection("books").upsert(
  [
    {"_id": "gatsby", "title": "The Great Gatsby"},
    {"_id": "1984", "title": "1984"},
    {"_id": "catcher", "title": "The Catcher in the Rye"}
  ],
)
```

## 5. Run a Search Query

Now, **retrieve books using semantic search**:

```python
from topk_sdk.query import select, field, fn

results = client.collection("books").query(
  select(
    "title",
    title_similarity=fn.semantic_similarity("title", "classic American novel"), # Semantic search
  )
  .topk(field("title_similarity"), 10) # Return top 10 most relevant results
)
```

## 6. (Optional) Delete a Collection

To remove the entire collection:

```
client.collections().delete("books")
```
nmdc-api-utilities 0.6.1
A Python library for general research functions using NMDC APIs
Requires Python: >=3.10

# nmdc_api_utilities
A library designed to simplify various research tasks for users looking to leverage the NMDC (National Microbiome Data Collaborative) APIs. The library provides a collection of general-purpose functions that facilitate easy access, manipulation, and analysis of microbiome data.

# Usage
Example use of the Biosample class:
```python
from nmdc_api_utilities.biosample_search import BiosampleSearch

# Create an instance of the module
biosample_client = BiosampleSearch()
# Use the variable to call the available functions
biosample_client.get_record_by_id(collection_id="nmdc:bsm-13-amrnys72")
```
For real use case examples, see the [nmdc_notebooks](https://github.com/microbiomedata/nmdc_notebooks) repository. Each of the Python Jupyter notebooks use this package.

## Logging - Debug Mode
To see debugging information, include these two lines where ever you are running the functions:
```python
import logging
logging.basicConfig(level=logging.DEBUG)
# when this is run, you will see debug information in the console.
biosample_client.get_record_by_id(collection_id="nmdc:bsm-13-amrnys72")
```

# Installation
To install, run:

```bash
python3 -m pip install nmdc_api_utilities
```

Peridodically run
```bash
python3 -m pip install --upgrade nmdc_api_utilities
```
to ensure you have the latest updates from this package.

# Documentation
Documentation about available functions and helpful usage notes can be found at https://microbiomedata.github.io/nmdc_api_utilities/.