semvec/pypi-packages huggingface dataset:
study-id-generator 0.0.5
Study ID Generator.
Requires Python: >=3.8

# Study ID Generator

The Study ID Generator queries an API and generates a study identifier by finding the one with the greatest Euclidean distance to all the others where each feature is each digit in the identifier.

## Installation

```bash 
pip install study_id_generator
```

## Usage

### Run the application.

```bash
python -m study_id_generator
```

### Click the `Generate Study ID` button.
![Applications](app.png)

## Configuration

Create an `.ini` configuration file at `~/.config/study_id_generator/config.ini`.

```ini
[DEFAULT]
MIN_ID = 
MAX_ID = 
ID_WIDTH = 
ID_FILLCHAR = 0

[API1]
URL =
CERT_PATH =
API_KEY = 
FIELD_NAME = study_id
ID_REGEX = ^\d{N}$

[API2]
URL =
CERT_PATH =
API_KEY = 
FIELD_NAME = study_id
ID_REGEX = ^\d{N}$
```
arq-prometheus 0.3.0
Prometheus metrics for arq job queues
Requires Python: >=3.8,<4.0
Keywords: arq,prometheus,metrics

# Arq-prometheus

![Build status](https://github.com/kpn/arq-prometheus/actions/workflows/test.yaml/badge.svg)
[![PyPI Package latest release](https://img.shields.io/pypi/v/arq-prometheus.svg?style=flat-square)](https://pypi.org/project/arq-prometheus/)
[![PyPI Package download count (per month)](https://img.shields.io/pypi/dm/arq-prometheus?style=flat-square)](https://pypi.org/project/arq-prometheus/)
[![Supported versions](https://img.shields.io/pypi/pyversions/arq-prometheus.svg?style=flat-square)](https://pypi.org/project/arq-prometheus/)
[![Codecov](https://img.shields.io/codecov/c/github/kpn/arq-prometheus.svg?style=flat-square)](https://codecov.io/gh/kpn/arq-prometheus)


Prometheus metrics for [arq](https://github.com/samuelcolvin/arq)

⚠️ WARNING! This is a project in alpha phase ⚠️

## Installation

[Pip](https://pip.pypa.io/en/stable/)

```sh
pip install -U arq-prometheus
```

[Poetry](https://python-poetry.org/)

```sh
poetry add arq-prometheus
```

## Description

The metrics exposed are the same as the health check.

| Metric name             | Description                      |
| ----------------------- | -------------------------------- |
| `arq_jobs_completed`    | The number of jobs completed     |
| `arq_jobs_failed`       | The total number of errored jobs |
| `arq_jobs_retried`      | The total number of retried jobs |
| `arq_ongoing_jobs`      | The number of jobs in progress   |
| `arq_queued_inprogress` | The number of jobs in progress   |

When working with `arq` I found some limitations, it was specially hard to get access to
the worker in order to retrieve information like the `queue_name` or `health_check_key`.
The startup and shutdown functions only make available a `ctx` with the redis connection.
This means that if you provide a custom `queue_name` or `health_check_key`, you will
also have to provide them to `ArqPrometheusMetrics`.

## Usage

````python
# example_worker.py
from arq_prometheus import ArqPrometheusMetrics

async def startup(ctx):
    arq_prometheus = ArqPrometheusMetrics(ctx, delay=delay)
    ctx["arq_prometheus"] = await arq_prometheus.start()

async def shutdown(ctx):
    await ctx["arq_prometheus"].stop()

class WorkerSettings:
    on_startup = startup
    on_shutdown = shutdown
    function = []  # your arq jobs
    ... # other settings

````

Start your arq worker,

```sh
arq example_worker.WorkerSettings
```

Make request to `localhost:8081` (or open in browser).

```sh
curl localhost:8081
```


## Arguments

- `ctx: dict`: arq context
- `queue_name: str = default_queue_name`: name of the arq queue
- `health_check_key: Optional[str] = None`: arq health key
- `delay: datetime.timedelta = datetime.timedelta(seconds=5)`: a datetime.timedelta
- `enable_webserver: bool = True`: set to True if you want a web server exposing the metrics
- `addr: str = "0.0.0.0"`: webserver address
- `port: int = 8081`: webserver port
- `registry: prom.CollectorRegistry = prom.REGISTRY`: the prometheus registry, usually you do not have to override this