Mini moteur web Python pour créer des sites web ultra simples sans framework
Project description
WebEnginePy
WebEnginePy est un module Python ultra simple conçu pour :
- Les débutants
- Les petits sites web
- Créer un service HTTP sans framework complexe
installation
pip install webenginepy
minimun
python <python 3.7 recommendé <python 3.8
Fonctionnalités principales
web.app: Déclare une page HTML (application)web.route: Définit des routes pour boutons, fichiers statiques, etc.web.tool: Ajoute des outils ou scripts Python qui modifient le HTML
structure
engine.py (fichier principal) index.html (page principale) pages/ (pages secondaires) server/ (fichiers statiques) tools/ (outils)
notes
Les fichiers statiques doivent être accessibles via web.route("server/nom_du_fichier")
Les outils Python doivent définir une fonction apply(html) qui reçoit le HTML et retourne le HTML modifié
Le serveur supporte plusieurs requêtes simultanées grâce au multithreading et au cache pour accélérer le chargement
Exemple d’utilisation
import webenginepy as web
# Page principale
with web.app('/', "index.html"):
web.route("server/style.css") # CSS statique
web.route("button:Dashboard", "/dashboard") # bouton vers dashboard
web.tool("hello") # outil Python pour injecter du contenu
# Page secondaire
with web.app('/dashboard', "pages/dashboard.html"):
web.route("server/style2.css")
web.route("button:Accueil", "/") # bouton vers page principale
# Lancer le serveur
web.run(port=5000, host="0.0.0.0")
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.3.tar.gz.
File metadata
- Download URL: webenginepy-1.2.3.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 |
c08aecffc164836e1e50d6282fe5ecfd556a764eb8a23f50fd00e9aea23fbee9
|
|
| MD5 |
6c4720284452fb2cea2e8a83ec9bb802
|
|
| BLAKE2b-256 |
6a3777cf5cc08171820ac57e24e7c94a10941569c3af673f7e910181f372b702
|
File details
Details for the file webenginepy-1.2.3-py3-none-any.whl.
File metadata
- Download URL: webenginepy-1.2.3-py3-none-any.whl
- Upload date:
- Size: 4.7 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 |
ec798f5855f30cf715d132f3c49e20393cf33072b95363bb206a4886316e37b6
|
|
| MD5 |
0e5d44f8eefb08832e6bcca808b79bca
|
|
| BLAKE2b-256 |
9cfdbfbcc04bb0c1523ed5e34393b7afe90f7f77ba2ff96522e15fe2f3a46968
|