Mini moteur web Python pour créer des sites web ultra simples sans framework
Project description
WebEnginePy
WebEnginePy est un mini moteur web en Python permettant de créer des sites web très simples sans framework externe.
Le module fournit :
- un serveur HTTP intégré
- un système de routes HTML
- le service de fichiers statiques
- un système d’outils (plugins) appliqués aux pages
Aucune dépendance externe n’est requise.
Installation
pip install webenginepy
Principe
Chaque URL est associée à un fichier HTML
Les fichiers statiques sont servis depuis le dossier server/
Les outils sont des scripts Python appliqués au HTML avant envoi
Structure minimale d’un projet
project/ ├── main.py ├── index.html ├── pages/ │ └── page2.html ├── server/ │ └── style.css └── tools/ └── exemple.py
Exemple de site
Exemple : moteur (engine.py)
import webenginepy as web
with web.app("/", "index.html"): web.app("/page2", "pages/page2.html") web.app("server/style.css)
with web.app("page2", "page2.html") web.app("server/style.css")
web.run(host=0.0.0.0 port=5000)
index.html
Accueil
Aller à la page 2server/style.css
body { font-family: Arial; }
tools/exemple.py
def apply(html: str) -> str: return html.replace("", "")
POUR PLUS D'INFOS
Aller sur
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webenginepy-1.2.2.tar.gz.
File metadata
- Download URL: webenginepy-1.2.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5de9ec61b32bf70af3d9be55f6392203665636cb557d4af583df7c2d509925d7
|
|
| MD5 |
82ffc308bcfbe010eabe449f46060a08
|
|
| BLAKE2b-256 |
7823cbf0c0b7a6ffc9eea051df3a4386a06728a0ced4231e5bc1e46792a32bc7
|
File details
Details for the file webenginepy-1.2.2-py3-none-any.whl.
File metadata
- Download URL: webenginepy-1.2.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf2e8030ff1f7c4a7cf4db31360eb09bb7d985ba0bc3cf579dd3697349c362f9
|
|
| MD5 |
3298a734bd24fd4a93c7802419ab83b7
|
|
| BLAKE2b-256 |
d122c6d289c4b6b5ce8d22f627cce6de01e45d6d638f1a0e3a85fa59310e3824
|