semvec/pypi-packages huggingface dataset:
django-public-admin-mixins 0.0.1
A Django app make the admin public
Requires Python: >=3.10

# django-public-admin-mixins

**WARNING**: *Using this app may introduce security issues. We don't
recommend using it in production. Use at you own risk.*

This app helps developers create public interfaces using the django
admin. That is, an interface where no login is required, and all users
only have view permission on models.

There is another app,
[`django-public-admin`](https://github.com/cuducos/django-public-admin),
which implements a similar funcionality, but uses child classes instead
of mixins. For small admin projects it should be quicker to setup, but
these mixins allow for more configurability.

## Installation

1. `$ pip install django-public-admin-mixins`
2. Add `public_admin` to you `INSTALLED_APPS`, before `django.contrib.admin`

## Usage

To make the admin interface public, one must configure both the admin
site and the `ModelAdmin` classes that are registered to that site. For
that, `django-public-admin-mixins` exposes two mixins:
`PublicAdminSiteMixin` and `PulbicModelAdminMixin`. To use the former,
one must use a custom admin site. More details can be found
[here](https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-the-default-admin-site),
but the basic idea for overriding the default admin site is as follows:

```python
# myproject/admin.py

from django.contrib import admin

from django_public_admin.admin import PublicAdminSiteMixin


class PublicAdminSite(PublicAdminSiteMixin, admin.AdminSite):
    pass
```

```python
# myproject/apps.py

from django.contrib.admin.apps import AdminConfig


class PublicAdminConfig(AdminConfig):
    default_site = "myproject.admin.PublicAdminSite"
```

```python
# myproject/settings.py

INSTALLED_APPS = [
    # ...
    "myproject.apps.PublicAdminConfig",  # replaces 'django.contrib.admin'
    # ...
]
```

When registering a model to this admin site, use a custom model admin
which uses our mixin:

```python
# myapp/admin.py

from django.contrib import admin

from django_public_admin.admin import PublicModelAdminMixin

from .models import MyModel

class PublicModelAdmin(PublicModelAdminMixin, admin.ModelAdmin):
    pass

admin.site.register(MyModel, PublicModelAdmin)
```

## Templates

This app ships with templates to override links in the head of the site
that aren't suited to a public admin, like the ones for login and
logout. If you decide to use your own, there is no need to add the app
to the `INSTALLED_APPS` list.
doublespike 1.0.1
The double spike toolbox
Requires Python: >=3.9

# The double spike toolbox

Error propagation and data reduction for the double spike technique in mass spectrometry.

The workings of this package are described in:

Rudge J.F., Reynolds B.C., Bourdon B. The double spike toolbox (2009) Chem. Geol. 265:420-431
https://dx.doi.org/10.1016/j.chemgeo.2009.05.010

and at:

https://johnrudge.com/doublespike

## Installation

This is a standard python 3 package, which can be installed using pip:

```
pip install doublespike
```

## Usage

A series of Jupyter python notebooks describing usage can be found in the [src/](src/) folder. New
users should begin by looking at [src/example.ipynb](src/example.ipynb)
mmtools 0.0.39
mmtools
Requires Python: >=3.11

# mmtools - i3 status bar and notification script for Mattermost

mmtools are various tools using the [mattermost](https://mattermost.org) API.

# Installation

```bash
sudo pip3 install mmtools
```

This will install mmtols from pypi, including the following required packages:

- caep
- pydantic
- mattermostdriver
- passpy
- notify2
- dbus-python
- requests

For dbus-python to build, you need to have the libdbus-1-dev package installed. On debian you can do

```bash
sudo apt install libdbus-1-dev
```

# Tools

The following tools are included:

### mmstatus

`mmstatus` connects to the mattermost API to get unread messages in all channels. It then outputs a statusbar (usable in i3blocks) of unread messages and exits. Supports private/public/user channels and different coloring on group chats and user chats.

Example configuration for i3blocks:

```
[mattermost]
command=/usr/local/bin/mmstatus
separator=true
interval=60
signal=12
```

### mmpolybar

`mmpolybar` same as mmstatus, but with polybar colors.

Example configuration for polybar:

```
[module/mmpolybar]
type = custom/script
exec = mmpolybar
tail = true
```

### mmwaybar

`mmwaybar` same as mmstatus, but with output for waybar.

Example configuration for waybar:

```
"custom/mattermost": {
    "exec": " mmwaybar",
    "return-type": "json",
    "interval": 90
}
```

### mmwatch

`mmwatch` connects to the mattermost websocket API and can display notification on messages and send SIGUSR2 to i3blocks to update statusbar before next interval.


## Configuration

All tools can be configured using both command line arguments and a configuration file.

`mmtools` will first look for a configuration in `~/.config/mmtools/config-<HOSTNAME>` with fallback to `~/.config/mmtools/config`.

Use the following command to create the configuration `~/.config/mmtools/config`. The same configuration file is used for both tools.

```bash
mmconfig init
```

In this file you must specify at least:

```
# Mattermost server
server = <SERVER>

# Mattermost user
user = <USERNAME>

# either password
password = <MATTERMOST PASSWORD>

# OR pass entry (https://www.passwordstore.org)
password-pass-entry = <PASS ENTRY>
```

## User service for `mmwatch`

`mmwatch` can be started as a systemd user service by creating the following file:

`.config/systemd/user/mmwatch.service`

with this content:

```
[Unit]
Description=mm watch

[Service]
ExecStart=/usr/local/bin/mmwatch

Restart=always

# time to sleep before restarting a service
RestartSec=30

[Install]
WantedBy=default.target
```

Enable at login

```
systemctl --user enable mmwatch
```

Start manually
```
systemctl --user start mmwatch
```

# Local development

For local development, execute:

```bash
pip3 install -e .
```