Merge pull request 'Initialise backend' (#1) from initialise-backend into main

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
boris.waaub committed 2026-11-24 14:59:48 +00:00
commit 982b556c48
56 files changed
+3202 -4

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
# Copier en .env pour le développement. Ne jamais commiter .env.
SECRET_KEY=changer-moi
DEBUG=true
ALLOWED_HOSTS=localhost,127.0.0.1
DATABASE_URL=postgres://prism:prism@db:5432/prism
EMAIL_URL=smtp://mailpit:1025
DEFAULT_FROM_EMAIL=no-reply@prism.localhost
# Sources externes (valeurs par défaut dans config/settings.py)
# BEST_ADDRESS_URL=
# NOMINATIM_URL=https://nominatim.openstreetmap.org/search
# IRCELINE_WMS_URL=https://geo.irceline.be/rio/wms
# PRISM_HTTP_TIMEOUT=5
+9
View File
@@ -0,0 +1,9 @@
.env
__pycache__/
*.pyc
.venv/
.pytest_cache/
.ruff_cache/
backend/staticfiles/
node_modules/
dist/
+40
View File
@@ -0,0 +1,40 @@
# PRISM
Outil d'aide à la consultation pour médecins généralistes : à partir de l'adresse d'un patient, évalue 4 facteurs de stress environnementaux (bruit, air, inondation, radon) en Wallonie et à Bruxelles. Client : cellule Environnement de la SSMG ; réalisation : Champs Libres. Référence : `specifications/SPECIFICATIONS_TECHNIQUES_PRISM_Phase1.md`.
## Commandes
Tout tourne dans Docker (Python 3.12) ; copier `.env.example` en `.env` au préalable.
```bash
docker compose up -d --build
docker compose exec web python manage.py migrate
docker compose exec web python manage.py seed_factors # 4 facteurs + sources, idempotent
docker compose exec web python manage.py createsuperuser
docker compose exec web pytest # tests (HTTP mocké avec respx)
docker compose exec web sh -c 'ruff check . && ruff format --check .'
docker compose exec web python manage.py makemigrations --check --dry-run
```
Dépendances : `backend/pyproject.toml` + `uv.lock` (uv). Après modification : `uv lock` (dans un conteneur Python 3.12), puis `docker compose build web`.
URL en dev : API `http://localhost:8000/api/v1/`, doc OpenAPI `/api/docs/`, admin `/admin/`, Mailpit `http://localhost:8025`.
## Architecture (`backend/`)
- `config/` : settings (tout par variables d'environnement via django-environ). URL et couches des sources externes dans `PRISM_SOURCES`.
- `accounts/` : `User` (e-mail = identifiant, `status` ; seul `active` peut se connecter), `MailEvent`. Rôles = Groups « Médecin », « Cellule SSMG », « Admin » (migration `0002_roles`). django-otp installé, endpoints d'auth pas encore écrits.
- `factors/` : `Factor`, `DataSource`, `ThresholdClass` (valeur source → niveau 1–4 + couleur, par région ; `BE` = repli national), `ContentBlock` (textes, statut brouillon/validé, historique), `Reference` + `ContentReference` (notes numérotées).
- `assessments/` :
- `geocoding/` : chaîne Best Address (désactivée tant que `BEST_ADDRESS_URL` est vide, format à confirmer) → Nominatim. Région déduite du code postal.
- `providers/` : un module par facteur (`FactorProvider.fetch(client, location) -> RawResult`), inscrit dans `registry.py`. Un module lève une exception si sa source ne répond pas ; le service la convertit en `status: unavailable`.
- `services.py` : géocode, appelle les modules en parallèle (httpx async), mappe `RawResult.source_value` sur `ThresholdClass.source_value`, joint le `ContentBlock` validé.
État des sources : bruit et inondation Wallonie via WalOnMap (ArcGIS REST `query`), air via irCELine (WMS `GetFeatureInfo`, moyennes annuelles). Bruxelles (bruit, inondation) et radon (AFCN) ne sont pas raccordés : ils renvoient `unavailable`. Pas de PostGIS pour l'instant (aucune donnée géographique stockée).
## Règles
- **Aucune adresse ni coordonnée de patient** stockée ou journalisée. Ne jamais journaliser une URL de requête sortante ni le message d'une exception httpx (ils contiennent les coordonnées) : seulement le code du facteur et le type d'erreur. Les loggers `httpx`/`httpcore` restent en WARNING. Un test (`test_address_is_not_logged`) le vérifie.
- Seuils, couleurs et textes médicaux sont en base (Django admin), jamais dans le code. Exception : les valeurs guides OMS servant à compter les dépassements (`providers/air.py`).
- Ajouter un facteur = un module dans `providers/` + inscription dans `registry.py` + classes et contenus dans l'admin.
- Code, commentaires, libellés et messages en français. Licence GPL v3.
+16 -2
View File
@@ -23,7 +23,7 @@ Hors périmètre (Phase 2) : mise à l'échelle, maintenance, intégration dans
| Couche | Choix | | Couche | Choix |
|---|---| |---|---|
| Front-end | Vue 3, Vite, TypeScript, Vue Router, vue-i18n, Leaflet, Bootstrap 5 (CSS seul) | | Front-end | Vue 3, Vite, TypeScript, Vue Router, vue-i18n, MapLibre GL JS, Bootstrap 5 (CSS seul) |
| Back-end | Python, Django 5, Django REST Framework | | Back-end | Python, Django 5, Django REST Framework |
| Données | PostgreSQL + PostGIS (GeoDjango) | | Données | PostgreSQL + PostGIS (GeoDjango) |
| Authentification | Comptes propres à PRISM, django-otp (TOTP et codes de secours) | | Authentification | Comptes propres à PRISM, django-otp (TOTP et codes de secours) |
@@ -39,6 +39,20 @@ Le parcours cliquable des maquettes (bureau et mobile, 32 écrans) est consultab
Dans la vue Penpot, le sélecteur de parcours (en haut) permet de choisir un flow : parcours principal, création de compte, mot de passe oublié, connexion avec 2FA, activation de la 2FA, erreurs, et leurs équivalents mobiles. La charte graphique reprend celle de [ssmg.be](https://www.ssmg.be/). Dans la vue Penpot, le sélecteur de parcours (en haut) permet de choisir un flow : parcours principal, création de compte, mot de passe oublié, connexion avec 2FA, activation de la 2FA, erreurs, et leurs équivalents mobiles. La charte graphique reprend celle de [ssmg.be](https://www.ssmg.be/).
## Démarrage (développement)
```bash
cp .env.example .env # puis renseigner SECRET_KEY
docker compose up -d --build
docker compose exec web python manage.py migrate
docker compose exec web python manage.py seed_factors
docker compose exec web python manage.py createsuperuser
```
API : <http://localhost:8000/api/v1/> · documentation OpenAPI : <http://localhost:8000/api/docs/> · admin : <http://localhost:8000/admin/> · e-mails de test (Mailpit) : <http://localhost:8025/>.
Tests et qualité : `docker compose exec web pytest` et `docker compose exec web ruff check .`
## Documentation ## Documentation
| Document | Contenu | | Document | Contenu |
@@ -49,7 +63,7 @@ Dans la vue Penpot, le sélecteur de parcours (en haut) permet de choisir un flo
## État du projet ## État du projet
- Spécifications et maquettes : en cours de validation. - Spécifications et maquettes : en cours de validation.
- Code : à venir (le dépôt ne contient pour l'instant que la documentation). - Code : back-end initialisé (modèles, raccordement des API WalOnMap et irCELine, API REST). Restent : Bruxelles, radon, Best Address, endpoints d'authentification, front Vue.
- Échéance de la Phase 1 : livraison avant le 31 décembre 2026. - Échéance de la Phase 1 : livraison avant le 31 décembre 2026.
## Licence ## Licence
+6
View File
@@ -0,0 +1,6 @@
.venv
__pycache__
*.pyc
.pytest_cache
.ruff_cache
staticfiles
+24
View File
@@ -0,0 +1,24 @@
FROM python:3.12-slim
COPY --from=ghcr.io/astral-sh/uv:0.9 /uv /usr/local/bin/uv
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_PROJECT_ENVIRONMENT=/opt/venv \
PATH="/opt/venv/bin:$PATH"
WORKDIR /app
ARG UV_SYNC_ARGS="--no-dev"
COPY pyproject.toml uv.lock ./
RUN uv sync --locked $UV_SYNC_ARGS
COPY . .
RUN useradd --system --uid 1000 prism && chown -R prism /app
USER prism
EXPOSE 8000
CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3", "--access-logformat", "%(h)s %(t)s \"%(m)s %(U)s\" %(s)s %(b)s"]
View File
Whitespace-only changes.
+51
View File
@@ -0,0 +1,51 @@
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .models import MailEvent, User
@admin.register(User)
class UserAdmin(BaseUserAdmin):
ordering = ["last_name", "first_name"]
list_display = ["email", "last_name", "first_name", "inami_number", "status", "date_joined"]
list_filter = ["status", "is_staff", "groups"]
search_fields = ["email", "last_name", "first_name", "inami_number"]
readonly_fields = ["date_joined", "last_login", "email_verified_at", "approved_at"]
fieldsets = [
(None, {"fields": ["email", "password"]}),
("Identité", {"fields": ["first_name", "last_name", "inami_number"]}),
(
"Statut",
{
"fields": [
"status",
"email_verified_at",
"approved_at",
"approved_by",
"refusal_reason",
]
},
),
("Droits", {"fields": ["is_staff", "is_superuser", "groups", "user_permissions"]}),
("Dates", {"fields": ["date_joined", "last_login"]}),
]
add_fieldsets = [
(
None,
{
"classes": ["wide"],
"fields": ["email", "first_name", "last_name", "password1", "password2"],
},
),
]
@admin.register(MailEvent)
class MailEventAdmin(admin.ModelAdmin):
list_display = ["sent_at", "type", "status", "user"]
list_filter = ["type", "status"]
search_fields = ["user__email"]
readonly_fields = ["user", "type", "status", "error", "sent_at"]
def has_add_permission(self, request):
return False
+6
View File
@@ -0,0 +1,6 @@
from django.apps import AppConfig
class AccountsConfig(AppConfig):
name = "accounts"
verbose_name = "Comptes"
@@ -0,0 +1,65 @@
# Generated by Django 5.2.19 on 2026-11-24 09:04
import accounts.models
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('email', models.EmailField(max_length=254, unique=True, verbose_name='e-mail')),
('first_name', models.CharField(max_length=150, verbose_name='prénom')),
('last_name', models.CharField(max_length=150, verbose_name='nom')),
('inami_number', models.CharField(blank=True, max_length=20, verbose_name='n° INAMI')),
('status', models.CharField(choices=[('email_pending', 'E-mail en attente'), ('approval_pending', 'Validation en attente'), ('active', 'Actif'), ('refused', 'Refusé'), ('disabled', 'Désactivé')], default='email_pending', max_length=20, verbose_name='statut')),
('email_verified_at', models.DateTimeField(blank=True, null=True, verbose_name='e-mail confirmé le')),
('approved_at', models.DateTimeField(blank=True, null=True, verbose_name='validé le')),
('refusal_reason', models.TextField(blank=True, verbose_name='motif du refus')),
('is_staff', models.BooleanField(default=False, verbose_name="accès à l'administration")),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='inscrit le')),
('approved_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='approved_users', to=settings.AUTH_USER_MODEL, verbose_name='validé par')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'utilisateur',
'verbose_name_plural': 'utilisateurs',
'ordering': ['last_name', 'first_name'],
},
managers=[
('objects', accounts.models.UserManager()),
],
),
migrations.CreateModel(
name='MailEvent',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type', models.CharField(choices=[('confirm_email', "1 – Confirmation de l'adresse"), ('new_request', '2 – Nouvelle demande à valider'), ('account_approved', '3a – Compte activé'), ('account_refused', '3b – Demande refusée'), ('password_reset', '4 – Réinitialisation du mot de passe'), ('password_changed', '5 – Mot de passe modifié'), ('mfa_changed', '6 – Double authentification modifiée'), ('duplicate_signup', "7 – Tentative d'inscription")], max_length=30, verbose_name='type')),
('status', models.CharField(choices=[('sent', 'Envoyé'), ('failed', 'Échec')], max_length=10, verbose_name='statut')),
('error', models.CharField(blank=True, max_length=255, verbose_name='erreur')),
('sent_at', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='mail_events', to=settings.AUTH_USER_MODEL, verbose_name='utilisateur')),
],
options={
'verbose_name': 'e-mail envoyé',
'verbose_name_plural': 'e-mails envoyés',
'ordering': ['-sent_at'],
},
),
]
+22
View File
@@ -0,0 +1,22 @@
from django.db import migrations
ROLES = ["Médecin", "Cellule SSMG", "Admin"]
def create_roles(apps, schema_editor):
Group = apps.get_model("auth", "Group")
for name in ROLES:
Group.objects.get_or_create(name=name)
def delete_roles(apps, schema_editor):
apps.get_model("auth", "Group").objects.filter(name__in=ROLES).delete()
class Migration(migrations.Migration):
dependencies = [
("accounts", "0001_initial"),
("auth", "0012_alter_user_first_name_max_length"),
]
operations = [migrations.RunPython(create_roles, delete_roles)]
Whitespace-only changes.
+125
View File
@@ -0,0 +1,125 @@
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.contrib.auth.models import PermissionsMixin
from django.db import models
from django.utils import timezone
class UserManager(BaseUserManager):
use_in_migrations = True
def _create_user(self, email, password, **extra_fields):
if not email:
raise ValueError("L'adresse e-mail est obligatoire.")
user = self.model(email=self.normalize_email(email).lower(), **extra_fields)
user.set_password(password)
user.save(using=self._db)
return user
def create_user(self, email, password=None, **extra_fields):
extra_fields.setdefault("is_staff", False)
extra_fields.setdefault("is_superuser", False)
return self._create_user(email, password, **extra_fields)
def create_superuser(self, email, password=None, **extra_fields):
extra_fields.setdefault("is_staff", True)
extra_fields.setdefault("is_superuser", True)
extra_fields.setdefault("status", User.Status.ACTIVE)
extra_fields.setdefault("email_verified_at", timezone.now())
extra_fields.setdefault("approved_at", timezone.now())
return self._create_user(email, password, **extra_fields)
class User(AbstractBaseUser, PermissionsMixin):
"""Compte PRISM : l'adresse e-mail sert d'identifiant (specs §4, §8)."""
class Status(models.TextChoices):
EMAIL_PENDING = "email_pending", "E-mail en attente"
APPROVAL_PENDING = "approval_pending", "Validation en attente"
ACTIVE = "active", "Actif"
REFUSED = "refused", "Refusé"
DISABLED = "disabled", "Désactivé"
email = models.EmailField("e-mail", unique=True)
first_name = models.CharField("prénom", max_length=150)
last_name = models.CharField("nom", max_length=150)
inami_number = models.CharField("n° INAMI", max_length=20, blank=True)
status = models.CharField(
"statut", max_length=20, choices=Status.choices, default=Status.EMAIL_PENDING
)
email_verified_at = models.DateTimeField("e-mail confirmé le", null=True, blank=True)
approved_at = models.DateTimeField("validé le", null=True, blank=True)
approved_by = models.ForeignKey(
"self",
verbose_name="validé par",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="approved_users",
)
refusal_reason = models.TextField("motif du refus", blank=True)
is_staff = models.BooleanField("accès à l'administration", default=False)
date_joined = models.DateTimeField("inscrit le", default=timezone.now)
objects = UserManager()
USERNAME_FIELD = "email"
EMAIL_FIELD = "email"
REQUIRED_FIELDS = ["first_name", "last_name"]
class Meta:
verbose_name = "utilisateur"
verbose_name_plural = "utilisateurs"
ordering = ["last_name", "first_name"]
def __str__(self):
return f"{self.get_full_name()} <{self.email}>"
@property
def is_active(self):
# Seul un compte « actif » peut se connecter (specs §8).
return self.status == self.Status.ACTIVE
def get_full_name(self):
return f"{self.first_name} {self.last_name}".strip()
def get_short_name(self):
return self.first_name
class MailEvent(models.Model):
"""Trace d'un e-mail transactionnel (specs §8 bis), sans corps ni lien."""
class Type(models.TextChoices):
CONFIRM_EMAIL = "confirm_email", "1 – Confirmation de l'adresse"
NEW_REQUEST = "new_request", "2 – Nouvelle demande à valider"
ACCOUNT_APPROVED = "account_approved", "3a – Compte activé"
ACCOUNT_REFUSED = "account_refused", "3b – Demande refusée"
PASSWORD_RESET = "password_reset", "4 – Réinitialisation du mot de passe"
PASSWORD_CHANGED = "password_changed", "5 – Mot de passe modifié"
MFA_CHANGED = "mfa_changed", "6 – Double authentification modifiée"
DUPLICATE_SIGNUP = "duplicate_signup", "7 – Tentative d'inscription"
class Status(models.TextChoices):
SENT = "sent", "Envoyé"
FAILED = "failed", "Échec"
user = models.ForeignKey(
User,
verbose_name="utilisateur",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="mail_events",
)
type = models.CharField("type", max_length=30, choices=Type.choices)
status = models.CharField("statut", max_length=10, choices=Status.choices)
error = models.CharField("erreur", max_length=255, blank=True)
sent_at = models.DateTimeField("date", default=timezone.now)
class Meta:
verbose_name = "e-mail envoyé"
verbose_name_plural = "e-mails envoyés"
ordering = ["-sent_at"]
def __str__(self):
return f"{self.get_type_display()} ({self.get_status_display()})"
View File
Whitespace-only changes.
+6
View File
@@ -0,0 +1,6 @@
from django.apps import AppConfig
class AssessmentsConfig(AppConfig):
name = "assessments"
verbose_name = "Évaluations"
@@ -0,0 +1,3 @@
from .base import AddressNotFound, GeocodingError, Location, OutOfCoverage, geocode
__all__ = ["AddressNotFound", "GeocodingError", "Location", "OutOfCoverage", "geocode"]
+83
View File
@@ -0,0 +1,83 @@
"""Géocodage côté serveur.
L'adresse du patient est une donnée de santé : elle n'est ni stockée ni journalisée.
"""
from dataclasses import dataclass
from typing import Protocol
import httpx
from django.conf import settings
@dataclass(frozen=True)
class Location:
lat: float
lon: float
postal_code: str
region: str # "WAL" ou "BXL"
class GeocodingError(Exception):
"""Le service de géocodage n'a pas pu répondre."""
class AddressNotFound(Exception):
pass
class OutOfCoverage(Exception):
"""Adresse trouvée mais hors de Wallonie et de Bruxelles."""
def region_from_postal_code(postal_code: str) -> str | None:
try:
code = int(postal_code)
except (TypeError, ValueError):
return None
if 1000 <= code <= 1299:
return "BXL"
if 1300 <= code <= 1499 or 4000 <= code <= 7999:
return "WAL"
return None
class Geocoder(Protocol):
name: str
async def geocode(self, client: httpx.AsyncClient, address: str) -> Location | None:
"""Renvoie la position, `None` si l'adresse est inconnue, lève `GeocodingError`
si le service est indisponible."""
...
def get_geocoders() -> list[Geocoder]:
from .bestaddress import BestAddressGeocoder
from .nominatim import NominatimGeocoder
conf = settings.PRISM_SOURCES["geocoding"]
geocoders: list[Geocoder] = []
if conf["best_address_url"]:
geocoders.append(BestAddressGeocoder(conf["best_address_url"]))
if conf["nominatim_url"]:
geocoders.append(NominatimGeocoder(conf["nominatim_url"]))
return geocoders
async def geocode(client: httpx.AsyncClient, address: str) -> Location:
"""Essaie les géocodeurs dans l'ordre (Best Address puis Nominatim)."""
unavailable = 0
geocoders = get_geocoders()
for geocoder in geocoders:
try:
location = await geocoder.geocode(client, address)
except GeocodingError:
unavailable += 1
continue
if location is not None:
if location.region not in ("WAL", "BXL"):
raise OutOfCoverage
return location
if geocoders and unavailable == len(geocoders):
raise GeocodingError("Aucun service de géocodage disponible.")
raise AddressNotFound
@@ -0,0 +1,20 @@
import httpx
from .base import Location
class BestAddressGeocoder:
"""Service fédéral BeSt Address.
L'URL publique et le format de réponse restent à confirmer (specs §7 quater, lot 1) :
le service flamand basisregisters.vlaanderen.be ne couvre pas la Wallonie. Tant que
`BEST_ADDRESS_URL` est vide, ce géocodeur n'est pas utilisé.
"""
name = "best_address"
def __init__(self, url: str):
self.url = url
async def geocode(self, client: httpx.AsyncClient, address: str) -> Location | None:
raise NotImplementedError("Format de réponse BeSt Address à confirmer (lot 1).")
@@ -0,0 +1,44 @@
import httpx
from .base import GeocodingError, Location, region_from_postal_code
class NominatimGeocoder:
"""Repli sur Nominatim (OpenStreetMap).
Le serveur public limite l'usage (1 requête/s, pas de charge importante) : à remplacer
par Best Address ou une instance hébergée avant la mise en production.
"""
name = "nominatim"
def __init__(self, url: str):
self.url = url
async def geocode(self, client: httpx.AsyncClient, address: str) -> Location | None:
try:
response = await client.get(
self.url,
params={
"q": address,
"format": "jsonv2",
"addressdetails": 1,
"countrycodes": "be",
"limit": 1,
},
)
response.raise_for_status()
results = response.json()
except (httpx.HTTPError, ValueError) as exc:
raise GeocodingError(type(exc).__name__) from exc
if not results:
return None
result = results[0]
postal_code = result.get("address", {}).get("postcode", "")
return Location(
lat=float(result["lat"]),
lon=float(result["lon"]),
postal_code=postal_code,
region=region_from_postal_code(postal_code) or "",
)
@@ -0,0 +1,4 @@
from .base import FactorProvider, RawResult
from .registry import get_providers
__all__ = ["FactorProvider", "RawResult", "get_providers"]
+89
View File
@@ -0,0 +1,89 @@
import asyncio
import httpx
from django.conf import settings
from ..geocoding import Location
from .base import RawResult, SourceUnavailable
# Valeurs guides annuelles de l'OMS (2021), en µg/m³. Ce sont des normes publiques servant
# à compter les dépassements ; le niveau et la couleur affichés restent définis en base.
# L'OMS ne fixe pas de valeur guide annuelle pour l'ozone (seulement en saison haute) :
# la valeur est affichée sans comparaison, à valider par la SSMG.
POLLUTANTS = [
# (couche irCELine, libellé, valeur guide OMS)
("pm25_anmean_be", "PM2,5", 5.0),
("pm10_anmean_be", "PM10", 15.0),
("no2_anmean_be", "NO2", 10.0),
("o3_anmean_be", "O3", None),
]
# Demi-côté (en degrés) de l'emprise de la requête GetFeatureInfo autour du point.
BBOX_HALF_SIZE = 0.001
class AirProvider:
"""Moyennes annuelles irCELine (modèle RIO 4×4 km), via WMS GetFeatureInfo.
`source_value` est le nombre de valeurs guides OMS dépassées (« 0 », « 1 »…).
"""
code = "air"
async def fetch(self, client: httpx.AsyncClient, location: Location) -> RawResult:
url = settings.PRISM_SOURCES["air"]["wms_url"]
values = await asyncio.gather(
*(_annual_mean(client, url, layer, location) for layer, _, _ in POLLUTANTS)
)
if all(value is None for value in values):
return RawResult(self.code, "no_data")
exceedances = 0
details = []
for (_, label, guideline), value in zip(POLLUTANTS, values, strict=True):
if value is None:
details.append({"label": label, "value": "donnée absente"})
continue
text = f"{value:.1f} µg/m³".replace(".", ",")
if guideline is not None:
exceeded = value > guideline
exceedances += exceeded
text += f" (valeur guide OMS {guideline:g} : {'dépassée' if exceeded else 'ok'})"
details.append({"label": label, "value": text})
summary = f"{exceedances} dépassement{'s' if exceedances > 1 else ''} des valeurs OMS"
return RawResult(self.code, "ok", str(exceedances), summary, details)
async def _annual_mean(
client: httpx.AsyncClient, url: str, layer: str, location: Location
) -> float | None:
d = BBOX_HALF_SIZE
response = await client.get(
url,
params={
"SERVICE": "WMS",
"VERSION": "1.3.0",
"REQUEST": "GetFeatureInfo",
"LAYERS": layer,
"QUERY_LAYERS": layer,
"STYLES": "",
"CRS": "EPSG:4326",
# WMS 1.3.0 en EPSG:4326 : ordre lat, lon.
"BBOX": f"{location.lat - d},{location.lon - d},{location.lat + d},{location.lon + d}",
"WIDTH": 3,
"HEIGHT": 3,
"I": 1,
"J": 1,
"INFO_FORMAT": "application/json",
},
)
response.raise_for_status()
try:
features = response.json()["features"]
except (ValueError, KeyError) as exc:
# irCELine renvoie ses exceptions WMS en XML avec un code HTTP 200.
raise SourceUnavailable(f"irCELine : réponse inattendue pour {layer}") from exc
if not features:
return None
return float(features[0]["properties"]["value"])
+58
View File
@@ -0,0 +1,58 @@
"""Interface commune des modules de facteur (specs §4 bis).
Un module interroge une source externe et renvoie un `RawResult`. Le service d'évaluation
convertit ensuite `source_value` en niveau et en couleur grâce aux classes de seuil en base.
"""
from dataclasses import dataclass, field
from typing import Literal, Protocol
import httpx
from ..geocoding import Location
Status = Literal["ok", "no_data", "unavailable"]
@dataclass
class RawResult:
code: str
status: Status
# Valeur comparée à `ThresholdClass.source_value` (ex. « 65-69 », « Aléa élevé »).
source_value: str | None = None
summary: str = ""
details: list[dict[str, str]] = field(default_factory=list)
class SourceUnavailable(Exception):
"""La source n'est pas joignable ou ne couvre pas la région demandée."""
class FactorProvider(Protocol):
code: str
async def fetch(self, client: httpx.AsyncClient, location: Location) -> RawResult: ...
async def arcgis_point_query(
client: httpx.AsyncClient, layer_url: str, location: Location, out_fields: list[str]
) -> list[dict]:
"""Interroge une couche ArcGIS REST (WalOnMap) en un point ; renvoie les attributs."""
response = await client.get(
f"{layer_url}/query",
params={
"geometry": f"{location.lon},{location.lat}",
"geometryType": "esriGeometryPoint",
"inSR": 4326,
"spatialRel": "esriSpatialRelIntersects",
"outFields": ",".join(out_fields),
"returnGeometry": "false",
"f": "json",
},
)
response.raise_for_status()
data = response.json()
# ArcGIS renvoie ses erreurs avec un code HTTP 200.
if "error" in data:
raise SourceUnavailable(f"ArcGIS : {data['error'].get('code')}")
return [feature["attributes"] for feature in data.get("features", [])]
+39
View File
@@ -0,0 +1,39 @@
import httpx
from django.conf import settings
from ..geocoding import Location
from .base import RawResult, SourceUnavailable, arcgis_point_query
class FloodProvider:
"""Aléa d'inondation par débordement et ruissellement (WalOnMap).
`source_value` est l'aléa le plus élevé au point (« Aléa faible », « Aléa moyen »,
« Aléa élevé ») ou « aucun ».
"""
code = "flood"
async def fetch(self, client: httpx.AsyncClient, location: Location) -> RawResult:
layers = settings.PRISM_SOURCES["flood"].get(location.region)
if not layers:
raise SourceUnavailable(f"Pas de source inondation pour {location.region}")
hazards = await arcgis_point_query(
client, layers["hazard"], location, ["VALEUR", "CODEALEA", "TYPEALEA"]
)
if not hazards:
return RawResult(
self.code,
"ok",
"aucun",
"Hors zone d'aléa",
[{"label": "Aléa", "value": "hors zone d'aléa cartographiée"}],
)
highest = max(hazards, key=lambda h: h["CODEALEA"])
details = [
{"label": h["TYPEALEA"] or "Aléa", "value": h["VALEUR"]}
for h in sorted(hazards, key=lambda h: -h["CODEALEA"])
]
return RawResult(self.code, "ok", highest["VALEUR"], highest["VALEUR"], details)
+62
View File
@@ -0,0 +1,62 @@
import asyncio
import httpx
from django.conf import settings
from ..geocoding import Location
from .base import RawResult, SourceUnavailable, arcgis_point_query
NO_EXPOSURE = "aucune exposition détectée"
class NoiseProvider:
"""Bruit routier, ferroviaire (Lden) et aéroportuaire (WalOnMap).
`source_value` est la classe de bruit la plus élevée entre route et rail, au format
« DB_LOW-DB_HIGHT » (ex. « 65-69 »), ou « aucune ». Le zonage aéroportuaire (PEB) est
renvoyé en détail ; sa prise en compte dans le niveau reste à valider par la SSMG.
"""
code = "noise"
async def fetch(self, client: httpx.AsyncClient, location: Location) -> RawResult:
layers = settings.PRISM_SOURCES["noise"].get(location.region)
if not layers:
raise SourceUnavailable(f"Pas de source bruit pour {location.region}")
db_fields = ["DB_LOW", "DB_HIGHT", "CLASSE"]
road, rail, airport = await asyncio.gather(
arcgis_point_query(client, layers["road"], location, db_fields),
arcgis_point_query(client, layers["rail"], location, db_fields),
arcgis_point_query(client, layers["airport"], location, ["ZONAGE", "NOM_AEROPORT"]),
)
road_max, rail_max = _loudest(road), _loudest(rail)
details = [
{"label": "Route", "value": _describe(road_max)},
{"label": "Rail", "value": _describe(rail_max)},
{
"label": "Aéroport",
"value": ", ".join(f"{a['NOM_AEROPORT']} – {a['ZONAGE']}" for a in airport)
or NO_EXPOSURE,
},
]
loudest = _loudest([c for c in (road_max, rail_max) if c])
if loudest is None:
return RawResult(self.code, "ok", "aucune", NO_EXPOSURE, details)
return RawResult(
self.code,
"ok",
f"{loudest['DB_LOW']}-{loudest['DB_HIGHT']}",
f"Lden {loudest['CLASSE']} dB(A)",
details,
)
def _loudest(classes: list[dict]) -> dict | None:
return max(classes, key=lambda c: c["DB_LOW"], default=None)
def _describe(noise_class: dict | None) -> str:
return f"{noise_class['CLASSE']} dB(A)" if noise_class else NO_EXPOSURE
+17
View File
@@ -0,0 +1,17 @@
import httpx
from ..geocoding import Location
from .base import RawResult, SourceUnavailable
class RadonProvider:
"""Exposition au radon (AFCN).
Aucune API ni couche radon n'a été trouvée (specs §7 quater) : le module signale la
source indisponible en attendant le jeu de données de l'AFCN.
"""
code = "radon"
async def fetch(self, client: httpx.AsyncClient, location: Location) -> RawResult:
raise SourceUnavailable("Source radon (AFCN) non encore raccordée")
+18
View File
@@ -0,0 +1,18 @@
from .air import AirProvider
from .base import FactorProvider
from .flood import FloodProvider
from .noise import NoiseProvider
from .radon import RadonProvider
# Ajouter un facteur : écrire un module, l'inscrire ici, puis saisir ses classes de seuil
# et ses contenus dans Django admin.
PROVIDERS: list[FactorProvider] = [
NoiseProvider(),
AirProvider(),
FloodProvider(),
RadonProvider(),
]
def get_providers() -> dict[str, FactorProvider]:
return {provider.code: provider for provider in PROVIDERS}
+73
View File
@@ -0,0 +1,73 @@
from rest_framework import serializers
class AssessmentRequestSerializer(serializers.Serializer):
address = serializers.CharField(max_length=300, trim_whitespace=True)
# Sérialiseurs de réponse : servent à la documentation OpenAPI.
class LocationSerializer(serializers.Serializer):
lat = serializers.FloatField()
lon = serializers.FloatField()
region = serializers.ChoiceField(choices=["WAL", "BXL"])
class DetailSerializer(serializers.Serializer):
label = serializers.CharField()
value = serializers.CharField()
class ScaleItemSerializer(serializers.Serializer):
level = serializers.IntegerField()
color = serializers.CharField()
label = serializers.CharField()
class LegendSerializer(serializers.Serializer):
source = serializers.CharField()
text = serializers.CharField()
scale = ScaleItemSerializer(many=True)
class TabsSerializer(serializers.Serializer):
health_effects = serializers.CharField()
actions = serializers.CharField()
legend = LegendSerializer()
class ReferenceSerializer(serializers.Serializer):
n = serializers.IntegerField()
title = serializers.CharField()
url = serializers.CharField()
class FactorResultSerializer(serializers.Serializer):
code = serializers.CharField()
label = serializers.CharField()
status = serializers.ChoiceField(choices=["ok", "no_data", "unavailable"])
level = serializers.IntegerField(allow_null=True)
color = serializers.CharField(allow_null=True)
summary = serializers.CharField()
details = DetailSerializer(many=True)
tabs = TabsSerializer()
references = ReferenceSerializer(many=True)
class AssessmentResponseSerializer(serializers.Serializer):
location = LocationSerializer()
factors = FactorResultSerializer(many=True)
class ErrorSerializer(serializers.Serializer):
code = serializers.ChoiceField(
choices=["address_not_found", "out_of_coverage", "geocoding_unavailable"]
)
detail = serializers.CharField()
class FactorSerializer(serializers.Serializer):
code = serializers.CharField()
label = serializers.CharField()
legends = serializers.DictField(child=LegendSerializer())
+130
View File
@@ -0,0 +1,130 @@
"""Service d'évaluation : géocodage, appel des modules en parallèle, application des seuils.
Ni l'adresse ni les coordonnées ne sont conservées ou journalisées.
"""
import asyncio
import logging
import httpx
from asgiref.sync import async_to_sync
from django.conf import settings
from factors.models import ContentBlock, DataSource, Factor, Region, ThresholdClass
from .geocoding import Location, geocode
from .providers import RawResult, get_providers
logger = logging.getLogger(__name__)
def http_client() -> httpx.AsyncClient:
return httpx.AsyncClient(
timeout=settings.PRISM_HTTP_TIMEOUT,
headers={"User-Agent": settings.PRISM_USER_AGENT},
follow_redirects=True,
)
async def _fetch(provider, client: httpx.AsyncClient, location: Location) -> RawResult:
try:
return await provider.fetch(client, location)
except Exception as exc:
# Seuls le code du facteur et le type d'erreur sont journalisés : les messages
# d'httpx contiennent l'URL, donc les coordonnées.
logger.warning("Facteur %s indisponible (%s)", provider.code, type(exc).__name__)
return RawResult(provider.code, "unavailable")
async def collect(address: str, codes: list[str]) -> tuple[Location, list[RawResult]]:
providers = get_providers()
async with http_client() as client:
location = await geocode(client, address)
results = await asyncio.gather(
*(
_fetch(providers[code], client, location)
if code in providers
else _missing_provider(code)
for code in codes
)
)
return location, list(results)
async def _missing_provider(code: str) -> RawResult:
return RawResult(code, "unavailable")
def assess(address: str) -> dict:
"""Évalue une adresse ; lève les exceptions de `geocoding` en cas d'échec global."""
factors = list(Factor.objects.filter(active=True))
location, results = async_to_sync(collect)(address, [f.code for f in factors])
by_code = {result.code: result for result in results}
return {
"location": {"lat": location.lat, "lon": location.lon, "region": location.region},
"factors": [build_factor_result(f, by_code[f.code], location.region) for f in factors],
}
def build_factor_result(factor: Factor, raw: RawResult, region: str) -> dict:
threshold = None
if raw.status == "ok" and raw.source_value is not None:
threshold = find_threshold(factor, region, raw.source_value)
content = validated_content(factor, threshold)
return {
"code": factor.code,
"label": factor.label,
"status": raw.status,
"level": threshold.level if threshold else None,
"color": threshold.color if threshold else None,
"summary": (threshold.label if threshold and threshold.label else raw.summary),
"details": raw.details,
"tabs": {
"health_effects": content.health_effects if content else "",
"actions": content.actions if content else "",
"legend": legend(factor, region, content),
},
"references": references(content),
}
def find_threshold(factor: Factor, region: str, source_value: str) -> ThresholdClass | None:
"""Classe de la région, sinon classe nationale (ex. qualité de l'air)."""
candidates = {
c.region: c
for c in ThresholdClass.objects.filter(
factor=factor, region__in=[region, Region.BELGIUM], source_value=source_value
)
}
return candidates.get(region) or candidates.get(Region.BELGIUM)
def validated_content(factor: Factor, threshold: ThresholdClass | None) -> ContentBlock | None:
contents = ContentBlock.objects.filter(factor=factor, status=ContentBlock.Status.VALIDATED)
if threshold is not None:
specific = contents.filter(threshold_class=threshold).first()
if specific:
return specific
return contents.filter(threshold_class__isnull=True).first()
def legend(factor: Factor, region: str, content: ContentBlock | None = None) -> dict:
regions = [region, Region.BELGIUM]
sources = DataSource.objects.filter(factor=factor, region__in=regions)
scale = ThresholdClass.objects.filter(factor=factor, region__in=regions).order_by("level")
return {
"source": ", ".join(sorted({s.provider for s in sources})),
"text": content.legend_text if content else "",
"scale": [
{"level": c.level, "color": c.color, "label": c.label or c.source_value} for c in scale
],
}
def references(content: ContentBlock | None) -> list[dict]:
if content is None:
return []
return [
{"n": cited.order, "title": cited.reference.title, "url": cited.reference.url}
for cited in content.contentreference_set.select_related("reference")
]
+8
View File
@@ -0,0 +1,8 @@
from django.urls import path
from .views import AssessmentView, FactorListView
urlpatterns = [
path("assessments/", AssessmentView.as_view(), name="assessments"),
path("factors/", FactorListView.as_view(), name="factors"),
]
+73
View File
@@ -0,0 +1,73 @@
from drf_spectacular.utils import OpenApiResponse, extend_schema
from rest_framework import status
from rest_framework.response import Response
from rest_framework.throttling import ScopedRateThrottle
from rest_framework.views import APIView
from factors.models import Factor, Region
from . import services
from .geocoding import AddressNotFound, GeocodingError, OutOfCoverage
from .serializers import (
AssessmentRequestSerializer,
AssessmentResponseSerializer,
ErrorSerializer,
FactorSerializer,
)
GEOCODING_ERRORS = {
AddressNotFound: (status.HTTP_404_NOT_FOUND, "address_not_found", "Adresse introuvable."),
OutOfCoverage: (
status.HTTP_422_UNPROCESSABLE_ENTITY,
"out_of_coverage",
"Adresse hors de Wallonie et de Bruxelles.",
),
GeocodingError: (
status.HTTP_503_SERVICE_UNAVAILABLE,
"geocoding_unavailable",
"Le service de géocodage est indisponible.",
),
}
class AssessmentView(APIView):
throttle_classes = [ScopedRateThrottle]
throttle_scope = "assessments"
@extend_schema(
request=AssessmentRequestSerializer,
responses={
200: AssessmentResponseSerializer,
404: OpenApiResponse(ErrorSerializer, description="Adresse introuvable"),
422: OpenApiResponse(ErrorSerializer, description="Hors couverture"),
503: OpenApiResponse(ErrorSerializer, description="Géocodage indisponible"),
},
summary="Évaluer une adresse",
)
def post(self, request):
serializer = AssessmentRequestSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
try:
result = services.assess(serializer.validated_data["address"])
except tuple(GEOCODING_ERRORS) as exc:
http_status, code, detail = GEOCODING_ERRORS[type(exc)]
return Response({"code": code, "detail": detail}, status=http_status)
return Response(result)
class FactorListView(APIView):
@extend_schema(responses=FactorSerializer(many=True), summary="Facteurs actifs et légendes")
def get(self, request):
return Response(
[
{
"code": factor.code,
"label": factor.label,
"legends": {
region: services.legend(factor, region)
for region in (Region.WALLONIA, Region.BRUSSELS)
},
}
for factor in Factor.objects.filter(active=True)
]
)
View File
Whitespace-only changes.
+195
View File
@@ -0,0 +1,195 @@
"""Configuration Django de PRISM.
Toute la configuration passe par des variables d'environnement (voir `.env.example`).
"""
from pathlib import Path
import environ
BASE_DIR = Path(__file__).resolve().parent.parent
env = environ.Env(
DEBUG=(bool, False),
ALLOWED_HOSTS=(list, []),
CSRF_TRUSTED_ORIGINS=(list, []),
)
environ.Env.read_env(BASE_DIR.parent / ".env", overwrite=False)
SECRET_KEY = env("SECRET_KEY")
DEBUG = env("DEBUG")
ALLOWED_HOSTS = env("ALLOWED_HOSTS")
CSRF_TRUSTED_ORIGINS = env("CSRF_TRUSTED_ORIGINS")
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
"drf_spectacular",
"django_otp",
"django_otp.plugins.otp_totp",
"django_otp.plugins.otp_static",
"simple_history",
"accounts",
"factors",
"assessments",
]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django_otp.middleware.OTPMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"simple_history.middleware.HistoryRequestMiddleware",
]
ROOT_URLCONF = "config.urls"
WSGI_APPLICATION = "config.wsgi.application"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
]
DATABASES = {"default": env.db("DATABASE_URL")}
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
# Authentification -----------------------------------------------------------
AUTH_USER_MODEL = "accounts.User"
PASSWORD_HASHERS = [
"django.contrib.auth.hashers.Argon2PasswordHasher",
"django.contrib.auth.hashers.PBKDF2PasswordHasher",
]
AUTH_PASSWORD_VALIDATORS = [
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
"OPTIONS": {"min_length": 12},
},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
]
SESSION_COOKIE_AGE = env.int("SESSION_COOKIE_AGE", default=30 * 60)
SESSION_SAVE_EVERY_REQUEST = True
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SAMESITE = "Lax"
CSRF_COOKIE_SAMESITE = "Lax"
SESSION_COOKIE_SECURE = not DEBUG
CSRF_COOKIE_SECURE = not DEBUG
# Internationalisation -------------------------------------------------------
LANGUAGE_CODE = "fr-be"
TIME_ZONE = "Europe/Brussels"
USE_I18N = True
USE_TZ = True
STATIC_URL = "static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
# E-mails --------------------------------------------------------------------
EMAIL_CONFIG = env.email("EMAIL_URL", default="consolemail://")
vars().update(EMAIL_CONFIG)
DEFAULT_FROM_EMAIL = env("DEFAULT_FROM_EMAIL", default="no-reply@prism.localhost")
# API ------------------------------------------------------------------------
REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": [
"rest_framework.authentication.SessionAuthentication",
],
"DEFAULT_PERMISSION_CLASSES": [
"rest_framework.permissions.IsAuthenticated",
],
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
"DEFAULT_THROTTLE_RATES": {
"assessments": env("THROTTLE_ASSESSMENTS", default="60/hour"),
},
}
SPECTACULAR_SETTINGS = {
"TITLE": "PRISM API",
"DESCRIPTION": "Évaluation de l'exposome extérieur à partir d'une adresse.",
"VERSION": "1.0.0",
"SERVE_INCLUDE_SCHEMA": False,
}
# Journalisation : aucune adresse ni coordonnée ne doit apparaître dans les journaux.
# Les modules d'évaluation ne journalisent que des codes de facteur et des types d'erreur.
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {"console": {"class": "logging.StreamHandler"}},
"root": {"handlers": ["console"], "level": "INFO"},
"loggers": {
# httpx journalise les URL complètes (qui contiennent l'adresse ou les coordonnées).
"httpx": {"level": "WARNING"},
"httpcore": {"level": "WARNING"},
},
}
# Sources externes -----------------------------------------------------------
WALONMAP_REST = "https://geoservices.wallonie.be/arcgis/rest/services"
PRISM_HTTP_TIMEOUT = env.float("PRISM_HTTP_TIMEOUT", default=5.0)
PRISM_USER_AGENT = env("PRISM_USER_AGENT", default="PRISM/0.1 (SSMG, Champs Libres)")
PRISM_SOURCES = {
"geocoding": {
# Service fédéral BeSt Address : URL à confirmer au lot 1 ; vide = désactivé.
"best_address_url": env("BEST_ADDRESS_URL", default=""),
"nominatim_url": env("NOMINATIM_URL", default="https://nominatim.openstreetmap.org/search"),
},
"noise": {
"WAL": {
# Couche 1 = Lden, champs DB_LOW / DB_HIGHT / CLASSE.
"road": env(
"WAL_NOISE_ROAD_URL",
default=f"{WALONMAP_REST}/INDUSTRIES_SERVICES/BRUIT_MROAD_2017/MapServer/1",
),
"rail": env(
"WAL_NOISE_RAIL_URL",
default=f"{WALONMAP_REST}/INDUSTRIES_SERVICES/BRUIT_MRAIL_2017/MapServer/1",
),
# Plan d'exposition au bruit (PEB), champs ZONAGE / NOM_AEROPORT.
"airport": env(
"WAL_NOISE_AIRPORT_URL",
default=f"{WALONMAP_REST}/INDUSTRIES_SERVICES/BRUIT_AEROPORTS/MapServer/1",
),
},
},
"air": {
"wms_url": env("IRCELINE_WMS_URL", default="https://geo.irceline.be/rio/wms"),
},
"flood": {
"WAL": {
# Aléa d'inondation 1:25 000 – 1:5 000, champs VALEUR / CODEALEA.
"hazard": env("WAL_FLOOD_URL", default=f"{WALONMAP_REST}/EAU/ALEA_INOND/MapServer/2"),
},
},
}
+10
View File
@@ -0,0 +1,10 @@
from django.contrib import admin
from django.urls import include, path
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
urlpatterns = [
path("admin/", admin.site.urls),
path("api/v1/", include("assessments.urls")),
path("api/schema/", SpectacularAPIView.as_view(), name="schema"),
path("api/docs/", SpectacularSwaggerView.as_view(url_name="schema"), name="api-docs"),
]
+7
View File
@@ -0,0 +1,7 @@
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
application = get_wsgi_application()
View File
Whitespace-only changes.
+63
View File
@@ -0,0 +1,63 @@
from django.contrib import admin
from django.utils import timezone
from simple_history.admin import SimpleHistoryAdmin
from .models import ContentBlock, ContentReference, DataSource, Factor, Reference, ThresholdClass
class DataSourceInline(admin.TabularInline):
model = DataSource
extra = 0
class ThresholdClassInline(admin.TabularInline):
model = ThresholdClass
extra = 0
@admin.register(Factor)
class FactorAdmin(admin.ModelAdmin):
list_display = ["label", "code", "active", "order"]
list_editable = ["active", "order"]
inlines = [DataSourceInline, ThresholdClassInline]
@admin.register(DataSource)
class DataSourceAdmin(admin.ModelAdmin):
list_display = ["factor", "provider", "region", "access", "last_update"]
list_filter = ["factor", "region", "access"]
@admin.register(ThresholdClass)
class ThresholdClassAdmin(SimpleHistoryAdmin):
list_display = ["factor", "region", "source_value", "label", "level", "color"]
list_filter = ["factor", "region", "level"]
@admin.register(Reference)
class ReferenceAdmin(admin.ModelAdmin):
search_fields = ["title", "url"]
class ContentReferenceInline(admin.TabularInline):
model = ContentReference
extra = 0
autocomplete_fields = ["reference"]
@admin.register(ContentBlock)
class ContentBlockAdmin(SimpleHistoryAdmin):
list_display = ["__str__", "factor", "threshold_class", "status", "validated_at"]
list_filter = ["factor", "status"]
readonly_fields = ["validated_at", "validated_by"]
inlines = [ContentReferenceInline]
actions = ["mark_validated"]
@admin.action(description="Marquer comme validé")
def mark_validated(self, request, queryset):
# Une sauvegarde par contenu pour que l'historique enregistre la validation.
for content in queryset:
content.status = ContentBlock.Status.VALIDATED
content.validated_at = timezone.now()
content.validated_by = request.user
content.save()
+6
View File
@@ -0,0 +1,6 @@
from django.apps import AppConfig
class FactorsConfig(AppConfig):
name = "factors"
verbose_name = "Facteurs de stress environnementaux"
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,48 @@
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import transaction
from factors.models import DataSource, Factor
FACTORS = [
("noise", "Pollution sonore", 1),
("air", "Qualité de l'air", 2),
("flood", "Risque d'inondation", 3),
("radon", "Radon", 4),
]
def data_sources():
sources = settings.PRISM_SOURCES
return [
("noise", "WalOnMap", "WAL", "api", sources["noise"]["WAL"]["road"]),
("noise", "Bruxelles Environnement", "BXL", "api", ""),
("air", "irCELine", "BE", "wms", sources["air"]["wms_url"]),
("flood", "WalOnMap", "WAL", "api", sources["flood"]["WAL"]["hazard"]),
("flood", "Bruxelles Environnement", "BXL", "api", ""),
("radon", "AFCN", "BE", "import", ""),
]
class Command(BaseCommand):
help = (
"Crée les 4 facteurs et leurs sources de données. Idempotent. Les classes de seuil "
"et les contenus médicaux sont saisis par la cellule SSMG dans l'admin."
)
@transaction.atomic
def handle(self, *args, **options):
factors = {}
for code, label, order in FACTORS:
factors[code], created = Factor.objects.get_or_create(
code=code, defaults={"label": label, "order": order}
)
self.stdout.write(f"{'+' if created else '='} facteur {code}")
for code, provider, region, access, url in data_sources():
_, created = DataSource.objects.get_or_create(
factor=factors[code],
provider=provider,
region=region,
defaults={"access": access, "url": url},
)
self.stdout.write(f"{'+' if created else '='} source {code} {provider} ({region})")
+182
View File
@@ -0,0 +1,182 @@
# Generated by Django 5.2.19 on 2026-11-24 09:04
import django.core.validators
import django.db.models.deletion
import simple_history.models
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Factor',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(max_length=20, unique=True, verbose_name='code')),
('label', models.CharField(max_length=100, verbose_name='libellé')),
('active', models.BooleanField(default=True, verbose_name='actif')),
('order', models.PositiveSmallIntegerField(default=0, verbose_name="ordre d'affichage")),
],
options={
'verbose_name': 'facteur',
'verbose_name_plural': 'facteurs',
'ordering': ['order', 'code'],
},
),
migrations.CreateModel(
name='Reference',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=500, verbose_name='titre')),
('url', models.URLField(blank=True, max_length=500, verbose_name='URL')),
],
options={
'verbose_name': 'référence',
'verbose_name_plural': 'références',
'ordering': ['title'],
},
),
migrations.CreateModel(
name='ContentBlock',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('health_effects', models.TextField(blank=True, verbose_name='effets sur la santé')),
('actions', models.TextField(blank=True, verbose_name="pistes d'action")),
('legend_text', models.TextField(blank=True, verbose_name='légende')),
('status', models.CharField(choices=[('draft', 'Brouillon'), ('validated', 'Validé')], default='draft', max_length=10, verbose_name='statut')),
('validated_at', models.DateTimeField(blank=True, null=True, verbose_name='validé le')),
('validated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='validated_contents', to=settings.AUTH_USER_MODEL, verbose_name='validé par')),
('factor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contents', to='factors.factor', verbose_name='facteur')),
],
options={
'verbose_name': 'contenu',
'verbose_name_plural': 'contenus',
'ordering': ['factor', 'threshold_class__level'],
},
),
migrations.CreateModel(
name='HistoricalThresholdClass',
fields=[
('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('region', models.CharField(choices=[('WAL', 'Wallonie'), ('BXL', 'Bruxelles'), ('BE', 'Belgique')], max_length=3, verbose_name='région')),
('source_value', models.CharField(help_text='Valeur renvoyée par le module du facteur, ex. « 65-69 » ou « Aléa élevé ».', max_length=100, verbose_name='valeur source')),
('label', models.CharField(blank=True, max_length=100, verbose_name='libellé affiché')),
('level', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(4)], verbose_name='niveau')),
('color', models.CharField(choices=[('green', 'Vert'), ('yellow', 'Jaune'), ('orange', 'Orange'), ('red', 'Rouge')], max_length=10, verbose_name='couleur')),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField(db_index=True)),
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('factor', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='factors.factor', verbose_name='facteur')),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'historical classe de seuil',
'verbose_name_plural': 'historical classes de seuil',
'ordering': ('-history_date', '-history_id'),
'get_latest_by': ('history_date', 'history_id'),
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.CreateModel(
name='ContentReference',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('order', models.PositiveSmallIntegerField(verbose_name='n° de note')),
('content', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='factors.contentblock')),
('reference', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='factors.reference', verbose_name='référence')),
],
options={
'verbose_name': 'référence citée',
'verbose_name_plural': 'références citées',
'ordering': ['order'],
},
),
migrations.AddField(
model_name='contentblock',
name='references',
field=models.ManyToManyField(blank=True, through='factors.ContentReference', to='factors.reference', verbose_name='références'),
),
migrations.CreateModel(
name='ThresholdClass',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('region', models.CharField(choices=[('WAL', 'Wallonie'), ('BXL', 'Bruxelles'), ('BE', 'Belgique')], max_length=3, verbose_name='région')),
('source_value', models.CharField(help_text='Valeur renvoyée par le module du facteur, ex. « 65-69 » ou « Aléa élevé ».', max_length=100, verbose_name='valeur source')),
('label', models.CharField(blank=True, max_length=100, verbose_name='libellé affiché')),
('level', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(4)], verbose_name='niveau')),
('color', models.CharField(choices=[('green', 'Vert'), ('yellow', 'Jaune'), ('orange', 'Orange'), ('red', 'Rouge')], max_length=10, verbose_name='couleur')),
('factor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='classes', to='factors.factor', verbose_name='facteur')),
],
options={
'verbose_name': 'classe de seuil',
'verbose_name_plural': 'classes de seuil',
'ordering': ['factor', 'region', 'level'],
},
),
migrations.CreateModel(
name='HistoricalContentBlock',
fields=[
('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('health_effects', models.TextField(blank=True, verbose_name='effets sur la santé')),
('actions', models.TextField(blank=True, verbose_name="pistes d'action")),
('legend_text', models.TextField(blank=True, verbose_name='légende')),
('status', models.CharField(choices=[('draft', 'Brouillon'), ('validated', 'Validé')], default='draft', max_length=10, verbose_name='statut')),
('validated_at', models.DateTimeField(blank=True, null=True, verbose_name='validé le')),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField(db_index=True)),
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('factor', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='factors.factor', verbose_name='facteur')),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('validated_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='validé par')),
('threshold_class', models.ForeignKey(blank=True, db_constraint=False, help_text='Vide : contenu commun à toutes les classes du facteur.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='factors.thresholdclass', verbose_name='classe de seuil')),
],
options={
'verbose_name': 'historical contenu',
'verbose_name_plural': 'historical contenus',
'ordering': ('-history_date', '-history_id'),
'get_latest_by': ('history_date', 'history_id'),
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.AddField(
model_name='contentblock',
name='threshold_class',
field=models.ForeignKey(blank=True, help_text='Vide : contenu commun à toutes les classes du facteur.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='contents', to='factors.thresholdclass', verbose_name='classe de seuil'),
),
migrations.CreateModel(
name='DataSource',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('provider', models.CharField(max_length=50, verbose_name='fournisseur')),
('region', models.CharField(choices=[('WAL', 'Wallonie'), ('BXL', 'Bruxelles'), ('BE', 'Belgique')], max_length=3, verbose_name='région')),
('access', models.CharField(choices=[('api', 'API'), ('wms', 'WMS / WFS'), ('import', 'Jeu de données importé')], max_length=10, verbose_name="mode d'accès")),
('url', models.URLField(blank=True, max_length=500, verbose_name='URL')),
('last_update', models.DateField(blank=True, null=True, verbose_name='dernière mise à jour')),
('factor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sources', to='factors.factor', verbose_name='facteur')),
],
options={
'verbose_name': 'source de données',
'verbose_name_plural': 'sources de données',
'ordering': ['factor', 'region', 'provider'],
'constraints': [models.UniqueConstraint(fields=('factor', 'provider', 'region'), name='unique_source_per_region')],
},
),
migrations.AddConstraint(
model_name='contentreference',
constraint=models.UniqueConstraint(fields=('content', 'order'), name='unique_note_number'),
),
migrations.AddConstraint(
model_name='thresholdclass',
constraint=models.UniqueConstraint(fields=('factor', 'region', 'source_value'), name='unique_threshold_value'),
),
]
Whitespace-only changes.
+186
View File
@@ -0,0 +1,186 @@
"""Facteurs, seuils et contenus éditoriaux (specs §4).
Seuils, couleurs et textes sont en base et édités par la cellule SSMG dans Django admin :
ils ne doivent jamais être écrits dans le code.
"""
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from simple_history.models import HistoricalRecords
class Region(models.TextChoices):
WALLONIA = "WAL", "Wallonie"
BRUSSELS = "BXL", "Bruxelles"
BELGIUM = "BE", "Belgique"
class Factor(models.Model):
class Code(models.TextChoices):
NOISE = "noise", "Pollution sonore"
AIR = "air", "Qualité de l'air"
FLOOD = "flood", "Risque d'inondation"
RADON = "radon", "Radon"
code = models.CharField("code", max_length=20, unique=True)
label = models.CharField("libellé", max_length=100)
active = models.BooleanField("actif", default=True)
order = models.PositiveSmallIntegerField("ordre d'affichage", default=0)
class Meta:
verbose_name = "facteur"
verbose_name_plural = "facteurs"
ordering = ["order", "code"]
def __str__(self):
return self.label
class DataSource(models.Model):
class Access(models.TextChoices):
API = "api", "API"
WMS = "wms", "WMS / WFS"
IMPORT = "import", "Jeu de données importé"
factor = models.ForeignKey(
Factor, verbose_name="facteur", on_delete=models.CASCADE, related_name="sources"
)
provider = models.CharField("fournisseur", max_length=50)
region = models.CharField("région", max_length=3, choices=Region.choices)
access = models.CharField("mode d'accès", max_length=10, choices=Access.choices)
url = models.URLField("URL", max_length=500, blank=True)
last_update = models.DateField("dernière mise à jour", null=True, blank=True)
class Meta:
verbose_name = "source de données"
verbose_name_plural = "sources de données"
ordering = ["factor", "region", "provider"]
constraints = [
models.UniqueConstraint(
fields=["factor", "provider", "region"], name="unique_source_per_region"
),
]
def __str__(self):
return f"{self.factor} – {self.provider} ({self.region})"
class ThresholdClass(models.Model):
"""Associe une valeur renvoyée par la source à un niveau commun de 1 à 4."""
class Color(models.TextChoices):
GREEN = "green", "Vert"
YELLOW = "yellow", "Jaune"
ORANGE = "orange", "Orange"
RED = "red", "Rouge"
factor = models.ForeignKey(
Factor, verbose_name="facteur", on_delete=models.CASCADE, related_name="classes"
)
region = models.CharField("région", max_length=3, choices=Region.choices)
source_value = models.CharField(
"valeur source",
max_length=100,
help_text="Valeur renvoyée par le module du facteur, ex. « 65-69 » ou « Aléa élevé ».",
)
label = models.CharField("libellé affiché", max_length=100, blank=True)
level = models.PositiveSmallIntegerField(
"niveau", validators=[MinValueValidator(1), MaxValueValidator(4)]
)
color = models.CharField("couleur", max_length=10, choices=Color.choices)
history = HistoricalRecords()
class Meta:
verbose_name = "classe de seuil"
verbose_name_plural = "classes de seuil"
ordering = ["factor", "region", "level"]
constraints = [
models.UniqueConstraint(
fields=["factor", "region", "source_value"], name="unique_threshold_value"
),
]
def __str__(self):
return f"{self.factor} {self.region} « {self.source_value} » → {self.level}"
class Reference(models.Model):
title = models.CharField("titre", max_length=500)
url = models.URLField("URL", max_length=500, blank=True)
class Meta:
verbose_name = "référence"
verbose_name_plural = "références"
ordering = ["title"]
def __str__(self):
return self.title
class ContentBlock(models.Model):
"""Textes d'un facteur (ou d'une de ses classes) affichés dans les onglets."""
class Status(models.TextChoices):
DRAFT = "draft", "Brouillon"
VALIDATED = "validated", "Validé"
factor = models.ForeignKey(
Factor, verbose_name="facteur", on_delete=models.CASCADE, related_name="contents"
)
threshold_class = models.ForeignKey(
ThresholdClass,
verbose_name="classe de seuil",
null=True,
blank=True,
on_delete=models.CASCADE,
related_name="contents",
help_text="Vide : contenu commun à toutes les classes du facteur.",
)
health_effects = models.TextField("effets sur la santé", blank=True)
actions = models.TextField("pistes d'action", blank=True)
legend_text = models.TextField("légende", blank=True)
status = models.CharField("statut", max_length=10, choices=Status.choices, default=Status.DRAFT)
validated_at = models.DateTimeField("validé le", null=True, blank=True)
validated_by = models.ForeignKey(
settings.AUTH_USER_MODEL,
verbose_name="validé par",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="validated_contents",
)
references = models.ManyToManyField(
Reference, verbose_name="références", through="ContentReference", blank=True
)
history = HistoricalRecords()
class Meta:
verbose_name = "contenu"
verbose_name_plural = "contenus"
ordering = ["factor", "threshold_class__level"]
def __str__(self):
target = self.threshold_class.source_value if self.threshold_class else "commun"
return f"{self.factor} – {target} ({self.get_status_display()})"
class ContentReference(models.Model):
"""Référence citée par un contenu, avec son numéro de note."""
content = models.ForeignKey(ContentBlock, on_delete=models.CASCADE)
reference = models.ForeignKey(Reference, verbose_name="référence", on_delete=models.CASCADE)
order = models.PositiveSmallIntegerField("n° de note")
class Meta:
verbose_name = "référence citée"
verbose_name_plural = "références citées"
ordering = ["order"]
constraints = [
models.UniqueConstraint(fields=["content", "order"], name="unique_note_number"),
]
def __str__(self):
return f"{self.order}. {self.reference}"
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env python
"""Utilitaire de ligne de commande Django."""
import os
import sys
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
if __name__ == "__main__":
main()
+50
View File
@@ -0,0 +1,50 @@
[project]
name = "prism"
version = "0.1.0"
description = "PRISM – Pollution and Risks Identification System for Medicine (back-end)"
readme = "../README.md"
license = "GPL-3.0-or-later"
requires-python = ">=3.12,<3.13"
dependencies = [
"django~=5.2",
"djangorestframework~=3.16",
"drf-spectacular~=0.28",
"django-environ~=0.12",
"psycopg[binary]~=3.2",
"argon2-cffi~=25.1",
"django-otp~=1.6",
"qrcode~=8.0",
"django-simple-history~=3.8",
"httpx~=0.28",
"gunicorn~=23.0",
]
[dependency-groups]
dev = [
"pytest~=8.3",
"pytest-django~=4.10",
"pytest-asyncio~=0.26",
"respx~=0.22",
"ruff~=0.11",
]
[tool.uv]
package = false
[tool.ruff]
line-length = 100
target-version = "py312"
extend-exclude = ["*/migrations/*"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "B", "UP", "DJ", "S", "SIM"]
ignore = ["S101"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S105", "S106"]
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "config.settings"
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
View File
Whitespace-only changes.
+83
View File
@@ -0,0 +1,83 @@
import pytest
import respx
from django.core.management import call_command
from rest_framework.test import APIClient
from accounts.models import User
from assessments.geocoding import Location
WAL_LOCATION = Location(lat=50.668, lon=4.617, postal_code="1348", region="WAL")
BXL_LOCATION = Location(lat=50.846, lon=4.352, postal_code="1000", region="BXL")
NOMINATIM = "https://nominatim.openstreetmap.org/search"
IRCELINE = "https://geo.irceline.be/rio/wms"
WALONMAP = "https://geoservices.wallonie.be/arcgis/rest/services"
ROAD = f"{WALONMAP}/INDUSTRIES_SERVICES/BRUIT_MROAD_2017/MapServer/1/query"
RAIL = f"{WALONMAP}/INDUSTRIES_SERVICES/BRUIT_MRAIL_2017/MapServer/1/query"
AIRPORT = f"{WALONMAP}/INDUSTRIES_SERVICES/BRUIT_AEROPORTS/MapServer/1/query"
FLOOD = f"{WALONMAP}/EAU/ALEA_INOND/MapServer/2/query"
def arcgis(*attributes):
return {"features": [{"attributes": a} for a in attributes]}
def irceline(value):
features = [] if value is None else [{"properties": {"value": value}}]
return {"type": "FeatureCollection", "features": features}
def nominatim(postcode, lat="50.6696831", lon="4.6159504"):
return [{"lat": lat, "lon": lon, "address": {"postcode": postcode}}]
@pytest.fixture
def mock_http():
with respx.mock(assert_all_called=False) as router:
yield router
@pytest.fixture
def mock_irceline(mock_http):
"""irCELine : PM2,5 7,1 (> 5), PM10 12 (ok), NO2 27 (> 10), O3 50,1."""
values = {"pm25": 7.1, "pm10": 12.0, "no2": 27.0, "o3": 50.1}
def respond(request):
layer = request.url.params["LAYERS"].split("_")[0]
return respx.MockResponse(200, json=irceline(values[layer]))
mock_http.get(IRCELINE).mock(side_effect=respond)
return mock_http
@pytest.fixture
def seeded(db):
call_command("seed_factors", stdout=open("/dev/null", "w")) # noqa: SIM115
@pytest.fixture
def user(db):
return User.objects.create_user(
"medecin@exemple.be",
"un-mot-de-passe-solide",
first_name="Jean",
last_name="Dupont",
status=User.Status.ACTIVE,
)
@pytest.fixture
def api(user):
client = APIClient()
client.force_authenticate(user)
return client
@pytest.fixture(autouse=True)
def clear_cache():
"""Le compteur de limitation de débit de DRF est stocké dans le cache."""
from django.core.cache import cache
cache.clear()
yield
cache.clear()
+37
View File
@@ -0,0 +1,37 @@
import pytest
from django.contrib.auth.models import Group
from accounts.models import User
@pytest.mark.django_db
def test_only_active_accounts_can_log_in(client):
user = User.objects.create_user(
"Medecin@Exemple.be", "un-mot-de-passe-solide", first_name="A", last_name="B"
)
assert user.email == "medecin@exemple.be"
assert user.status == User.Status.EMAIL_PENDING
assert not client.login(email="medecin@exemple.be", password="un-mot-de-passe-solide")
user.status = User.Status.ACTIVE
user.save()
assert client.login(email="medecin@exemple.be", password="un-mot-de-passe-solide")
@pytest.mark.django_db
def test_superuser_is_active():
admin = User.objects.create_superuser("admin@exemple.be", "un-mot-de-passe-solide")
assert admin.is_active
@pytest.mark.django_db
def test_roles_exist():
assert set(Group.objects.values_list("name", flat=True)) >= {
"Médecin",
"Cellule SSMG",
"Admin",
}
def test_argon2_is_default(settings):
assert settings.PASSWORD_HASHERS[0].endswith("Argon2PasswordHasher")
+308
View File
@@ -0,0 +1,308 @@
"""POST /api/v1/assessments/"""
import logging
import pytest
from rest_framework.test import APIClient
from rest_framework.throttling import ScopedRateThrottle
from factors.models import ContentBlock, ContentReference, Factor, Reference, ThresholdClass
from .conftest import AIRPORT, FLOOD, IRCELINE, NOMINATIM, RAIL, ROAD, arcgis, irceline, nominatim
URL = "/api/v1/assessments/"
ADDRESS = "Place de l'Université 1, 1348 Louvain-la-Neuve"
pytestmark = pytest.mark.django_db
@pytest.fixture
def wallonia(mock_irceline):
"""Adresse wallonne : bruit 65-69 dB, air 2 dépassements, inondation en panne."""
mock_irceline.get(NOMINATIM).respond(json=nominatim("1348"))
mock_irceline.get(ROAD).respond(
json=arcgis({"DB_LOW": 65, "DB_HIGHT": 69, "CLASSE": "de 65 à 69"})
)
mock_irceline.get(RAIL).respond(json=arcgis())
mock_irceline.get(AIRPORT).respond(json=arcgis())
mock_irceline.get(FLOOD).respond(503)
return mock_irceline
@pytest.fixture
def brussels(mock_irceline):
mock_irceline.get(NOMINATIM).respond(json=nominatim("1000", lat="50.846", lon="4.352"))
return mock_irceline
def post(client, address=ADDRESS):
return client.post(URL, {"address": address}, format="json")
def factors_by_code(response):
return {f["code"]: f for f in response.json()["factors"]}
# Accès et validation de la requête ------------------------------------------------
def test_anonymous_is_rejected(seeded):
assert post(APIClient()).status_code == 403
def test_get_is_not_allowed(api, seeded):
assert api.get(URL).status_code == 405
@pytest.mark.parametrize(
"payload",
[{}, {"address": ""}, {"address": " "}, {"address": "x" * 301}, {"adresse": ADDRESS}],
ids=["vide", "chaine-vide", "espaces", "trop-longue", "mauvais-champ"],
)
def test_invalid_payload(api, seeded, payload):
response = api.post(URL, payload, format="json")
assert response.status_code == 400
assert "address" in response.json()
def test_geocoder_is_not_called_for_invalid_payload(api, seeded, mock_http):
route = mock_http.get(NOMINATIM)
api.post(URL, {"address": ""}, format="json")
assert not route.called
# Réponse ---------------------------------------------------------------------------
def test_response_shape(api, seeded, wallonia):
response = post(api)
assert response.status_code == 200
body = response.json()
assert set(body) == {"location", "factors"}
assert body["location"] == {"lat": 50.6696831, "lon": 4.6159504, "region": "WAL"}
for factor in body["factors"]:
assert set(factor) == {
"code",
"label",
"status",
"level",
"color",
"summary",
"details",
"tabs",
"references",
}
assert set(factor["tabs"]) == {"health_effects", "actions", "legend"}
assert set(factor["tabs"]["legend"]) == {"source", "text", "scale"}
def test_address_is_not_echoed(api, seeded, wallonia):
assert "Université" not in post(api).content.decode()
def test_factors_follow_admin_order(api, seeded, wallonia):
Factor.objects.filter(code="radon").update(order=0)
assert list(factors_by_code(post(api))) == ["radon", "noise", "air", "flood"]
def test_inactive_factor_is_omitted(api, seeded, wallonia):
Factor.objects.filter(code="air").update(active=False)
assert "air" not in factors_by_code(post(api))
def test_factor_without_module_is_unavailable(api, seeded, wallonia):
Factor.objects.create(code="soil", label="Pollution des sols", order=9)
assert factors_by_code(post(api))["soil"]["status"] == "unavailable"
def test_failing_source_does_not_block_others(api, seeded, wallonia):
factors = factors_by_code(post(api))
assert factors["flood"]["status"] == "unavailable"
assert factors["flood"]["level"] is None
assert factors["noise"]["status"] == "ok"
assert factors["air"]["status"] == "ok"
def test_no_data(api, seeded, wallonia):
wallonia.get(IRCELINE).respond(json=irceline(None))
assert factors_by_code(post(api))["air"]["status"] == "no_data"
def test_brussels_sources_not_connected(api, seeded, brussels):
response = post(api, "Rue de la Loi 16, 1000 Bruxelles")
factors = factors_by_code(response)
assert response.json()["location"]["region"] == "BXL"
assert factors["noise"]["status"] == "unavailable"
assert factors["flood"]["status"] == "unavailable"
assert factors["air"]["status"] == "ok"
# Seuils et contenus ---------------------------------------------------------------
def test_without_threshold_raw_summary_is_returned(api, seeded, wallonia):
noise = factors_by_code(post(api))["noise"]
assert noise["level"] is None
assert noise["color"] is None
assert noise["summary"] == "Lden de 65 à 69 dB(A)"
def test_threshold_sets_level_color_and_label(api, seeded, wallonia):
ThresholdClass.objects.create(
factor=Factor.objects.get(code="noise"),
region="WAL",
source_value="65-69",
label="65–69 dB",
level=3,
color="orange",
)
noise = factors_by_code(post(api))["noise"]
assert (noise["level"], noise["color"], noise["summary"]) == (3, "orange", "65–69 dB")
def test_threshold_of_other_region_is_ignored(api, seeded, wallonia):
ThresholdClass.objects.create(
factor=Factor.objects.get(code="noise"),
region="BXL",
source_value="65-69",
level=3,
color="orange",
)
assert factors_by_code(post(api))["noise"]["level"] is None
def test_regional_threshold_wins_over_national(api, seeded, wallonia):
air = Factor.objects.get(code="air")
ThresholdClass.objects.create(
factor=air, region="BE", source_value="2", level=3, color="orange"
)
ThresholdClass.objects.create(factor=air, region="WAL", source_value="2", level=4, color="red")
assert factors_by_code(post(api))["air"]["level"] == 4
def test_national_threshold_as_fallback(api, seeded, wallonia):
air = Factor.objects.get(code="air")
ThresholdClass.objects.create(
factor=air, region="BE", source_value="2", level=3, color="orange"
)
assert factors_by_code(post(api))["air"]["color"] == "orange"
def test_class_specific_validated_content(api, seeded, wallonia):
noise = Factor.objects.get(code="noise")
orange = ThresholdClass.objects.create(
factor=noise, region="WAL", source_value="65-69", level=3, color="orange"
)
ContentBlock.objects.create(
factor=noise, actions="Commun", status=ContentBlock.Status.VALIDATED
)
content = ContentBlock.objects.create(
factor=noise,
threshold_class=orange,
health_effects="Troubles du sommeil¹ ².",
actions="Isolation acoustique.",
legend_text="Lden, cartographie 2017.",
status=ContentBlock.Status.VALIDATED,
)
ContentReference.objects.create(
content=content, reference=Reference.objects.create(title="OMS 2018"), order=1
)
ContentReference.objects.create(
content=content,
reference=Reference.objects.create(title="EEA 2020", url="https://eea.europa.eu"),
order=2,
)
noise_result = factors_by_code(post(api))["noise"]
assert noise_result["tabs"]["health_effects"] == "Troubles du sommeil¹ ²."
assert noise_result["tabs"]["actions"] == "Isolation acoustique."
assert noise_result["tabs"]["legend"]["text"] == "Lden, cartographie 2017."
assert noise_result["references"] == [
{"n": 1, "title": "OMS 2018", "url": ""},
{"n": 2, "title": "EEA 2020", "url": "https://eea.europa.eu"},
]
def test_common_content_as_fallback(api, seeded, wallonia):
ContentBlock.objects.create(
factor=Factor.objects.get(code="noise"),
actions="Commun",
status=ContentBlock.Status.VALIDATED,
)
assert factors_by_code(post(api))["noise"]["tabs"]["actions"] == "Commun"
def test_draft_content_is_hidden(api, seeded, wallonia):
ContentBlock.objects.create(factor=Factor.objects.get(code="noise"), actions="Brouillon")
noise = factors_by_code(post(api))["noise"]
assert noise["tabs"]["actions"] == ""
assert noise["references"] == []
def test_legend_lists_sources_and_scale(api, seeded, wallonia):
noise = Factor.objects.get(code="noise")
ThresholdClass.objects.create(
factor=noise, region="WAL", source_value="aucune", level=1, color="green"
)
ThresholdClass.objects.create(
factor=noise, region="WAL", source_value="65-69", label="65–69 dB", level=3, color="orange"
)
legend = factors_by_code(post(api))["noise"]["tabs"]["legend"]
assert legend["source"] == "WalOnMap"
assert legend["scale"] == [
{"level": 1, "color": "green", "label": "aucune"},
{"level": 3, "color": "orange", "label": "65–69 dB"},
]
# Erreurs globales -----------------------------------------------------------------
def test_unknown_address(api, seeded, mock_http):
mock_http.get(NOMINATIM).respond(json=[])
response = post(api, "nulle part")
assert response.status_code == 404
assert response.json() == {"code": "address_not_found", "detail": "Adresse introuvable."}
def test_out_of_coverage(api, seeded, mock_http):
mock_http.get(NOMINATIM).respond(json=nominatim("9000"))
response = post(api, "Korenmarkt 1, 9000 Gent")
assert response.status_code == 422
assert response.json()["code"] == "out_of_coverage"
def test_geocoding_unavailable(api, seeded, mock_http):
mock_http.get(NOMINATIM).respond(500)
response = post(api)
assert response.status_code == 503
assert response.json()["code"] == "geocoding_unavailable"
def test_factor_sources_not_called_when_address_unknown(api, seeded, mock_http):
mock_http.get(NOMINATIM).respond(json=[])
road = mock_http.get(ROAD)
post(api, "nulle part")
assert not road.called
# Limitation de débit et confidentialité -------------------------------------------
def test_throttling(api, seeded, wallonia, monkeypatch):
monkeypatch.setattr(ScopedRateThrottle, "THROTTLE_RATES", {"assessments": "2/hour"})
assert post(api).status_code == 200
assert post(api).status_code == 200
assert post(api).status_code == 429
def test_address_is_not_logged(api, seeded, wallonia, caplog):
with caplog.at_level(logging.DEBUG):
post(api)
logs = caplog.text
assert "Université" not in logs
assert "1348" not in logs
assert "50.66" not in logs
assert "Facteur flood indisponible (HTTPStatusError)" in logs
+77
View File
@@ -0,0 +1,77 @@
"""GET /api/v1/factors/"""
import pytest
from rest_framework.test import APIClient
from factors.models import Factor, ThresholdClass
URL = "/api/v1/factors/"
pytestmark = pytest.mark.django_db
def test_anonymous_is_rejected(seeded):
assert APIClient().get(URL).status_code == 403
def test_post_is_not_allowed(api, seeded):
assert api.post(URL, {}, format="json").status_code == 405
def test_empty_without_factors(api):
response = api.get(URL)
assert response.status_code == 200
assert response.json() == []
def test_lists_active_factors_in_order(api, seeded):
Factor.objects.filter(code="radon").update(active=False)
Factor.objects.filter(code="flood").update(order=0)
body = api.get(URL).json()
assert [(f["code"], f["label"]) for f in body] == [
("flood", "Risque d'inondation"),
("noise", "Pollution sonore"),
("air", "Qualité de l'air"),
]
def test_legends_per_region(api, seeded):
noise = Factor.objects.get(code="noise")
ThresholdClass.objects.create(
factor=noise, region="WAL", source_value="65-69", label="65–69 dB", level=3, color="orange"
)
ThresholdClass.objects.create(
factor=noise, region="WAL", source_value="aucune", level=1, color="green"
)
ThresholdClass.objects.create(
factor=noise, region="BXL", source_value="Classe 8", level=4, color="red"
)
legends = {f["code"]: f["legends"] for f in api.get(URL).json()}["noise"]
assert set(legends) == {"WAL", "BXL"}
assert legends["WAL"]["source"] == "WalOnMap"
assert legends["WAL"]["scale"] == [
{"level": 1, "color": "green", "label": "aucune"},
{"level": 3, "color": "orange", "label": "65–69 dB"},
]
assert legends["BXL"]["source"] == "Bruxelles Environnement"
assert legends["BXL"]["scale"] == [{"level": 4, "color": "red", "label": "Classe 8"}]
def test_national_classes_appear_in_both_regions(api, seeded):
ThresholdClass.objects.create(
factor=Factor.objects.get(code="air"), region="BE", source_value="0", level=1, color="green"
)
legends = {f["code"]: f["legends"] for f in api.get(URL).json()}["air"]
assert legends["WAL"]["source"] == legends["BXL"]["source"] == "irCELine"
assert (
legends["WAL"]["scale"]
== legends["BXL"]["scale"]
== [{"level": 1, "color": "green", "label": "0"}]
)
def test_does_not_call_external_services(api, seeded, mock_http):
api.get(URL)
assert not mock_http.calls
+29
View File
@@ -0,0 +1,29 @@
"""GET /api/schema/ et /api/docs/"""
import pytest
from rest_framework.test import APIClient
pytestmark = pytest.mark.django_db
def test_schema_is_public():
response = APIClient().get("/api/schema/", HTTP_ACCEPT="application/vnd.oai.openapi+json")
assert response.status_code == 200
schema = response.json()
assert schema["info"]["title"] == "PRISM API"
def test_schema_documents_every_route():
schema = APIClient().get("/api/schema/?format=json").json()
paths = schema["paths"]
assert set(paths) == {"/api/v1/assessments/", "/api/v1/factors/"}
assessments = paths["/api/v1/assessments/"]["post"]
assert set(assessments["responses"]) == {"200", "404", "422", "503"}
assert "requestBody" in assessments
assert "get" in paths["/api/v1/factors/"]
def test_docs_page():
response = APIClient().get("/api/docs/")
assert response.status_code == 200
assert b"swagger" in response.content.lower()
+53
View File
@@ -0,0 +1,53 @@
import httpx
import pytest
from assessments.geocoding import AddressNotFound, GeocodingError, OutOfCoverage, geocode
from assessments.geocoding.base import region_from_postal_code
from .conftest import NOMINATIM, nominatim
@pytest.mark.parametrize(
("postal_code", "region"),
[
("1000", "BXL"),
("1210", "BXL"),
("1348", "WAL"),
("4000", "WAL"),
("7999", "WAL"),
("2000", None),
("9000", None),
("", None),
],
)
def test_region_from_postal_code(postal_code, region):
assert region_from_postal_code(postal_code) == region
async def test_geocode_wallonia(mock_http):
mock_http.get(NOMINATIM).respond(json=nominatim("1348"))
async with httpx.AsyncClient() as client:
location = await geocode(client, "Place de l'Université 1, 1348 Louvain-la-Neuve")
assert location.region == "WAL"
assert location.lat == pytest.approx(50.6697)
async def test_geocode_not_found(mock_http):
mock_http.get(NOMINATIM).respond(json=[])
async with httpx.AsyncClient() as client:
with pytest.raises(AddressNotFound):
await geocode(client, "rue inexistante")
async def test_geocode_flanders_is_out_of_coverage(mock_http):
mock_http.get(NOMINATIM).respond(json=nominatim("9000"))
async with httpx.AsyncClient() as client:
with pytest.raises(OutOfCoverage):
await geocode(client, "Korenmarkt 1, 9000 Gent")
async def test_geocode_service_down(mock_http):
mock_http.get(NOMINATIM).respond(503)
async with httpx.AsyncClient() as client:
with pytest.raises(GeocodingError):
await geocode(client, "Place de l'Université 1, 1348 Louvain-la-Neuve")
+96
View File
@@ -0,0 +1,96 @@
import httpx
import pytest
from assessments.providers.air import AirProvider
from assessments.providers.base import SourceUnavailable
from assessments.providers.flood import FloodProvider
from assessments.providers.noise import NoiseProvider
from assessments.providers.radon import RadonProvider
from .conftest import AIRPORT, BXL_LOCATION, FLOOD, RAIL, ROAD, WAL_LOCATION, arcgis
async def fetch(provider, location=WAL_LOCATION):
async with httpx.AsyncClient() as client:
return await provider.fetch(client, location)
async def test_noise_takes_loudest_source(mock_http):
mock_http.get(ROAD).respond(
json=arcgis(
{"DB_LOW": 55, "DB_HIGHT": 59, "CLASSE": "de 55 à 59"},
{"DB_LOW": 65, "DB_HIGHT": 69, "CLASSE": "de 65 à 69"},
)
)
mock_http.get(RAIL).respond(json=arcgis({"DB_LOW": 60, "DB_HIGHT": 64, "CLASSE": "de 60 à 64"}))
mock_http.get(AIRPORT).respond(json=arcgis())
result = await fetch(NoiseProvider())
assert result.status == "ok"
assert result.source_value == "65-69"
assert result.details[0] == {"label": "Route", "value": "de 65 à 69 dB(A)"}
assert result.details[2]["value"] == "aucune exposition détectée"
async def test_noise_without_exposure(mock_http):
for url in (ROAD, RAIL, AIRPORT):
mock_http.get(url).respond(json=arcgis())
result = await fetch(NoiseProvider())
assert (result.status, result.source_value) == ("ok", "aucune")
async def test_noise_arcgis_error_raises(mock_http):
mock_http.get(ROAD).respond(json={"error": {"code": 400}})
mock_http.get(RAIL).respond(json=arcgis())
mock_http.get(AIRPORT).respond(json=arcgis())
with pytest.raises(SourceUnavailable):
await fetch(NoiseProvider())
async def test_noise_brussels_not_connected():
with pytest.raises(SourceUnavailable):
await fetch(NoiseProvider(), BXL_LOCATION)
async def test_air_counts_who_exceedances(mock_irceline):
result = await fetch(AirProvider())
assert result.status == "ok"
assert result.source_value == "2"
assert result.summary == "2 dépassements des valeurs OMS"
assert result.details[0] == {
"label": "PM2,5",
"value": "7,1 µg/m³ (valeur guide OMS 5 : dépassée)",
}
assert result.details[3] == {"label": "O3", "value": "50,1 µg/m³"}
async def test_air_wms_exception_raises(mock_http):
from .conftest import IRCELINE
mock_http.get(IRCELINE).respond(200, text="<ServiceExceptionReport/>")
with pytest.raises(SourceUnavailable):
await fetch(AirProvider())
async def test_flood_takes_highest_hazard(mock_http):
mock_http.get(FLOOD).respond(
json=arcgis(
{"VALEUR": "Aléa faible", "CODEALEA": 10, "TYPEALEA": "Ruissellement"},
{"VALEUR": "Aléa élevé", "CODEALEA": 30, "TYPEALEA": "Débordement"},
)
)
result = await fetch(FloodProvider())
assert result.source_value == "Aléa élevé"
assert result.details[0] == {"label": "Débordement", "value": "Aléa élevé"}
async def test_flood_outside_hazard_zone(mock_http):
mock_http.get(FLOOD).respond(json=arcgis())
result = await fetch(FloodProvider())
assert (result.status, result.source_value) == ("ok", "aucun")
async def test_radon_not_connected():
with pytest.raises(SourceUnavailable):
await fetch(RadonProvider())
+612
View File
@@ -0,0 +1,612 @@
version = 1
revision = 3
requires-python = "==3.12.*"
[[package]]
name = "anyio"
version = "4.16.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "idna" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/a1/98/7e457a3b014976887a050561955c0b76e1e7e2d6e27b78ecef2ef80518f2/anyio-4.16.0.tar.gz", hash = "sha256:59bb03251907983d1603d27c3087ddb1e93299ea2163adcdba37899a4fb12ffb", size = 310971, upload-time = "2026-11-01T11:20:07.282Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a9/16/7757fb84c819accc7d7e9af5291b261e4abb8627ee040f99e7d35ef2457a/anyio-4.16.0-py3-none-any.whl", hash = "sha256:c66ae634e0b8228396b801741beb3294326d4b6102f7bba4041c0dfb58c29026", size = 134521, upload-time = "2026-11-01T11:20:05.59Z" },
]
[[package]]
name = "argon2-cffi"
version = "25.1.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "argon2-cffi-bindings" },
]
sdist = { url = "https://files.pythonhosted.org/packages/0e/89/ce5af8a7d472a67cc819d5d998aa8c82c5d860608c4db9f46f1162d7dab9/argon2_cffi-25.1.0.tar.gz", hash = "sha256:694ae5cc8a42f4c4e2bf2ca0e64e51e23a040c6a517a85074683d3959e1346c1", size = 45706, upload-time = "2025-06-03T06:55:32.073Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/4f/d3/a8b22fa575b297cd6e3e3b0155c7e25db170edf1c74783d6a31a2490b8d9/argon2_cffi-25.1.0-py3-none-any.whl", hash = "sha256:fdc8b074db390fccb6eb4a3604ae7231f219aa669a2652e0f20e16ba513d5741", size = 14657, upload-time = "2025-06-03T06:55:30.804Z" },
]
[[package]]
name = "argon2-cffi-bindings"
version = "26.2.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "cffi" },
]
sdist = { url = "https://files.pythonhosted.org/packages/76/3b/f7bd1daac24c7017b6d09d05c56bb3f71aaae76b2ac4234ed2c00e0dd2d2/argon2_cffi_bindings-26.2.0.tar.gz", hash = "sha256:f21ab89bb9850f32b9ca038d9961424bb0d3669d579cbbbfed068cffa6fc0643", size = 1792536, upload-time = "2026-11-13T07:16:40.386Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b4/21/d0e756a1b47b2674aec2919aa81096bb4143c9e3b912b9fe9e11d66bebc5/argon2_cffi_bindings-26.2.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:5ec171ae5e52691b5f111d815cb656a8142bedc1408c3db904d1a11df44604ca", size = 24273, upload-time = "2026-11-13T07:15:53.707Z" },
{ url = "https://files.pythonhosted.org/packages/18/aa/149b2b67262a83f09895fe1aa0aa9c6ac688457f11449905ab007c05f133/argon2_cffi_bindings-26.2.0-cp310-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92d65a0831e78294e19d7297d101eaa871033825ad2aa7cb87af2f706062acd7", size = 27232, upload-time = "2026-11-13T07:15:55.174Z" },
{ url = "https://files.pythonhosted.org/packages/7a/82/a9226c27133c26c7892ebc7b174304f81774a78c5b1e97a96e3c15b2cba8/argon2_cffi_bindings-26.2.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2d475baecbcb506e40ab1cb05a84c9cc913a8950061a4045fd0ec0eb54aa7fa2", size = 26650, upload-time = "2026-11-13T07:15:56.269Z" },
{ url = "https://files.pythonhosted.org/packages/ca/24/38bd2a7706025d8c2134ee493c29855ea0a74754adad619e1e929fa09068/argon2_cffi_bindings-26.2.0-cp310-abi3-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f073ba5029bfc847aac130b251120ed09a4fda3a3c7ac023294710351c080835", size = 27458, upload-time = "2026-11-13T07:15:57.374Z" },
{ url = "https://files.pythonhosted.org/packages/a7/89/e4325077a26a76ded84017114139e72af9d9845fac6574c307e08743080b/argon2_cffi_bindings-26.2.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:92629f581248269326aa4cf15974326ae0f3f141ad47e2f34100c5fea7d43083", size = 27186, upload-time = "2026-11-13T07:15:58.647Z" },
{ url = "https://files.pythonhosted.org/packages/e2/c4/befa5f3b4a7f2f988fa54e114a6e6abff8eac89ce78007e9658dd5b0118e/argon2_cffi_bindings-26.2.0-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:6b344daa1aec0fdfb3160eb2ef3f429914777288bff4097fc3e5e1e1e97c642e", size = 27643, upload-time = "2026-11-13T07:15:59.785Z" },
{ url = "https://files.pythonhosted.org/packages/7c/6a/6f7bfd95b496e2511906f1ee05bc87914187f9ab67b71ebc5bfba38ee223/argon2_cffi_bindings-26.2.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:df0374dd11e703522e9606318640d0cd37824264ae32c888d7f0cb4ce7aa00f1", size = 26838, upload-time = "2026-11-13T07:16:00.922Z" },
{ url = "https://files.pythonhosted.org/packages/1a/5f/957abb665fda517d96bc7e63a61cb52a6ecb4f14d395ca3a260c867ad803/argon2_cffi_bindings-26.2.0-cp310-abi3-win32.whl", hash = "sha256:b995a2d20c1725c92de86be8b0ce6c433b01b562ad3615530c8c04b6d3b6e9fe", size = 23953, upload-time = "2026-11-13T07:16:02.046Z" },
{ url = "https://files.pythonhosted.org/packages/d8/20/9c2ba6433cb58297b1bc8b14bfb5a703c8dccdee16c99c76ddfb66082aa4/argon2_cffi_bindings-26.2.0-cp310-abi3-win_amd64.whl", hash = "sha256:d2d4ae065e7cce4b286d3eb7c59128bfd11f8e407863b88629e9d391b864a3df", size = 25783, upload-time = "2026-11-13T07:16:03.152Z" },
{ url = "https://files.pythonhosted.org/packages/4e/a5/f98f1e2489eda5d3316ce031022531883d45a84774c7d26b7ffb93978894/argon2_cffi_bindings-26.2.0-cp310-abi3-win_arm64.whl", hash = "sha256:a2787a5f57dbf91a6435a896a31b9253b4a2e16063e2e68764d2a9e61b46bf4b", size = 25857, upload-time = "2026-11-13T07:16:04.269Z" },
{ url = "https://files.pythonhosted.org/packages/f7/a5/75bbb0548ae95bffa4e192b587a767e8ed95715bcbb6e0131c2bdb3e07cd/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:128796ea187b2ea2d240ab4c3a9d3d07f638c72bdb3341d4085bba1e95d85907", size = 24292, upload-time = "2026-11-13T07:16:19.269Z" },
{ url = "https://files.pythonhosted.org/packages/96/9a/2e6baf2d40a25aa0f954d1c59df1d886b4ced60ba6bfd4af4c9992435ed9/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4fd4e255efdf1156415093db43270da540e3752b9496edf25f34bc64eb0eca60", size = 27241, upload-time = "2026-11-13T07:16:20.357Z" },
{ url = "https://files.pythonhosted.org/packages/0f/40/63a5f02cc09655207d004d33a9cda248b5f5fbc7b2ccccd81142817a06a4/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d1cf917a9917dafc5665d21745b9697d73a0678a82025f4d146976b3b4a0660f", size = 26665, upload-time = "2026-11-13T07:16:21.707Z" },
{ url = "https://files.pythonhosted.org/packages/01/32/bbd6c60e7d13e0a52d5308e42388227a84569d67254e16fc4822d2979330/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cad283b6122f69fd8ff30b3c1d982db4947aa9bbb1728908321352fe74013fc7", size = 27459, upload-time = "2026-11-13T07:16:22.968Z" },
{ url = "https://files.pythonhosted.org/packages/ec/d7/b18cc175008afa10bc2ec1720e0aea6ecc602a185cc216ebc3c58db49ec3/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:9c497363618d80c59533b21538a8475b6c83cd152ecf98e31339847a484b4faa", size = 27184, upload-time = "2026-11-13T07:16:24.083Z" },
{ url = "https://files.pythonhosted.org/packages/31/d2/44fd5746db6b66372854fd33f55c3bf27fcc1d5ae50a4fad1c076963738d/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-musllinux_1_2_riscv64.whl", hash = "sha256:26c35612ae797817c9a94467df2d59d449253bc2a341bd81bcaeedcf2186ce9b", size = 27659, upload-time = "2026-11-13T07:16:25.185Z" },
{ url = "https://files.pythonhosted.org/packages/29/83/849951df8a62f0094c61bde749289925c6985b27358b9ed487b526db9cd5/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:0605c024d02be0896112f4dc90a896df69464c634ec578ef6b0fe6caf9777e69", size = 26881, upload-time = "2026-11-13T07:16:26.283Z" },
{ url = "https://files.pythonhosted.org/packages/84/91/04067bac98f55bc9be663cc1442ea516b523d8ed658113c84d008313ccb8/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-win32.whl", hash = "sha256:b60f1f12567f86a7087b1c4edb2b673a1e396703d3b6137f13b1f6cea8e1473f", size = 24745, upload-time = "2026-11-13T07:16:27.446Z" },
{ url = "https://files.pythonhosted.org/packages/39/b9/2799f5dda0bc7de972901321ba0faca8536b125afb1d71002170405c63d2/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-win_amd64.whl", hash = "sha256:9f9f0215ddc8638b2003f8e8c5b0c378e0e976869c40911ac015f375a60fcca4", size = 26522, upload-time = "2026-11-13T07:16:28.538Z" },
{ url = "https://files.pythonhosted.org/packages/6d/ed/4177677a981464afa55c324ae575cc6b9752affa8668acc40eb6899f98fc/argon2_cffi_bindings-26.2.0-cp315-abi3.abi3t-win_arm64.whl", hash = "sha256:1a525e093acb8dd2cd85317577271251be1920ad4d1e5a05bffde9c7a53290cd", size = 26646, upload-time = "2026-11-13T07:16:29.771Z" },
]
[[package]]
name = "asgiref"
version = "3.13.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/6b/90/f5fce14e95fccf53b58e8e2c47cd84d40d105d64073ae1ac75166db150e0/asgiref-3.13.0.tar.gz", hash = "sha256:034cc8cbf72d00553b4be256703ac545120b4e50af13b49dec99da899aeeecb4", size = 52941, upload-time = "2026-10-23T08:13:14.715Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/2e/b0/ec211e1f7966247cb6469158d856bac9aa4c2fe13621bd6a352e4f850453/asgiref-3.13.0-py3-none-any.whl", hash = "sha256:f9596a2434512686473d50f96ff6207fbba49ae1a785dfac614df4aeb085674d", size = 27593, upload-time = "2026-10-23T08:13:13.394Z" },
]
[[package]]
name = "attrs"
version = "26.1.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/9a/8e/82a0fe20a541c03148528be8cac2408564a6c9a0cc7e9171802bc1d26985/attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32", size = 952055, upload-time = "2026-03-19T14:22:25.026Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", size = 67548, upload-time = "2026-03-19T14:22:23.645Z" },
]
[[package]]
name = "certifi"
version = "2026.11.20"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/51/33/4cd27639502f010084bcef7a2036391dd637439901341ce1a530f36f6e51/certifi-2026.11.20.tar.gz", hash = "sha256:af1cb240a8133f105aa52684a3a3258339d7f2fd0bd4e2812698ff5cf5588c4e", size = 128901, upload-time = "2026-11-20T23:37:49.522Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/6d/39/5eec3296860b94ac20bb8ed807725b88f6adfab3f343df592afd975f5f86/certifi-2026.11.20-py3-none-any.whl", hash = "sha256:7422df25243767b9877031a2248cb14d09ddac9beee846f4cef3d5c9191d488f", size = 127913, upload-time = "2026-11-20T23:37:48.117Z" },
]
[[package]]
name = "cffi"
version = "2.1.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "pycparser", marker = "implementation_name != 'PyPy'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807, upload-time = "2026-08-03T21:21:18.939Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/10/69/43965eccfdead3b9220015fd1320e117be8c6ed01a62ffab76eeb752f5d5/cffi-2.1.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0", size = 184821, upload-time = "2026-08-03T21:19:44.887Z" },
{ url = "https://files.pythonhosted.org/packages/54/7d/16e5a096677b5e313ca80cd5e5170efa3ea44624a82bb111925522da64b1/cffi-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf", size = 184719, upload-time = "2026-08-03T21:19:46.129Z" },
{ url = "https://files.pythonhosted.org/packages/56/e6/8941622732edec876dd17d0453dce07317ae96db34f2ec1436c9d3785986/cffi-2.1.1-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a", size = 214799, upload-time = "2026-08-03T21:19:47.218Z" },
{ url = "https://files.pythonhosted.org/packages/44/de/f98430906df1545ffde0d543dd124a7a439bc2cd32b36b9c53f805df7333/cffi-2.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890", size = 222389, upload-time = "2026-08-03T21:19:48.331Z" },
{ url = "https://files.pythonhosted.org/packages/6a/5b/717f1526b9957b34456313c31645c5b82b8fb5c3fe9e4752999be7128bfc/cffi-2.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50", size = 210249, upload-time = "2026-08-03T21:19:49.543Z" },
{ url = "https://files.pythonhosted.org/packages/64/b3/f8aa4f3e34986c7e4ec45072d1b1b9dd295b6b18007b45518d79726dd725/cffi-2.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e", size = 208775, upload-time = "2026-08-03T21:19:50.918Z" },
{ url = "https://files.pythonhosted.org/packages/b1/db/dceb9dd5b231e1da801793f8acc9f3c52a7e1afe40bb1aae37e02b0faad5/cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf", size = 221822, upload-time = "2026-08-03T21:19:52.054Z" },
{ url = "https://files.pythonhosted.org/packages/a0/d2/6cd24ae3be000a634109c247d1475d62e5616d0dc78c82770942ec384248/cffi-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517", size = 225232, upload-time = "2026-08-03T21:19:53.109Z" },
{ url = "https://files.pythonhosted.org/packages/cb/52/3fa190537004dd7f0ab860a6dc7c0175b8667f68d1e618a46f5498d30250/cffi-2.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735", size = 223597, upload-time = "2026-08-03T21:19:54.515Z" },
{ url = "https://files.pythonhosted.org/packages/80/fb/0bb75b7039588c074b37ae99f40d9bfddf990ecb2fbc346ebccd2e56b9be/cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e", size = 175292, upload-time = "2026-08-03T21:19:55.566Z" },
{ url = "https://files.pythonhosted.org/packages/d9/79/615cc094e2fb508cade7de88d3b4f6c4ec2bab695c97bce9153dc65aadf5/cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a", size = 185919, upload-time = "2026-08-03T21:19:56.89Z" },
{ url = "https://files.pythonhosted.org/packages/70/c6/d0ea84713fe46b243a436a18fcd47d639732747e21635c8a27191b06dc30/cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80", size = 180093, upload-time = "2026-08-03T21:19:58.155Z" },
]
[[package]]
name = "colorama"
version = "0.4.6"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
]
[[package]]
name = "django"
version = "5.2.19"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "asgiref" },
{ name = "sqlparse" },
{ name = "tzdata", marker = "sys_platform == 'win32'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/02/29/a487a108caa76430c8b616aa90a6d09cf431306112c14093e6f0a7454e17/django-5.2.19.tar.gz", hash = "sha256:ad03d8abc51dbff95ebf34b27123cf0c26a3b62db7ba0cd520783686362533d1", size = 10969285, upload-time = "2026-11-03T15:22:09.468Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/3c/fb/65b4e897d1268288a46457493d9aec6541be8be08e0093a93cc101c03ab2/django-5.2.19-py3-none-any.whl", hash = "sha256:5965d974a5218a2b68a11dd1276434707f23886525c23f0598eccedaf4f4ca00", size = 8319631, upload-time = "2026-11-03T15:22:03.67Z" },
]
[[package]]
name = "django-environ"
version = "0.14.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/57/e1/4c4ddcf6e90f023e89edb1d92f9a7fffce61ad4b691df497f2f5c0be6e26/django_environ-0.14.0.tar.gz", hash = "sha256:b6c48d93b9d2ff8a3ea14099e90c35aa4f101c1b4d5f262dfee0d27b06742ed7", size = 60417, upload-time = "2026-06-18T22:49:55.847Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/1a/fe/67b423fc30f16d10259e901320fbc121746bf168aaaad9043e6ebb0110c1/django_environ-0.14.0-py3-none-any.whl", hash = "sha256:8dbe8a57f0a540ab8abd6f54f230de5e99e3a2c9d797cb9caecb037bca3d47d8", size = 20934, upload-time = "2026-06-18T22:49:54.355Z" },
]
[[package]]
name = "django-otp"
version = "1.7.5"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "django" },
]
sdist = { url = "https://files.pythonhosted.org/packages/d0/e9/db4349d7a866e6d5153b31fa740b17f5893723715edf7d1673615d9f462c/django_otp-1.7.5.tar.gz", hash = "sha256:7f554d21dcd035550c3b8e3f154b1f422fee71fdc75c8a3bf96e42a2ea6dafcc", size = 79637, upload-time = "2026-10-16T14:48:48.98Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a3/bc/bda771669006e7e112bed31a330636ff0b3c3407b053c10c492368c35f6f/django_otp-1.7.5-py3-none-any.whl", hash = "sha256:475d4111e07d61616996f098d08d29884da6397273a11f53c1b8e8c75d27e1dc", size = 73805, upload-time = "2026-10-16T14:48:47.793Z" },
]
[[package]]
name = "django-simple-history"
version = "3.13.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "django" },
]
sdist = { url = "https://files.pythonhosted.org/packages/6b/1c/0689c13c0aa36df828947692f4e309f93c58e075219735c423edbbf6227d/django_simple_history-3.13.0.tar.gz", hash = "sha256:ca3c1e4ccd5f16f45fbbef6015ee2a246465fd9bd924100df8e9dfb368c4f26c", size = 236759, upload-time = "2026-07-22T13:41:29.588Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/65/60/41b2055db523b18a7ef67d0ce7c7c3204bf1b01e388628c8ce578daca7ec/django_simple_history-3.13.0-py3-none-any.whl", hash = "sha256:1cf1d83054479f64aee022023afc1671843aa0a99888799c5c4c3966b0252521", size = 82040, upload-time = "2026-07-22T13:41:28.083Z" },
]
[[package]]
name = "djangorestframework"
version = "3.18.3"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "django" },
]
sdist = { url = "https://files.pythonhosted.org/packages/8d/b2/1cee76b188301f7d03169ca77fab2b3d3ec5d01b3469189f944af2d7f11a/djangorestframework-3.18.3.tar.gz", hash = "sha256:446a9b352e7eff630421ab3f2328bd2401b109a9470afa4a31189994911ed030", size = 923563, upload-time = "2026-10-06T21:33:51.521Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/c4/dd/de5f4543765bec94e036a5e9593a42f8fa7efec8de78eb56b9ca834385f3/djangorestframework-3.18.3-py3-none-any.whl", hash = "sha256:8544bb674846731b1e3c9b309236ee1dc412905a0aa725be2ec193ca950a7d12", size = 903986, upload-time = "2026-10-06T21:33:49.917Z" },
]
[[package]]
name = "drf-spectacular"
version = "0.30.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "django" },
{ name = "djangorestframework" },
{ name = "inflection" },
{ name = "jsonschema" },
{ name = "pyyaml" },
{ name = "uritemplate" },
]
sdist = { url = "https://files.pythonhosted.org/packages/50/43/41d25039a6a53545420ebc98eb9f877ec9fe30c7bd03fefabcaf9b953af7/drf_spectacular-0.30.0.tar.gz", hash = "sha256:53e79e7ba00e240441b63c32273754a5368e4c2ab44a19f2595277cc1cd559c9", size = 252311, upload-time = "2026-07-06T11:29:46.264Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/c3/56/74dd7b45bbde6d24494220b98d6961cb1200b63a1800332b430daa2c4551/drf_spectacular-0.30.0-py3-none-any.whl", hash = "sha256:006cf5921ebe20a9bd24f7c846261ebbf78780be5961b0d6e87afaa82afd62ff", size = 111150, upload-time = "2026-07-06T11:29:45.12Z" },
]
[[package]]
name = "gunicorn"
version = "23.0.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "packaging" },
]
sdist = { url = "https://files.pythonhosted.org/packages/34/72/9614c465dc206155d93eff0ca20d42e1e35afc533971379482de953521a4/gunicorn-23.0.0.tar.gz", hash = "sha256:f014447a0101dc57e294f6c18ca6b40227a4c90e9bdb586042628030cba004ec", size = 375031, upload-time = "2024-08-10T20:25:27.378Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/cb/7d/6dac2a6e1eba33ee43f318edbed4ff29151a49b5d37f080aad1e6469bca4/gunicorn-23.0.0-py3-none-any.whl", hash = "sha256:ec400d38950de4dfd418cff8328b2c8faed0edb0d517d3394e457c317908ca4d", size = 85029, upload-time = "2024-08-10T20:25:24.996Z" },
]
[[package]]
name = "h11"
version = "0.16.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
]
[[package]]
name = "httpcore"
version = "1.0.9"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "certifi" },
{ name = "h11" },
]
sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" },
]
[[package]]
name = "httpx"
version = "0.28.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
{ name = "certifi" },
{ name = "httpcore" },
{ name = "idna" },
]
sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" },
]
[[package]]
name = "idna"
version = "3.20"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/f5/08/8eea9d4b8302028f3abb2c0813953f7aec26d33b7a8960ed760e65ff29fa/idna-3.20.tar.gz", hash = "sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44", size = 216463, upload-time = "2026-09-17T14:11:04.752Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/58/a2/bb081bab032533a855d44de1d56f8e8426114ff1ba5d1f07a438a0a654f8/idna-3.20-py3-none-any.whl", hash = "sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c", size = 69583, upload-time = "2026-09-17T14:11:03.168Z" },
]
[[package]]
name = "inflection"
version = "0.5.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/e1/7e/691d061b7329bc8d54edbf0ec22fbfb2afe61facb681f9aaa9bff7a27d04/inflection-0.5.1.tar.gz", hash = "sha256:1a29730d366e996aaacffb2f1f1cb9593dc38e2ddd30c91250c6dde09ea9b417", size = 15091, upload-time = "2020-08-22T08:16:29.139Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/59/91/aa6bde563e0085a02a435aa99b49ef75b0a4b062635e606dab23ce18d720/inflection-0.5.1-py2.py3-none-any.whl", hash = "sha256:f38b2b640938a4f35ade69ac3d053042959b62a0f1076a5bbaa1b9526605a8a2", size = 9454, upload-time = "2020-08-22T08:16:27.816Z" },
]
[[package]]
name = "iniconfig"
version = "2.3.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/01/e1/2069291243c926a2ff1cd706c7f3eeb9b62144bf60f77c9fb9ff2fb26bd3/iniconfig-2.3.1.tar.gz", hash = "sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960", size = 21209, upload-time = "2026-10-06T22:48:38.076Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl", hash = "sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7", size = 7552, upload-time = "2026-10-06T22:48:36.959Z" },
]
[[package]]
name = "jsonschema"
version = "4.26.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "attrs" },
{ name = "jsonschema-specifications" },
{ name = "referencing" },
{ name = "rpds-py" },
]
sdist = { url = "https://files.pythonhosted.org/packages/b3/fc/e067678238fa451312d4c62bf6e6cf5ec56375422aee02f9cb5f909b3047/jsonschema-4.26.0.tar.gz", hash = "sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326", size = 366583, upload-time = "2026-01-07T13:41:07.246Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/69/90/f63fb5873511e014207a475e2bb4e8b2e570d655b00ac19a9a0ca0a385ee/jsonschema-4.26.0-py3-none-any.whl", hash = "sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce", size = 90630, upload-time = "2026-01-07T13:41:05.306Z" },
]
[[package]]
name = "jsonschema-specifications"
version = "2025.9.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "referencing" },
]
sdist = { url = "https://files.pythonhosted.org/packages/19/74/a633ee74eb36c44aa6d1095e7cc5569bebf04342ee146178e2d36600708b/jsonschema_specifications-2025.9.1.tar.gz", hash = "sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d", size = 32855, upload-time = "2025-09-08T01:34:59.186Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/41/45/1a4ed80516f02155c51f51e8cedb3c1902296743db0bbc66608a0db2814f/jsonschema_specifications-2025.9.1-py3-none-any.whl", hash = "sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe", size = 18437, upload-time = "2025-09-08T01:34:57.871Z" },
]
[[package]]
name = "packaging"
version = "26.4"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/c3/75/ffb1dc0ed12352139fb4ca0e3fde4325a23e3d0f3f40efe89717bc4f557b/packaging-26.4.tar.gz", hash = "sha256:c4b671c41ddb9bf26e543c37723610d28fb6bf7affc4da17cf048d419d2c062a", size = 355877, upload-time = "2026-11-23T21:44:11.152Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ba/7b/5504f91c9c2733f693d7759e50ede5d27119d4da7e5836c46d3b5ff81d56/packaging-26.4-py3-none-any.whl", hash = "sha256:81383611a09c1bc0b08b76e0fd5829d7c6824c65b27a6aee339da133f4233ea2", size = 140049, upload-time = "2026-11-23T21:44:09.531Z" },
]
[[package]]
name = "pluggy"
version = "1.7.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/bf/db/7fc19e6f2dc92a966727031389fc2e08b558f0f25eb7403c1119ad4713cd/pluggy-1.7.0.tar.gz", hash = "sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8", size = 123304, upload-time = "2026-10-15T09:50:58.343Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl", hash = "sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec", size = 27082, upload-time = "2026-10-15T09:50:56.808Z" },
]
[[package]]
name = "prism"
version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "argon2-cffi" },
{ name = "django" },
{ name = "django-environ" },
{ name = "django-otp" },
{ name = "django-simple-history" },
{ name = "djangorestframework" },
{ name = "drf-spectacular" },
{ name = "gunicorn" },
{ name = "httpx" },
{ name = "psycopg", extra = ["binary"] },
{ name = "qrcode" },
]
[package.dev-dependencies]
dev = [
{ name = "pytest" },
{ name = "pytest-asyncio" },
{ name = "pytest-django" },
{ name = "respx" },
{ name = "ruff" },
]
[package.metadata]
requires-dist = [
{ name = "argon2-cffi", specifier = "~=25.1" },
{ name = "django", specifier = "~=5.2" },
{ name = "django-environ", specifier = "~=0.12" },
{ name = "django-otp", specifier = "~=1.6" },
{ name = "django-simple-history", specifier = "~=3.8" },
{ name = "djangorestframework", specifier = "~=3.16" },
{ name = "drf-spectacular", specifier = "~=0.28" },
{ name = "gunicorn", specifier = "~=23.0" },
{ name = "httpx", specifier = "~=0.28" },
{ name = "psycopg", extras = ["binary"], specifier = "~=3.2" },
{ name = "qrcode", specifier = "~=8.0" },
]
[package.metadata.requires-dev]
dev = [
{ name = "pytest", specifier = "~=8.3" },
{ name = "pytest-asyncio", specifier = "~=0.26" },
{ name = "pytest-django", specifier = "~=4.10" },
{ name = "respx", specifier = "~=0.22" },
{ name = "ruff", specifier = "~=0.11" },
]
[[package]]
name = "psycopg"
version = "3.3.9"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "typing-extensions" },
{ name = "tzdata", marker = "sys_platform == 'win32'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/b4/74/ff710399dfa9fe9b546c2f5a05ea2f9b9d1dc2145c0b59e53a3fa2013679/psycopg-3.3.9.tar.gz", hash = "sha256:87c1d85c3e0e88e811d3c0b3808f947bd967c6faf34af6cd86fd021f77793d6c", size = 171122, upload-time = "2026-11-12T09:04:06.548Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/52/5d/a7957d1b5484f8e5094a15b1a400929324f978b670bd4a95179e1a012ec2/psycopg-3.3.9-py3-none-any.whl", hash = "sha256:d2d7d04a1ce6dab4f5b27316bea3b52585cafa2f2d631e5b09dd69823f5c26f6", size = 219041, upload-time = "2026-11-12T08:58:18.454Z" },
]
[package.optional-dependencies]
binary = [
{ name = "psycopg-binary", marker = "implementation_name != 'pypy'" },
]
[[package]]
name = "psycopg-binary"
version = "3.3.9"
source = { registry = "https://pypi.org/simple" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/6e/0c/7fc92c3135ce195bb86052d18f9ef5f64b1592d8f3a5f1d90e9b49c72448/psycopg_binary-3.3.9-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fcdb76adaab57fdd5b789b13b20699bffaf17000a4bbc0527327581cfdd55e3d", size = 4048935, upload-time = "2026-11-12T09:00:08.958Z" },
{ url = "https://files.pythonhosted.org/packages/f0/a4/e62d11a85fc1a3a49f95b308bd5e2299dfc11125ef87043f6dfc29297d0c/psycopg_binary-3.3.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:08689018e9169ca8e6769f5b3f2ce748442bda95b5f1ec260995a8ff63e6d6a4", size = 4111565, upload-time = "2026-11-12T09:00:14.788Z" },
{ url = "https://files.pythonhosted.org/packages/4a/89/d9ca02dfe30a6dc51e7796617dd69cc5c2e66bcc89ced44df4f4a3b5e402/psycopg_binary-3.3.9-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:e7e2e3543ac17cf5bb3eaf738606fc52bcedf993500b9fc8c55a4475a3731ef9", size = 4207484, upload-time = "2026-11-12T09:00:23.781Z" },
{ url = "https://files.pythonhosted.org/packages/4d/aa/f1b6e1cd71aeafa78ab33875adf0339818fe014cde197a1c0c7c419dd0b0/psycopg_binary-3.3.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a99f0b9a19ed7a56bf5d6776456b8f15f5364db8853b0f5d184db394a45c391d", size = 3913036, upload-time = "2026-11-12T09:00:30.144Z" },
{ url = "https://files.pythonhosted.org/packages/ae/fe/9e967bfacdda0fef48fee1d869b13de016d82d846a805745b0985ac94a5b/psycopg_binary-3.3.9-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b081348d8992af26e9b252f04876c286428418a6b7845d8d4caae2044b259668", size = 4132657, upload-time = "2026-11-12T09:00:34.401Z" },
{ url = "https://files.pythonhosted.org/packages/cb/b3/c6a9f0bca0fdb06cf408235b698710f400a1d6376ab77e5fec887115aaa5/psycopg_binary-3.3.9-cp312-cp312-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:66b20619acbd434e4e46d734a915768a1192db09754c2ad041d391d72f30e5eb", size = 3545187, upload-time = "2026-11-12T09:00:38.595Z" },
{ url = "https://files.pythonhosted.org/packages/61/24/0443e50d382d3f6dcc03530560e02a02646af6bd8fcbd5a60add68c80208/psycopg_binary-3.3.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b7c4b2039d82f635311e41e7d392ff1bddd94a2447f9668c6531489cc86a8ce2", size = 3897551, upload-time = "2026-11-12T09:00:43.769Z" },
{ url = "https://files.pythonhosted.org/packages/c5/18/e576c5f50f4751ad9f1770134ad57ef216d00e5d79caa1c5b091f41275dc/psycopg_binary-3.3.9-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:3efe96cd98081b755ee3b0a50f2d35d9af55cb1ba462440a41048b9e7c6b9caa", size = 3577016, upload-time = "2026-11-12T09:00:49.375Z" },
{ url = "https://files.pythonhosted.org/packages/cb/c6/434e01b19af141540147427675c116b2205ea58e3ec99e26431edf2d0714/psycopg_binary-3.3.9-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:80ce081d2512ced75f1ca08ff80257a1288a3555079c5fa622164a0f9ed6533a", size = 3305336, upload-time = "2026-11-12T09:00:55.531Z" },
{ url = "https://files.pythonhosted.org/packages/eb/84/0ea715e106cc80a89aca36e34dd6685fa1ee75da9546d41a1d87356efb9f/psycopg_binary-3.3.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:30a95cb2b00b94b4ec4fd5d41de047598c60e0db26fd43bd9154152cc380b282", size = 3620366, upload-time = "2026-11-12T09:01:01.033Z" },
{ url = "https://files.pythonhosted.org/packages/81/a7/afe5fe01b4100454ea6543ac84c8b38a3713d6f27790253798ba50f2ef2a/psycopg_binary-3.3.9-cp312-cp312-win_amd64.whl", hash = "sha256:1ce1a6f04211626ca1a3deadee560235e8686e3888fb18f78d2be3e83bceabc4", size = 2907832, upload-time = "2026-11-12T09:01:04.735Z" },
]
[[package]]
name = "pycparser"
version = "3.12"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/cb/27/eeb9f307bf07060f3d9f9aa0fb8c15b01bdfded0a941e4b2719c7f94cacd/pycparser-3.12.tar.gz", hash = "sha256:f03387877eab82ce01bbdfd0ba7252ee55a90b1c708d5129e2ce915475cf1db6", size = 158785, upload-time = "2026-10-22T13:40:03.56Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b6/ae/315bbeee126a769cbde43cf4908acb4b40408d8bf8bbf334dd7368d8dadf/pycparser-3.12-py3-none-any.whl", hash = "sha256:a076f3f489b39b43ed13563a1dafe42447445bec2e294154ec5c57fcdda4c85e", size = 62600, upload-time = "2026-10-22T13:40:02.021Z" },
]
[[package]]
name = "pygments"
version = "2.21.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" },
]
[[package]]
name = "pytest"
version = "8.4.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "colorama", marker = "sys_platform == 'win32'" },
{ name = "iniconfig" },
{ name = "packaging" },
{ name = "pluggy" },
{ name = "pygments" },
]
sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" },
]
[[package]]
name = "pytest-asyncio"
version = "0.26.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "pytest" },
]
sdist = { url = "https://files.pythonhosted.org/packages/8e/c4/453c52c659521066969523e87d85d54139bbd17b78f09532fb8eb8cdb58e/pytest_asyncio-0.26.0.tar.gz", hash = "sha256:c4df2a697648241ff39e7f0e4a73050b03f123f760673956cf0d72a4990e312f", size = 54156, upload-time = "2025-03-25T06:22:28.883Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/20/7f/338843f449ace853647ace35870874f69a764d251872ed1b4de9f234822c/pytest_asyncio-0.26.0-py3-none-any.whl", hash = "sha256:7b51ed894f4fbea1340262bdae5135797ebbe21d8638978e35d31c6d19f72fb0", size = 19694, upload-time = "2025-03-25T06:22:27.807Z" },
]
[[package]]
name = "pytest-django"
version = "4.14.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "pytest" },
]
sdist = { url = "https://files.pythonhosted.org/packages/44/f6/3851312120c2bf2f19cafff931e75059aad1ba670703cd751e2fde9bc942/pytest_django-4.14.0.tar.gz", hash = "sha256:26787dd3f422cfbab8f55b80a776e2edea7a11092cb74e960bef1312515708ef", size = 94700, upload-time = "2026-08-10T14:13:08.319Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/9c/03/850bffad2b581c440ca51c039d74504d5a422c94bda0bdb8a8ba5068d48b/pytest_django-4.14.0-py3-none-any.whl", hash = "sha256:c533b08d89cc675efcd5398eea270b34547e35f9a3608e2c9748dd88428ea187", size = 27067, upload-time = "2026-08-10T14:13:06.998Z" },
]
[[package]]
name = "pyyaml"
version = "6.0.4"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/76/b8/c0b780928e2fb1c87e9e375818c6f121da2398b071012d1747be300b83f4/pyyaml-6.0.4.tar.gz", hash = "sha256:e24bf71af8a432d7808fabff134d38dfe16d3cbb41f2873bb4b1e42422de0a1a", size = 136336, upload-time = "2026-11-20T23:37:05.977Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/86/df/5aec8a8c65e4c11fab31b55d53029d8013e5ccfcf409c20f8175e3e267c7/pyyaml-6.0.4-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:1088ad740f50c13178dad16fbc2fa1f634c791d42c7009fdb390e38e5b90b788", size = 187835, upload-time = "2026-11-20T23:35:00.829Z" },
{ url = "https://files.pythonhosted.org/packages/c7/30/efaabf2d135d11f32cbd4752f3b7df0d592894ee3ca252bbba013a7d5891/pyyaml-6.0.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4d30c2f186612bd2f9f07c08a4c96721af59cfc8da3ec7cb27dfa2834e8bb019", size = 179510, upload-time = "2026-11-20T23:35:01.826Z" },
{ url = "https://files.pythonhosted.org/packages/af/fb/d5ff6957db5c843151ff13196277bb8e20b2d5db2e2db3e8d051038d888b/pyyaml-6.0.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:45e37dd647db9d67b757444c74060c064ace5fdaa08f42bf4fda3812275d423e", size = 814700, upload-time = "2026-11-20T23:35:02.923Z" },
{ url = "https://files.pythonhosted.org/packages/c4/de/569b907a281bbc49b934bcdad881486b7a476b011cf733f936ca85a8b37d/pyyaml-6.0.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:9e7ec9dc75cadd392fd687cc9b8ccf7dd59ada0a991e0d14ae0fad9ecdba00c3", size = 879806, upload-time = "2026-11-20T23:35:04.34Z" },
{ url = "https://files.pythonhosted.org/packages/94/80/1d27f7084b983b7cfd1fb35e65a38276d9eddfdcdabc0922bb26cf9521bc/pyyaml-6.0.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:93bfb2459195406a518e2f487a9bbf01df240175f31e06f5a252ac6734c7bbf0", size = 849249, upload-time = "2026-11-20T23:35:05.457Z" },
{ url = "https://files.pythonhosted.org/packages/53/37/9b49dff68570bedf27a05ff447e9a281d75bbdfa4d08dc1ee100a844c612/pyyaml-6.0.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:84e97378010f3da8daf673b82d39ed638098d236a1b760d61c0c1348a642bd70", size = 799796, upload-time = "2026-11-20T23:35:06.566Z" },
{ url = "https://files.pythonhosted.org/packages/05/bb/f7df529541b98113bea84129a78f93c3889acb08385ca25f9786823dce67/pyyaml-6.0.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f5c410f9e2ffc9286279a46f2e8c107edaf3b1123510af59c828a9c15b23c9db", size = 825424, upload-time = "2026-11-20T23:35:07.783Z" },
{ url = "https://files.pythonhosted.org/packages/44/00/fc5d40087cc55bf3d7bb5ef55cc3e6513e6946afe33a188680fe1d846eb0/pyyaml-6.0.4-cp312-cp312-win32.whl", hash = "sha256:60e9da2772e259307650e03c24f50e3bc2d9fa5ed1ba44c47582e13b0e7708d1", size = 140667, upload-time = "2026-11-20T23:35:08.846Z" },
{ url = "https://files.pythonhosted.org/packages/a3/95/307a6ceafbad9a08300743d19329c31726224e583e05c4fe5358522ba283/pyyaml-6.0.4-cp312-cp312-win_amd64.whl", hash = "sha256:131d11bd9b60d705a6388366d77ed67850995a4d2be85fe149785a257c17e531", size = 154452, upload-time = "2026-11-20T23:35:09.792Z" },
{ url = "https://files.pythonhosted.org/packages/62/81/15c300b14cca818cb9ee27d8cb61cc124229d04f4f7f7bc4e3fca8e2e8d8/pyyaml-6.0.4-cp312-cp312-win_arm64.whl", hash = "sha256:69380d4bae12aab2a2c9532deff6a2841bc9fda47c333691bd2368b696301768", size = 147167, upload-time = "2026-11-20T23:35:10.763Z" },
]
[[package]]
name = "qrcode"
version = "8.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "colorama", marker = "sys_platform == 'win32'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/8f/b2/7fc2931bfae0af02d5f53b174e9cf701adbb35f39d69c2af63d4a39f81a9/qrcode-8.2.tar.gz", hash = "sha256:35c3f2a4172b33136ab9f6b3ef1c00260dd2f66f858f24d88418a015f446506c", size = 43317, upload-time = "2025-05-01T15:44:24.726Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/dd/b8/d2d6d731733f51684bbf76bf34dab3b70a9148e8f2cef2bb544fccec681a/qrcode-8.2-py3-none-any.whl", hash = "sha256:16e64e0716c14960108e85d853062c9e8bba5ca8252c0b4d0231b9df4060ff4f", size = 45986, upload-time = "2025-05-01T15:44:22.781Z" },
]
[[package]]
name = "referencing"
version = "0.37.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "attrs" },
{ name = "rpds-py" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/22/f5/df4e9027acead3ecc63e50fe1e36aca1523e1719559c499951bb4b53188f/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8", size = 78036, upload-time = "2025-10-13T15:30:48.871Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/2c/58/ca301544e1fa93ed4f80d724bf5b194f6e4b945841c5bfd555878eea9fcb/referencing-0.37.0-py3-none-any.whl", hash = "sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231", size = 26766, upload-time = "2025-10-13T15:30:47.625Z" },
]
[[package]]
name = "respx"
version = "0.23.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "httpx" },
]
sdist = { url = "https://files.pythonhosted.org/packages/43/98/4e55c9c486404ec12373708d015ebce157966965a5ebe7f28ff2c784d41b/respx-0.23.1.tar.gz", hash = "sha256:242dcc6ce6b5b9bf621f5870c82a63997e8e82bc7c947f9ffe272b8f3dd5a780", size = 29243, upload-time = "2026-04-08T14:37:16.008Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/1d/4a/221da6ca167db45693d8d26c7dc79ccfc978a440251bf6721c9aaf251ac0/respx-0.23.1-py2.py3-none-any.whl", hash = "sha256:b18004b029935384bccfa6d7d9d74b4ec9af73a081cc28600fffc0447f4b8c1a", size = 25557, upload-time = "2026-04-08T14:37:14.613Z" },
]
[[package]]
name = "rpds-py"
version = "2026.9.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/42/68/3bd46b8a5e01d3c2ebdf9c5e9497912e3fe0cde02bac21a7130ca866e403/rpds_py-2026.9.1.tar.gz", hash = "sha256:4793ef7f78268b124b73fa933440f01d258bbae01de9fa53e9080c9ab0425a12", size = 63948, upload-time = "2026-10-04T16:32:36.469Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/5d/34/a828586ea3329fbb50895b50e9cf98ca3d924a9f41a0b26d443bff1b3794/rpds_py-2026.9.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:50906f5aea24b5a865cbd0a589698288631d9f3a54c3a937c83aefa95a0d14af", size = 346822, upload-time = "2026-10-04T16:29:16.258Z" },
{ url = "https://files.pythonhosted.org/packages/90/81/ac6a0d064982251856ce009c9e1dd51a34110b3c055aa7d1aad18b4899a3/rpds_py-2026.9.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e21c1429e205828ea886a2293a4a2c8e01f4c25d9893ca330e97a6cf73f52e7b", size = 341380, upload-time = "2026-10-04T16:29:17.706Z" },
{ url = "https://files.pythonhosted.org/packages/42/ff/bf7d54f362748fd6a49277b9d6531c394074110fedf50ad791ec59133fbb/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2693b2728bbcc48d09a981a356954b0c47c53ff25b545856f28a889ea619f69a", size = 373053, upload-time = "2026-10-04T16:29:19.063Z" },
{ url = "https://files.pythonhosted.org/packages/60/de/74b0ccdbbd28687b9b5fdb34c1cabed88352182facaced9d6f5486b8b9ed/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8601470267d938bcb7f3ab1a336100af51a4fd5b6ed030ef52461bb3ef5e7e07", size = 377742, upload-time = "2026-10-04T16:29:20.543Z" },
{ url = "https://files.pythonhosted.org/packages/c2/6d/b979775a3057b2a5c26d75ecbff60a20a24ef081db6dd76836fca3f20247/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3890a6aa36e6baa53d5258a2a25d3ef8b37ad165a6ab27a892d7c3e3a432cd69", size = 487289, upload-time = "2026-10-04T16:29:21.958Z" },
{ url = "https://files.pythonhosted.org/packages/1d/5d/7c34734ce3ece943d9d6ee0122a74a21bbc75b47acb5b7053c83f6efb1ed/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6b5b393eda5ea42cca1c1a6665f2a4882b4fd5d1777e41ce0545a107fb008c9d", size = 390710, upload-time = "2026-10-04T16:29:23.378Z" },
{ url = "https://files.pythonhosted.org/packages/1d/6d/b26eb1e75395925b3a142ed351cbed2ec8212f5c9d937aee3df32c701baa/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:addeda51556dac7c1a2f14cda62db8b621cd12afba3091d03a96c72932387eab", size = 371261, upload-time = "2026-10-04T16:29:25.1Z" },
{ url = "https://files.pythonhosted.org/packages/7c/98/b2fdfe10301a9e27af21e634337fbba7baac0bc17fe44619a17c26bba2cb/rpds_py-2026.9.1-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:d9edf30457d74eebfd76b045535e36f1cd89062566a128a0db2145ca042d787e", size = 376075, upload-time = "2026-10-04T16:29:26.748Z" },
{ url = "https://files.pythonhosted.org/packages/c5/b1/c4b8d954e49c3c69cf8063c0c9e0919c99f3d2cecc46311606a1cbe835dc/rpds_py-2026.9.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:815d26356930846a40c7bc1366e7b1b0320ab8a063e66c11298a208bed0fd237", size = 399358, upload-time = "2026-10-04T16:29:28.282Z" },
{ url = "https://files.pythonhosted.org/packages/b3/59/9559a7293c97dff0cbb293efffbd36644103883ecc27741af8ef90c84ca8/rpds_py-2026.9.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3b5a6f40f0a1486b4b36c888123afc67acdbd9f33235927acf5ff295429a0ba3", size = 550267, upload-time = "2026-10-04T16:29:29.851Z" },
{ url = "https://files.pythonhosted.org/packages/6c/9d/6dc60e49511de4c8b00e74f9c1d43aed4d27f712cdb1ade92f2c199cbf64/rpds_py-2026.9.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b5b8b0753718d258fd454283fbd57e14545d3b40583fa672e27cb4f987626bcc", size = 614018, upload-time = "2026-10-04T16:29:31.54Z" },
{ url = "https://files.pythonhosted.org/packages/fb/bc/92a4ecf27301b886232a413360f6b348a81d55ffef654f2ebda5970ebc3d/rpds_py-2026.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:46d80bc76b51a6c24f9944368c28d38b8bcbcea1da4f2f8d3ebc31a67e8c6ec6", size = 578509, upload-time = "2026-10-04T16:29:33.01Z" },
{ url = "https://files.pythonhosted.org/packages/08/53/efb97f2e6589b7ab8394385a73870e0b2ab2a195281c117b21fd6d7d4855/rpds_py-2026.9.1-cp312-cp312-win32.whl", hash = "sha256:befc2d6a953e563f8a7bfd87a42c22ebf8a3e980dcb7b6a4d17b70b0e914e8a3", size = 205401, upload-time = "2026-10-04T16:29:34.451Z" },
{ url = "https://files.pythonhosted.org/packages/1c/84/1700cc748d0eaa747486e4e82882d2575224e6e9a3148df583058850c629/rpds_py-2026.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:5ce8943f79c2210f7abcc28e86367b03b28d95027fd01c46d2472373ae70c86f", size = 222923, upload-time = "2026-10-04T16:29:35.709Z" },
{ url = "https://files.pythonhosted.org/packages/c3/89/0302215373c2f8b4408b0fdfee955368cc378a98ff59508d47a7e0dc2dbf/rpds_py-2026.9.1-cp312-cp312-win_arm64.whl", hash = "sha256:501909f2e4a1e2dee528ef766fe3c469060ebc17e54a8383d404ba07a81a6f02", size = 218415, upload-time = "2026-10-04T16:29:37.263Z" },
{ url = "https://files.pythonhosted.org/packages/a3/90/a9ba81408369d34c1aca73319c15adc91ed45c1d21e9e8ee4832ffb7fe0b/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6cdc537c8633d7fd92a82e2e0d2ab74320a3f63d5e59fb9cf08711e08fe151c4", size = 381109, upload-time = "2026-10-04T16:32:08.994Z" },
{ url = "https://files.pythonhosted.org/packages/b3/44/5192a0bed94cec86bd2a5e1cc5a1bb8f7eec3aec907eacd2deb13e87e326/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:10e208f2425d973938afcd56e28a7c4be32e27b6a60b5d381f49fb9d8acf9759", size = 388222, upload-time = "2026-10-04T16:32:11.321Z" },
{ url = "https://files.pythonhosted.org/packages/92/cd/5356549711448f18b52f7a11ffbe90f1228774996fbf3c6cd1b18d22abaf/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c0dbbcc19735fe5f8b0a54c07659d154a9e69f47e15d0a6ab7299215daf62cb", size = 500384, upload-time = "2026-10-04T16:32:13.478Z" },
{ url = "https://files.pythonhosted.org/packages/7a/88/ddda9d28adfe33119c75b2e733d4ba7e326f41d7e1b1093951771768ca48/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:684fd492fff4fead00587544e059be2bbcb6f93454f21fa2a91b66fc7508be82", size = 401661, upload-time = "2026-10-04T16:32:15.653Z" },
{ url = "https://files.pythonhosted.org/packages/32/c3/bb59ba16a6b4a57995d15b8c04c00f28df3b938c4dcdde48fbe0f73edb0c/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1028417bb44037eb3069c1009bd7b7277212876cda22fbe565b0bca9fab6d2c", size = 380748, upload-time = "2026-10-04T16:32:17.727Z" },
{ url = "https://files.pythonhosted.org/packages/f5/b8/0580faa1c5a32ddc160130dd7ae54d2d007272a89a40a6b5db3e50f9f585/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:492e5e428cbe126221611f47e068f01660352feec4ad18bc0f5ea9b2ae88fb14", size = 385731, upload-time = "2026-10-04T16:32:19.855Z" },
{ url = "https://files.pythonhosted.org/packages/bf/70/f73564642bbe3322c7eeef2c2f258cf040b71c41a430b532e59d04a1b838/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:88b5268892fde430d5531f95bc560b6efbbd67c929662c586afd729a96e7461c", size = 412131, upload-time = "2026-10-04T16:32:22.285Z" },
{ url = "https://files.pythonhosted.org/packages/8c/5d/17fff2e1f8f68721a2afb5cb48f7e442c751bb6b4883157c5abaf618cd08/rpds_py-2026.9.1-pp312-pypy312_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:01445c8d194aa032a08e944f16567672da1c62dbdbefd8b6d0693032e290cf68", size = 558193, upload-time = "2026-10-04T16:32:24.4Z" },
{ url = "https://files.pythonhosted.org/packages/2a/d0/869ab6fb08531f97aae4a780b4d61b4190d8aef48fe054ee28bcf7114466/rpds_py-2026.9.1-pp312-pypy312_pp73-musllinux_1_2_i686.whl", hash = "sha256:eef6a03b0b6d08d0835ccfa8ec8d1bc70525e3801387567137b50c557695e6da", size = 622448, upload-time = "2026-10-04T16:32:26.844Z" },
{ url = "https://files.pythonhosted.org/packages/ba/a5/9672e532fe02cd3b92c78cfd8743abca939d96853006c63835009a1ecb6f/rpds_py-2026.9.1-pp312-pypy312_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:6b9bf3135b4ad5981df9a73d71a35272d650a2985ae9c2746357b24d59de2448", size = 591126, upload-time = "2026-10-04T16:32:29.274Z" },
{ url = "https://files.pythonhosted.org/packages/80/ef/3a9f8e4279c7920af561deed4cb7ebebed2794a8f608cf404d5eef14a105/rpds_py-2026.9.1-pp312-pypy312_pp80-macosx_10_12_x86_64.whl", hash = "sha256:56c6952a9b15047466d0c2347c446a761d4527f89976156341e68f0ce5cc08b0", size = 357108, upload-time = "2026-10-04T16:32:31.641Z" },
{ url = "https://files.pythonhosted.org/packages/b7/55/4b2fa381a583760aea5c92841e4e928a358e1c6511b129219e9c2826a226/rpds_py-2026.9.1-pp312-pypy312_pp80-macosx_11_0_arm64.whl", hash = "sha256:b242c27c8f836305a4a72df9cdd564386ac57b807bd252a063223331c9316b37", size = 346877, upload-time = "2026-10-04T16:32:34.061Z" },
]
[[package]]
name = "ruff"
version = "0.17.6"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/df/8e/6929d337aa5380aafc7355f3149f3ccfe55cba5fdd34a045697ebaceb5a0/ruff-0.17.6.tar.gz", hash = "sha256:2b04276561331300325040bdca21460770029ec574d4c479099e39e8ad1ed43c", size = 5374388, upload-time = "2026-11-19T15:56:27.106Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/12/5d/38ef6310c22cacb094e9ae0ff7964062e04ffeecb45ee296894c2b1acc54/ruff-0.17.6-py3-none-linux_armv6l.whl", hash = "sha256:084d9c8f5ec718e7eba007dba339e7cb4f7571d2f267558ae080bf428fb6a69b", size = 10174693, upload-time = "2026-11-19T15:55:52.414Z" },
{ url = "https://files.pythonhosted.org/packages/a2/ed/fd35261049920a4888ef7c787a5c27089502077a4910f6ca8f1213157d6d/ruff-0.17.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9d44ef2140402043fd6f689ef541858b80883a8b0a02e38539ef0614ebe57d0c", size = 10221650, upload-time = "2026-11-19T15:55:54.962Z" },
{ url = "https://files.pythonhosted.org/packages/ba/d4/c31391b36c729cd9fafa65b7a52a58850b99afb2b65da6be4263a53302f2/ruff-0.17.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:9fbddc08577592e283c265d865e0182de6e33db185494db7b06290d989d888e5", size = 9580986, upload-time = "2026-11-19T15:55:57.391Z" },
{ url = "https://files.pythonhosted.org/packages/eb/11/f3032684dcb3a676d7924545153d76fb56f76753e038f2ea650b99c71bdf/ruff-0.17.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:435241c61af5909a022f76219d3d1bf24730dc1bf0acabb5ddf4b569ab3cbb30", size = 10271368, upload-time = "2026-11-19T15:55:59.654Z" },
{ url = "https://files.pythonhosted.org/packages/08/30/c1e024eeb5bae99ae78c6b896ed108f64c9c845a03b56eaeff098e99b6e6/ruff-0.17.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d006bbb2945edb17b0ce6a0c1b5f5a8d81ba11dbac294a0a925effa22ce34feb", size = 9981564, upload-time = "2026-11-19T15:56:01.807Z" },
{ url = "https://files.pythonhosted.org/packages/7d/a5/da3e0c2d4bf02b3ca6c1d7fa4bb04d0081e340b1dd03c4f83b1bec3e15c1/ruff-0.17.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fd661702202a89c00a4c9d0339008805fa5876bfa1c57e165495c2e62230dfbf", size = 10641991, upload-time = "2026-11-19T15:56:03.981Z" },
{ url = "https://files.pythonhosted.org/packages/4d/c1/6d7f981e86201c9db457cca99fd2c09b77574ebab37dff3e9239b218603c/ruff-0.17.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6a12c50a33936dc00db2be21ba25fb168a8b95c55eda2a3ac85005af69885e4b", size = 11403484, upload-time = "2026-11-19T15:56:05.778Z" },
{ url = "https://files.pythonhosted.org/packages/c3/92/8182f07b94998541d5f8f38f53da465aa28062afce24ecc398f45bfc62f1/ruff-0.17.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b5aba93b3db4b70c5697e4fee6e0d5b9c8452a9a3a03679611cadc25915a2173", size = 10892316, upload-time = "2026-11-19T15:56:08.016Z" },
{ url = "https://files.pythonhosted.org/packages/be/48/3df7d81249fd69ee6a49519b149fb5d11e13118fd7d0e8d65329a237087b/ruff-0.17.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa3b08254a732acba246891089a152c47c5733dc36b8ecb76ce8602f8326e5e4", size = 10645279, upload-time = "2026-11-19T15:56:09.785Z" },
{ url = "https://files.pythonhosted.org/packages/71/80/4d232281544345d7beb98d1d32c24dae804ed360780a6f7753738b81225e/ruff-0.17.6-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:0692088e6b33455572fb18465e891b443f196e98dc1986825685c77ff6f4c5ac", size = 10534501, upload-time = "2026-11-19T15:56:11.718Z" },
{ url = "https://files.pythonhosted.org/packages/98/0a/b477f075a4a94eb541bf1c759a3e72b2a3d6390af7a13a5be0887229f67c/ruff-0.17.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:fb589e032806bb942e4fb526f30b80a1a64112147ed9f1d38cc3de2e255b6f45", size = 10136036, upload-time = "2026-11-19T15:56:13.779Z" },
{ url = "https://files.pythonhosted.org/packages/f1/d8/cf32fbfeb1fcda1470fb5c3bee50c69ee6bca257d487ec1eb17a0387edb4/ruff-0.17.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1939b3d701c7b6981b7cf93473de5bf88b129b9ba84efaed5154cc517c44634d", size = 9969640, upload-time = "2026-11-19T15:56:15.738Z" },
{ url = "https://files.pythonhosted.org/packages/a7/22/bb9f9752f7fcdfdc8b9c51576cc142bb377ade745290e35085173963c7be/ruff-0.17.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1a0bea6aa1216e0ec4cd35d3dbccec0d772a7c2aad28ec9c6e82571dff2c20b0", size = 10389427, upload-time = "2026-11-19T15:56:17.617Z" },
{ url = "https://files.pythonhosted.org/packages/81/c7/e09d220818ab146b736d62e0676dad215215d7de0884bbdad9fa075dc7d2/ruff-0.17.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:3db61f5015600543a581b07fa7f6f64afa0eeedefe16034cadd88c4074087582", size = 10760296, upload-time = "2026-11-19T15:56:19.463Z" },
{ url = "https://files.pythonhosted.org/packages/2e/09/28329441dfa2c463e2d377a69d4ebbe4d51665e9dbd49fb421f3bc80d775/ruff-0.17.6-py3-none-win32.whl", hash = "sha256:c2f4af6670b7a0501904e881bb3f1f24bd0d964dec1eedbd85f0eb73786e1128", size = 9966266, upload-time = "2026-11-19T15:56:21.581Z" },
{ url = "https://files.pythonhosted.org/packages/4b/9d/18ba9730addfc7554c70d6f171fb8dc2c08e774d9fb2b98e7946ef845c59/ruff-0.17.6-py3-none-win_amd64.whl", hash = "sha256:9cd2fd9923e9806b8b6b67a3469e2258e84bd4d21e45d5a1a690afdfb9c8e57d", size = 10365847, upload-time = "2026-11-19T15:56:23.582Z" },
{ url = "https://files.pythonhosted.org/packages/70/8a/59c33e2a64a4f9672f7f842a0dc522915cfbbaffd13d37d0cec57d1c5c5d/ruff-0.17.6-py3-none-win_arm64.whl", hash = "sha256:d8b14e1473dc86ab9069cf7a2ba5041dc012f59110201844ed04cfddf07055a0", size = 9926224, upload-time = "2026-11-19T15:56:25.269Z" },
]
[[package]]
name = "sqlparse"
version = "0.6.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/7e/e0/361c764ea58cc1a75f7b4b424a74b08449db8bfa5e9199c7275999fdd1b9/sqlparse-0.6.1.tar.gz", hash = "sha256:ca722573f848ff2d30e40ea30f53a104b7dea7635ea9285891263eb2c58fb6e7", size = 182236, upload-time = "2026-11-01T18:06:45.951Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/df/ff/2fee788e82e75be8f210c65c5d103bf44c880e3769c884652a4cd911b8ba/sqlparse-0.6.1-py3-none-any.whl", hash = "sha256:3be5a72d04c873d690d7c6dedd33d6fae2ef82759881ceec02fc2efd0cba564f", size = 51200, upload-time = "2026-11-01T18:06:47.434Z" },
]
[[package]]
name = "typing-extensions"
version = "4.16.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" },
]
[[package]]
name = "tzdata"
version = "2026.6"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/7a/29/6a1391d31cd00ff9e927215a224a880e1e84e826b64ba80a499e51c074d8/tzdata-2026.6.tar.gz", hash = "sha256:85d2cd9c09f81f0bb29db27759fc83af4f1e620efb814f8c5bf8b4cc4feece6d", size = 201017, upload-time = "2026-10-28T09:57:09.137Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/0a/66/9a06c2227fedfd4919f0eaaa8b94377d9730882a7e4f95823c9a331ab5e1/tzdata-2026.6-py2.py3-none-any.whl", hash = "sha256:0a10eec6e13ef16b627fabed9a5f2ba61a62b1c67f327305f4e7e412a70b4aec", size = 348210, upload-time = "2026-10-28T09:57:07.276Z" },
]
[[package]]
name = "uritemplate"
version = "4.2.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/98/60/f174043244c5306c9988380d2cb10009f91563fc4b31293d27e17201af56/uritemplate-4.2.0.tar.gz", hash = "sha256:480c2ed180878955863323eea31b0ede668795de182617fef9c6ca09e6ec9d0e", size = 33267, upload-time = "2025-06-02T15:12:06.318Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a9/99/3ae339466c9183ea5b8ae87b34c0b897eda475d2aec2307cae60e5cd4f29/uritemplate-4.2.0-py3-none-any.whl", hash = "sha256:962201ba1c4edcab02e60f9a0d3821e82dfc5d2d6662a21abd533879bdb8a686", size = 11488, upload-time = "2025-06-02T15:12:03.405Z" },
]
+37
View File
@@ -0,0 +1,37 @@
# Environnement de développement. La production (nginx, HTTPS) sera ajoutée au lot 5.
services:
web:
build:
context: backend
args:
UV_SYNC_ARGS: ""
command: python manage.py runserver 0.0.0.0:8000
env_file: .env
volumes:
- ./backend:/app
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
db:
image: postgres:17
environment:
POSTGRES_DB: prism
POSTGRES_USER: prism
POSTGRES_PASSWORD: prism
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U prism -d prism"]
interval: 5s
retries: 10
mailpit:
image: axllent/mailpit
ports:
- "8025:8025"
volumes:
pgdata:
@@ -61,7 +61,7 @@ flowchart LR
| Couche | Choix | | Couche | Choix |
|---|---| |---|---|
| Front-end | Vue 3, Vite, TypeScript, Vue Router, vue-i18n (français) ; état partagé via un simple `ref`/composable (Pinia seulement si le besoin apparaît) | | Front-end | Vue 3, Vite, TypeScript, Vue Router, vue-i18n (français) ; état partagé via un simple `ref`/composable (Pinia seulement si le besoin apparaît) |
| Carte et UI | Leaflet (couches WMS/INSPIRE) ; **Bootstrap 5 (CSS seul)**, sans bibliothèque de composants Vue ni JavaScript Bootstrap : les composants (alertes, modales, onglets) sont de petits composants Vue maison | | Carte et UI | **MapLibre GL JS** (fond de carte OpenStreetMap, couches WMS/INSPIRE en sources raster, contrôles de navigation, d'échelle et d'attribution) ; **Bootstrap 5 (CSS seul)**, sans bibliothèque de composants Vue ni JavaScript Bootstrap : les composants (alertes, modales, onglets) sont de petits composants Vue maison |
| Back-end | Python 3.12, Django 5 (LTS), Django REST Framework, drf-spectacular (OpenAPI) | | Back-end | Python 3.12, Django 5 (LTS), Django REST Framework, drf-spectacular (OpenAPI) |
| Géospatial | GeoDjango, PostgreSQL + PostGIS (index GiST), rasterio pour les rasters d'air | | Géospatial | GeoDjango, PostgreSQL + PostGIS (index GiST), rasterio pour les rasters d'air |
| HTTP sortant | httpx, requêtes parallèles avec timeouts | | HTTP sortant | httpx, requêtes parallèles avec timeouts |
@@ -256,7 +256,7 @@ sequenceDiagram
- **Écran principal** : saisie de l'adresse, puis résultats par facteur (carte avec marqueur et couches INSPIRE, pastille de couleur, légende, résumé santé, pistes d'action). Objectif : un diagnostic lisible en quelques secondes, utilisable sur ordinateur portable. - **Écran principal** : saisie de l'adresse, puis résultats par facteur (carte avec marqueur et couches INSPIRE, pastille de couleur, légende, résumé santé, pistes d'action). Objectif : un diagnostic lisible en quelques secondes, utilisable sur ordinateur portable.
- **Pages d'accès** (connexion, inscription, vérification de l'e-mail, mot de passe oublié, réinitialisation) et états d'erreur par facteur (donnée absente, service indisponible). - **Pages d'accès** (connexion, inscription, vérification de l'e-mail, mot de passe oublié, réinitialisation) et états d'erreur par facteur (donnée absente, service indisponible).
- **Aucune identité graphique à créer** ; iconographie simple et cohérente pour les 4 facteurs et les 4 couleurs. - **Aucune identité graphique à créer** ; iconographie simple et cohérente pour les 4 facteurs et les 4 couleurs.
- **Dépendances front limitées** : Vue, Vue Router, vue-i18n, Leaflet, Bootstrap (CSS) et ses icônes SVG (Bootstrap Icons). Pas de framework de composants, pas de jQuery. - **Dépendances front limitées** : Vue, Vue Router, vue-i18n, MapLibre GL JS, Bootstrap (CSS) et ses icônes SVG (Bootstrap Icons). Pas de framework de composants, pas de jQuery.
- Les rôles et droits sont gérés côté serveur ; le front n'affiche que ce que l'API autorise. - Les rôles et droits sont gérés côté serveur ; le front n'affiche que ce que l'API autorise.
## 7 bis. Pages à développer ## 7 bis. Pages à développer
@@ -719,6 +719,7 @@ gantt
| 9 | Délivrabilité des e-mails (SPF/DKIM/DMARC, domaine d'expédition, serveur SMTP) | Choisir le domaine et configurer le DNS en lot 1 ; test d'envoi vers Gmail/Outlook et messageries de cabinet | | 9 | Délivrabilité des e-mails (SPF/DKIM/DMARC, domaine d'expédition, serveur SMTP) | Choisir le domaine et configurer le DNS en lot 1 ; test d'envoi vers Gmail/Outlook et messageries de cabinet |
| 10 | Validation des inscriptions : la cellule SSMG doit traiter les demandes dans un délai raisonnable ; n° INAMI non vérifié automatiquement | Définir qui reçoit les notifications et le délai de réponse ; vérification manuelle | | 10 | Validation des inscriptions : la cellule SSMG doit traiter les demandes dans un délai raisonnable ; n° INAMI non vérifié automatiquement | Définir qui reçoit les notifications et le délai de réponse ; vérification manuelle |
| 11 | Perte d'appareil 2FA | Procédure de réinitialisation par la cellule SSMG (Django admin) | | 11 | Perte d'appareil 2FA | Procédure de réinitialisation par la cellule SSMG (Django admin) |
| 12 | Fond de carte : les serveurs de tuiles publics d'OpenStreetMap ne sont pas prévus pour un usage en production | Choisir un fournisseur de tuiles (service payant ou tuiles hébergées par Champs Libres, par exemple OpenMapTiles/Protomaps) et un style MapLibre avant la mise en production ; conserver la mention « © OpenStreetMap contributors » |
## 12. Critères de recette ## 12. Critères de recette