semvec/pypi-packages huggingface dataset:
django-celery-tracker 2.1.0
Celery tracker for Django.
License: MIT
Keywords: celery django events monitoring tracker

=========================
Celery Tracker for Django
=========================

|build-status|

This django extension is intended for existing celery projects that want better monitoring of what's going on in their queue.

Usage
=====

To use this with your project, you need to:

1. Install django-celery-tracker:

.. code-block:: console

    $ pip install django-celery-tracker

1. Add ``django_celery_tracker`` to ``INSTALLED_APPS`` in your Django settings file:

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'django_celery_tracker',
    )

1. Create the database tables by applying migrations:

.. code-block:: console

    $ python manage.py migrate django_celery_tracker

1. You will now have a record of all *future* celery tasks and their progress which can be queried like so:

.. code-block:: console

    $ python manage.py console
    ...
    >>> from django_celery_tracker.models import CeleryTask
    >>> CeleryTask.objects.all()
    <QuerySet [<CeleryTask: id=3d889396-daa2-4209-9348-9ec71bfb1262, name=api.taskapp.celery.debug_task>]

Dashboard
=========

Optionally, you can include a dashboard view that can only be accessed by admin users. To add the dashboard to your project, simply add the following to your ``urls.py``:

.. code-block:: python

    urlpatterns = [
        path("celery-tracker/", include("django_celery_tracker.urls")),
    ]

You can now visit ``http://site_url/celery-tracker`` to view the status of your tasks!

Disclaimer
==========

The datastore for a celery message queue is usually in-memory and highly-optimized (eg ``redis`` or ``rabbitmq``).  This django extension creates a database entry for every celery task that is created. You may want to periodically delete older entries if storage is an obstacle.

.. |build-status| image:: https://github.com/chris-allen/django-celery-tracker/actions/workflows/static_tests.yml/badge.svg
    :alt: Build status
    :target: https://github.com/chris-allen/django-celery-tracker/actions/workflows/static_tests.yml
getpartofimg 0.10
Extracts a part of the image specified by width and height from the given image file path using OpenCV.
License: MIT
Keywords: cv2,cut,opencv


# Extracts a part of the image specified by width and height from the given image file path using OpenCV.

## pip install getpartofimg 

#### Tested against Windows 10 / Python 3.10 / Anaconda 

Parameters:
-----------
image : Any
	The file path of the image from which a part will be extracted.

width : int
	The desired width of the extracted part.

height : int
	The desired height of the extracted part.

allow_resize : bool, optional (default=True)
	If True, allows resizing of the input image when the specified width or height is greater
	than the original image's dimensions.

Returns:
--------
numpy.ndarray
	The extracted part of the image as a NumPy array.

Raises:
-------
ValueError
	If the 'allow_resize' parameter is set to False and the specified width or height is greater than
	the original image's dimensions, a ValueError is raised with a message indicating that the image is too small.

Notes:
------
The function uses the 'cv2.imread_plus' function ( https://github.com/hansalemaos/a_cv_imwrite_imread_plus )
to read the image from the given file path. It then calculates
the possible ranges for extracting the desired part based on the image's dimensions and the specified width
and height. If the 'allow_resize' parameter is True, the function resizes the image using 'cv2.easy_resize_image'
( https://github.com/hansalemaos/a_cv2_easy_resize )
with the 'cv2.INTER_AREA' interpolation method to fit the desired part. Otherwise, it raises a ValueError.

Random starting coordinates within the allowable range are generated to extract the part of the image specified
by the given width and height.



```python
# Example usage:
import cv2
from getpartofimg import get_part_of_image
im = get_part_of_image(image=r"https://raw.githubusercontent.com/hansalemaos/screenshots/main/pic5.png", width=600, height=500, allow_resize=True)
cv2.imwrite('c:\\testimage.png', im)


```
pingertron 0.3.0
Ping Hosts and URLs and keep stats on successes and failures
License: MIT
Requires Python: >=3.11,<4.0

# Ping Hosts and URLs and keep stats on successes and failures

Run this as a daemon on your box and check in to see if there are problems.

Intended to be a slightly different approach to blackbox_exporter.

## Installing

```sh
pip install pingertron
```

## Running

```sh
pingertron probes.yaml
```

ICMP usually needs root access to send packets:

```sh
sudo pingertron probes.yaml
```

There is an example [probes.yaml](examples/probes.yaml) you can use as a basis for your own.

## probes.yaml

Specify one or more probes to run using probes.yaml.

This file is re-read on each evaluation cycle, so you can update it without restarting the process.

Example probes.yaml:

```yaml
interval_seconds: 60  # seconds between each batch of probes being sent

probes:
- protocol: http  # one of icmp or http
  description: my probe  # optional description
  # probe specific properties
# HTTP Probe
- protocol: http
  # description: my HTTP probe  # optional description
  url: https://example.com/  # URL to probe, http or https
  method: GET  # HTTP method to use
  expected_status_code: 200  # HTTP status code you expect, usually 200
# ICMP Probe
- protocol: icmp
  # description: my ICMP probe  # optional description
  hostname: 10.0.0.1  # Hostname or IP to ping.
```

The canonical definition of what goes into this file can be found in [probes_config.py](pingertron/probes_config.py).

## Developing

### devenv

If you use [devenv](https://devenv.sh):

```sh
direnv allow .
```

### poetry

If you use [poetry](https://python-poetry.org):

```sh
poetry install
poetry run pingertron
```