semvec/pypi-packages huggingface dataset:
django-brotli 0.4.0
Middleware that compresses response using brotli algorithm.
License: MIT
Requires Python: <3.15,>=3.10

# Django Brotli: *Middleware that compresses response using brotli algorithm*

[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![pypi](https://img.shields.io/badge/code%20style-The%20Ruff%20Formatter-000000.svg)](https://docs.astral.sh/ruff/formatter/)
[![pypi](https://img.shields.io/pypi/v/django-brotli.svg)](https://pypi.org/project/django-brotli/)
[![Python version](https://img.shields.io/pypi/pyversions/django-brotli.svg?logo=python&logoColor=white&label=python)](https://pypi.org/project/django-brotli/)
![Supported Django](https://img.shields.io/badge/django%20versions-%5E4.2%20||%20%5E5.0%20||%20%5E6.0-blue.svg?logo=django&logoColor=white)
<br>
[![Build Status](https://github.com/illagrenan/django-brotli/actions/workflows/development.yml/badge.svg)](https://github.com/illagrenan/django-brotli/actions/workflows/development.yml)
[![codecov](https://codecov.io/gh/illagrenan/django-brotli/branch/main/graphs/badge.svg)](https://codecov.io/github/illagrenan/django-brotli)

* PyPI: <https://pypi.org/project/django-brotli/>
* License: [MIT](https://choosealicense.com/licenses/mit/)

## Introduction

This project consists of `BrotliMiddleware` which works the same as Django `GZipMiddleware` ([Docs](https://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.gzip)/[Source](https://github.com/django/django/blob/master/django/middleware/gzip.py#L10-L52)). `BrotliMiddleware` will compress content of HTTP response using brotli algorithm (Brotli Compressed Data Format is defined in [RFC 7932](https://www.ietf.org/rfc/rfc7932.txt)).

In November 2016 is brotli supported by Firefox, Chrome, Android Browser and Opera (detailed stats on [caniuse](http://caniuse.com/#search=brotli)). Brotli is applied only when client has sent `Accept-Encoding` header containing `br`.

## Installation

- Supported Python versions are: `">=3.10, <3.15"`.
- Supported Django versions are: `>=4,<7`.

```console
poetry add django-brotli@latest
```

*or*

```console
pip install --upgrade django-brotli
```

Add `django_brotli.middleware.BrotliMiddleware` to `MIDDLEWARE`:

```python
MIDDLEWARE = [
    'django_brotli.middleware.BrotliMiddleware',
    # ...
]
```

## Credits and Resources

- [Brotli on Wikipedia](https://en.wikipedia.org/wiki/Brotli)
- [Brotli compression format repository by Google](https://github.com/google/brotli)

## Contributing

1. Clone this repository (`git clone ...`)
2. Install package dependencies: `poetry install --with dev -v`
3. Change some code
4. Run tests: in project root simply execute `pytest`
5. Submit PR :)

## License

[The MIT License (MIT)](./LICENSE)
api-iffendic 1.0.0
API REST pour la gestion des menus du restaurant municipal d'Iffendic
License: MIT
Requires Python: <4.0,>=3.12
Keywords: flask, api, rest, menus, iffendic, restaurant

# API Iffendic

API REST pour la gestion des menus du restaurant municipal d'Iffendic.

[![PyPI version](https://badge.fury.io/py/api-iffendic.svg)](https://badge.fury.io/py/api-iffendic)
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)

## 🚀 Installation

### Via PyPI (recommandé)

```bash
pip install api-iffendic
```

### Depuis les sources

```bash
git clone https://github.com/tdenolle/api-iffendic.git
cd api-iffendic
poetry install
```

## 📖 Démarrage rapide

### Utilisation de la CLI

```bash
# Lancer le serveur de développement
api-iffendic run --port 5000

# Initialiser la base de données
api-iffendic init-db --config config.yaml

# Afficher la version
api-iffendic version
```

### Utilisation programmatique

```python
from api_iffendic.app import create_app

app = create_app()
app.run(host='0.0.0.0', port=5000)
```

### Configuration

Créer un fichier `config.yaml` :

```yaml
SQLALCHEMY_DATABASE_URI: "sqlite:///app.db"
SECRET_KEY: "votre-clé-secrète"
OPEN_DATA_MENUS_URL: "https://www.data.gouv.fr/fr/datasets/r/c671d049-7c09-4a69-8008-c82c0f589fcb"
LOGGING_FILE_PATH: "app.log"
```

## 🚀 Déploiement en production

### Avec Gunicorn

```bash
pip install api-iffendic gunicorn

# Créer un fichier wsgi.py
cat > wsgi.py << 'EOF'
from api_iffendic.app import create_app
app = create_app()
EOF

# Lancer avec Gunicorn
gunicorn --bind 0.0.0.0:5000 --workers 4 wsgi:app
```

### Configuration serveur

Voir la [documentation de déploiement](DEPLOYMENT.md) pour des instructions complètes sur :
- Configuration systemd
- Configuration nginx
- HTTPS avec Let's Encrypt

## 📚 Documentation

- [Guide de déploiement](DEPLOYMENT.md) - Instructions détaillées pour déployer l'application sur différentes plateformes cloud

## ✨ Features

1. Simple validation
2. REST API friendly
3. Basic JWT auth with different audience
4. SQLAlchemy integrated
5. Synchronisation des menus depuis Open Data

## 🧪 Tests

```bash
# Lancer tous les tests
poetry run pytest tests/

# Tests avec coverage
poetry run pytest tests/ --cov=api_iffendic
```

## 📦 CI/CD

L'application utilise GitHub Actions pour :
- ✅ Exécuter les tests automatiquement
- ✅ Builder et publier les images Docker
- ✅ Linting avec flake8

Voir les workflows dans `.github/workflows/`

## 🛠️ Développement

### Base de données

```bash
# Migrations
flask db migrate -m "Description"
flask db upgrade
```


5. Run tests `poetry run pytest tests`

3. Run server `poetry run flask run` or `poetry shell && flask run`
lensify 0.2.0
Lensify upgraded local semantic search
License: MIT
Requires Python: >=3.8

# Lensify — Upgraded Local Semantic Search Engine (drop-in ready)

This upgraded Lensify prototype includes the following accuracy improvements:
- FAISS HNSW index for fast, high-recall retrieval
- Support for high-quality embedding models (BAAI/bge-*/sentence-transformers)
- Cross-Encoder re-ranker (ms-marco or similar) for final ranking
- Sentence-boundary chunking with overlap
- Text normalization and query expansion
- New CLI commands: doctor, stats, rebuild, query, export

IMPORTANT:
- Large models (BGE large, cross-encoders) are optional but recommended.
- To get best results install dependencies:
  pip install -r requirements.txt

Quickstart:
1. Install dependencies (recommended): pip install -r requirements.txt
2. Rebuild index: lensify rebuild /path/to/docs
3. Query: lensify query /path/to/docs "payment risk simulation" --k 5
4. Use doctor to check environment: lensify doctor

Notes:
- This is a prototype. For production usage ensure you have enough RAM and disk for large models.