semvec/pypi-packages huggingface dataset:
vlm-tools 0.2.3
Tools to work with the VLM-1 API.
Requires Python: <3.12,>=3.10

# Tools for VLM-1

<p align="center">
    <a href="https://pypi.org/project/vlm-tools/">
        <img alt="PyPi Version" src="https://badge.fury.io/py/vlm-tools.svg">
    </a>
    <a href="https://pypi.org/project/vlm-tools/">
        <img alt="PyPi Version" src="https://img.shields.io/pypi/pyversions/vlm-tools">
    </a>
</p>


`vlm-tools` provides a convenient set of tools to interact with the [VLM-1](https://autonomi.ai/vlm-1) API.


## Installation

The `vlm-tools` python package is available on PyPI. You can install it using pip:

```sh
pip install vlm-tools
```

Optionally, if you want to install the `torch` extra dependencies, you can do so by installing the package with the `torch` extra:

```sh
pip install vlm-tools[torch]
```


## Authentication

The VLM-1 API requires an API key to authenticate requests. You can obtain an API key by signing up on the [waitlist](https://airtable.com/appjX6543bChjNaEN/pagnciKtynSt4rOT9/form). Once you have an API key, you can set it in the environment variable `VLM_API_KEY`:

```bash
export VLM_API_KEY='...'
```

## Usage

### Image -> JSON

The python client needs to be configured with your personal API key before you can use it. You can set the API key in the environment variable `VLM_API_KEY` as described above or pass it to the client constructor.

```python
from vlm_tools.api import vlm

>>> image = Image.open(...)
>>> response_json = vlm(image, domain="document.presentation")
>>> response_json
{
  "description": "...",
  "title": "Differentiated Operating Model",
  "page_number": 7,
  "plots": [
    ...
  ],
  "tables": null,
  "others": [
    ...
  ]
}
```

### Streaming Image -> JSON

You can also stream the image to the API using the `stream` method. This is useful when you want to stream images to our API sequentially, and one-by-one. We provide some helper functions to help you with sampling unique-images (content-based sampler) from a video stream.

```python
from vlm_tools.video import VideoReader, VideoItertools

>>> itertools = VideoItertools()
>>> video = VideoReader("path/to/video.mp4")
>>> for img in itertools.islice(video, similarity_threshold=0.9)
...     response_json = vlm(img, domain="document.presentation")
```

## Requirements

 - Python 3.10+

 We currently support Python 3.10+ on Linux and macOS. If you have any questions or issues, please [open an issue](https://github.com/autonomi-ai/vlm-cookbook/issues).
mystique 0.4.0
A loose data matcher to help you write Python tests
Requires Python: >=3.7

# Mystique

A loose data matcher to help you write Python tests

# Introduction

Imagine you need to fetch some data from a JSON API in a test. It returns a payload with 10 fields, but you only care about two of them. With Mystique you can be as rigerous or loose as you want when checking data equivalence. Check against any combination of dictionaries, lists, and objects.

# Examples

```python
from matcher import Matcher
from matcher.predicates import Is, IsEval, IsType

data = {'foo': 'baz', 'bar': [1, 3]}

# exact match
assert Matcher().matches(data,
    {'foo': 'baz', 'bar': [1, 3]})

# make sure one of the values just matches a type, instead of a value
assert Matcher().matches(data,
    {'foo': 'baz', 'bar': IsType(list[int])})

# perhaps you don't care about the type at all. just that there is a value
assert Matcher().matches(data,
    {'foo': 'baz', 'bar': Is()})

# check anything you want by writing your own logic
assert Matcher().matches(data,
    {'foo': 'baz', 'bar': IsEval(lambda x: len(x) == 2)})

# if you dont care if a key is present or not, use 'sparse_dicts' settinvg
assert Matcher(sparse_dicts=True).matches(data, {'foo': 'baz'})
```

See tests/ for more examples.

# Requirements

- python >= 3.7
- python >= 3.10 recommended

# Development

```bash
pip install -r requirements.txt -r requirements_dev.txt

make test
```
jupyter-kernel-install 2407.0.1
Utility to install various jupyter kernel specs.
Requires Python: >=3.8

# Install Kernel Specifications into userspace
[![PyPI version](https://badge.fury.io/py/jupyter-kernel-install.svg)](https://badge.fury.io/py/jupyter-kernel-install)
[![Pipeline](https://github.com/FREVA-CLINT/install-kernelspec/actions/workflows/ci_job.yml/badge.svg)](https://github.com/FREVA-CLINT/install-kernelspec/actions)
[![codecov](https://codecov.io/gh/FREVA-CLINT/install-kernelspec/graph/badge.svg?token=90RyY5I9AI)](https://codecov.io/gh/FREVA-CLINT/install-kernelspec)
[![BSD](https://anaconda.org/conda-forge/freva/badges/license.svg)](https://github.com/FREVA-CLINT/install-kernelspec/LICENSE)

This code installs jupyter kernels for different languages into the user space.
Once the kernel has been installed it can be used on the [jupyter-hub server](https://jupyterhub.dkrz.de/)
of DKRZ.

## Installation
```python
python3 -m pip install jupyter-kernel-install
```

## Usage

### Using the command line interface (cli):

```console
jupyter-kernel-install --help
```

```bash
Usage: jupyter-kernel-install [-h] [--name NAME] [--display-name DISPLAY_NAME] [--version] language

Install jupyter kernel specs of different languages.

Positional Arguments:
  language              The programming language

Options:
  -h, --help            show this help message and exit
  --name, -n NAME       The name of the kernel (default: None)
  --display-name, -d DISPLAY_NAME
                        The display name of the kernel (default: None)
  --version, -V         Display version and exit
```
Alternatively you can use:

```console
python -m jupyter_kernel_install --help
```

The following kernel specifications are supported:
- python3
- gnuR
- bash

Example for installing a gnuR kernel:

```console
jupyter-kernel-install r --name r-regiklim --display-name "R for Regiklim"
```

### Using the python library

Example for programmatically installing a bash kernel:

```python
import jupyter_kernel_install as ki
kernel_path = ki.bash(name="bash-regiklim", display_name="bash kernel")
```

## Contributing
Any contributions are welcome. To start developing we recommend creating a new
[mini conda environment](https://docs.conda.io/projects/conda/en/latest/index.html).

```console
conda env create -f environment.yml; conda activate install-kernelspec
```
Unit tests, building the documentation, type annotations and code style tests
are done with [tox](https://tox.wiki/en/latest/). To run all tests, linting
in parallel simply execute the following command:

```console
tox -p 3
```
You can also run the each part alone, for example to only check the code style:

```console
tox -e lint
```
available options are ``lint``, ``types`` and ``test``.

Tox runs in a separate python environment to run the tests in the current
environment use:

```console
pytest
```