Skip to main content

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 2

server/style.css

body { font-family: Arial; }

tools/exemple.py

def apply(html: str) -> str: return html.replace("", "")

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

webenginepy-0.2.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

webenginepy-0.2.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file webenginepy-0.2.1.tar.gz.

File metadata

  • Download URL: webenginepy-0.2.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for webenginepy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f29aaa22af19900bb009f66879abd5a242bfbc0920c0572f89c42b37116bb4bd
MD5 4a1886e769e8a31c2085e84d49955823
BLAKE2b-256 5bf142be8e90194ee94f2898b7811097d3a3017cfd62a762b7dc988eafd3af0e

See more details on using hashes here.

File details

Details for the file webenginepy-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: webenginepy-0.2.1-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

Hashes for webenginepy-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84b650e2167d517af06ed092683f36c4bf3024bc50f3bebc16a135aff920de0b
MD5 1626b231c633de80a3a4f428b6aa29e6
BLAKE2b-256 7a169663b337a2dece4fc23bfc1caec9d44ea1c4d07d1916d7cba1bea03afac6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page