semvec/pypi-packages huggingface dataset:
animatplot-ng 0.4.5
Making animating in matplotlib easy
License: MIT
Requires Python: >=3.5

[![Documentation Status](https://readthedocs.org/projects/animatplot-ng/badge/?version=latest)](https://animatplot-ng.readthedocs.io/en/latest/?badge=latest)

# animatplot-ng
A python package for making interactive as well as animated plots with matplotlib. Based on [animatplot by r-makaro](https://github.com/t-makaro/animatplot).

![image](docs/source/tutorial/images/multiblock.gif)
![image](docs/source/_static/animatplot-mouse.gif)

## Requires
- Python >= 3.5
- Matplotlib >= 2.2 (because [sliders have discrete values](https://matplotlib.org/users/whats_new.html#slider-ui-widget-can-snap-to-discrete-values))
## Installation
```bash
pip install animatplot-ng
```

## Documentation
Documentation can be found [here](https://animatplot-ng.readthedocs.io/en/latest/index.html)

## Dev Install
```bash
git clone https://github.com/boutproject/animatplot-ng.git
pip install -e .
```
This project uses ```pycodestyle``` for linting. For testing, ```pytest``` is used.
scope-client 1.4.1185
Arthur Python API Client Library
License: MIT
Requires Python: >=3.9
Keywords: api arthur client ArthurAI sdk ml model monitoring

[//]: # (user-facing readme)

# Arthur API Client
[Arthur](https://www.arthur.ai/) is the platform for centralized monitoring of production models. 
We help data scientists, product owners, and business leaders accelerate model operations to optimize 
for accuracy, explainability, and fairness. As a model- and infrastructure-agnostic platform, Arthur 
adds a layer of intelligence to your AI stack and scales with your deployments.

Our API Client makes it easy to integrate your models with the Arthur platform. For help getting started or 
using the SDK, check out [our documentation](https://docs.arthur.ai/).
django-apitokens 0.0.3
Generate API tokens for django-restframework
License: MIT
Requires Python: >=3.7
Keywords: django, api, restframework, tokens, self-service

# django-apitokens

Generate tokens compatible with Django Restframework (`drf`) from your Django Admin view:
- Create new tokens at will (after being generated, they no longer can be reversed, since only a digest is stored in the database).
- Add expirity dates (supports time and date)
- Remove tokens when you no longer need them.

## My Token view

![Screenshot 2023-03-21 at 14 47 02](https://user-images.githubusercontent.com/7786556/226643622-893b631d-d353-4833-8def-78f61ea77561.png)


## Add token view

![Screenshot 2023-03-21 at 14 47 19](https://user-images.githubusercontent.com/7786556/226643580-ac761fd7-91a9-4c5c-898b-4cc1daf9d812.png)


# Install

- Install the python package: `pip install django-apitokens` 
- Add `apitokens` to your Django installed apps:

```python
# In your settings.py
INSTALLED_APPS = [
    ...
    'apitokens',
]
```

- Ensure you are using `knox` `TokenAuthentication` class:

```python
# In your settings.py
REST_FRAMEWORK = {
    ...,
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'knox.auth.TokenAuthentication',
        ...,
    ),
    ...,
}
```

- You are set to use tokens generated through this app as a way to login with the DRF framework.

# Contributing

To contribute code to this app, ensure you're following the [community guidelines](https://github.com/surface-security/guidelines#contributing)
django-dbcleanup 0.1.5
Easily monitor database usage - and clean it up (based on your django models)
License: MIT
Requires Python: >=3.7

# django-dbcleanup

Easily monitor database usage - and clean it up (based on your django models)

This pluggable app provides:
* visibility over database disk space usage for your models
* command to remove unused tables and recover disk space
* remove historical data from models that have *any* `DateTimeField` (configurable in the project settings.py)

## Usage

### model and admin view
`dbcleanup.Table` is an unmanaged model mapped to information tables in MySQL and PostgreSQL and added to django admin

![image](https://user-images.githubusercontent.com/63779195/145431955-e20f4a16-924e-4159-8b63-8853ef66f8aa.png)

### command

`dbcleanup` is the management command that can be used (or scheduled) to remove unused
```
$ ./manage.py dbcleanup -h
usage: manage.py dbcleanup [-h] [-f] [-i] [-j {tables,history,analyze,migrations}] [--no-fk] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color]
                           [--force-color] [--skip-checks]

Remove database tables that do not map to any models, such as when a django app is removed/disabled.

optional arguments:
  -h, --help            show this help message and exit
  -f, --force           Delete the items (instead of just listing them)
  -i, --interactive     Ask which items to delete, interactively
  -j {tables,history,analyze,migrations}, --just {tables,history,analyze,migrations}
                        Perform only a subset of actions
  --no-fk               Disable FOREIGNKEY_CHECK when DROPping tables - CAREFUL! use only if you are sure the constraints are not from a table in use (ie: circular dependencies between drop candidates)
```

Need to use `--force` or `--interactive` to actually perform changes, otherwise it'll be a dry run.  
Covered actions are:
* `tables`: remove database tables that do not map to any model (ie: when a app is removed from the project, there is no migration to delete the tables) - use `settings.DBCLEANUP_REQUIRED_TABLES` to whitelist tables that would otherwise be removed
* `history`: remove old records for the models defined in `settings.DBCLEANUP_HISTORY_MODELS` (more below)
* `analyze`: only for MySQL - force analyze on all the tables to update the row count and size estimates
* `migrations`: remove migrations (from `django_migrations` table) that not in the project migration path (ie: after migration squashing and reset)

### historical data

`settings.DBCLEANUP_HISTORY_MODELS` is a list of tuples where each tuple is `(MODEL_NAME, DAYS_TO_KEEP, DATE_TIME_FIELD_NAME)`.

```
# someproject/settings.py
DBCLEANUP_HISTORY_MODELS = [
    ('notifications.notification', 365, 'time'),
    ...
]
```

With this setup, when `./manage.py dbcleanup -j history` is executed, all `notifications.Notification` entries with `time` older than 365 days would be deleted.  
History cleanup is skipped if it would cascade into other models (unless it's a multi-table model and it would cascade to the parent model).
django-impersonator 0.0.3
Impersonate middleware to let you impersonate other users.
License: MIT
Requires Python: >=3.7
Keywords: django, impersonate

# django-impersonate

This Django app lets admin users impersonate other users, useful when testing and debugging permissions.

**Non superusers are not allowed** to perform this request, even if they have view rights to the `User` model, so that this cannot be used for privilege escalation.

As admin, I can choose the "Impersonate" action:

![image](https://user-images.githubusercontent.com/7786556/228572564-6549367d-3ee4-4b0b-a978-a3467388b654.png)

Impersonations are terminated by closing the bottom left pop-up.

![image](https://user-images.githubusercontent.com/7786556/228573725-9bde3dbd-1df0-4884-a333-95165cac880a.png)


Impersonate is not available for regular users, returning an error for those with view rights to the `User` model.


## Setup

Add middleware to your middleware list and make sure it comes *after* `django.contrib.auth.middleware.AuthenticationMiddleware`:

```python
MIDDLEWARE = [
    ...
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    ...
    'impersonate.middleware.ImpersonateMiddleware',
    ...
]
```

In one of your `admin.py` files, add the action to `UserAdmin` (or the admin model of your custom User)

```python
from impersonate.admin import impersonate_action
from django.contrib.auth import admin


admin.UserAdmin.actions.append(impersonate_action)
```

Or call it from any of your views (if you're not using django-admin)

```python
from django.contrib.auth import models
from impersonate.admin import impersonate_action

def my_view(request, target_username):
    return impersonate_action(None, request, models.User.objects.filter(username=target_username))
```
django-logbasecommand 0.0.5
Minimal package to add logging helpers to Django management commands
License: MIT
Requires Python: >=3.9

# django-logbasecommand

Minimal package to add logging helpers to Django management commands

## Usage

Replace

```
from django.core.management.base import BaseCommand

class YourCommand(BaseCommand):
```

with

```
from logbasecommand.base import LogBaseCommand

class LogBaseCommand(BaseCommand):
```

and now you can use the drop-in methods to replace `self.stdout`/`self.stderr`:
* `log`
* `log_debug`
* `log_warning`
* `log_error`
* `log_exception`

Or access `self.logger` directly.


All command logger names are derived from the command module name and prefixed with `logbasecommand.base` (by default, use `LOGBASECOMMAND_PREFIX` setting to change it), so logging can be configured from your project settings.py, with `LOGGING`, ie (full example, check the `loggers` part):

```python
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'},
        'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'},
    },
    'formatters': {
        'verbose': {'format': '[%(asctime)s] [%(process)s] [%(levelname)s] [%(name)s] %(message)s'},
        'minimal': {'format': '[%(levelname)s] [%(name)s] %(message)s'},
    },
    'handlers': {
        'console': {
            'level': 'INFO',
            'filters': ['require_debug_false'],
            'class': 'logging.StreamHandler',
            'formatter': 'verbose',
        },
        'console_debug': {
            'level': 'DEBUG',
            'filters': ['require_debug_true'],
            'class': 'logging.StreamHandler',
            'formatter': 'verbose',
        },
        'console_minimal': {
            'level': 'INFO',
            'filters': ['require_debug_false'],
            'class': 'logging.StreamHandler',
            'formatter': 'minimal',
        },
        'console_debug_minimal': {
            'level': 'DEBUG',
            'filters': ['require_debug_true'],
            'class': 'logging.StreamHandler',
            'formatter': 'minimal',
        },
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler',
        },
    },
    'loggers': {
        '': {'handlers': ['console', 'console_debug'], 'level': 'INFO', 'propagate': True},
        'logbasecommand.base': {
            'handlers': ['console_minimal', 'console_debug_minimal'],
            'level': 'DEBUG',
            'propagate': False,
        },
    },
}
```