webenginepy 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 GabiMinecraft02
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.4
2
+ Name: webenginepy
3
+ Version: 0.1.0
4
+ Summary: Mini moteur Python pour créer des sites web ultra simples
5
+ Author-email: Ton Nom <ton.email@example.com>
6
+ License: MIT
7
+ Keywords: web,engine,python,site,mini
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: License
14
+ Dynamic: license-file
15
+
16
+ -webenginepy
17
+
18
+ Mini moteur Python pour créer des sites web ultra simples.
19
+
20
+ -Installation
21
+
22
+ pip install webenginepy
23
+
24
+ Exemple d'utilisation
25
+
26
+ engine.py:
27
+ # Déclarer des pages
28
+ app("/", "index.html")
29
+ app("/contact", "pages/contact.html")
30
+
31
+ # Activer un outil si besoin
32
+ tool("seo")
33
+
34
+ # Lancer le serveur
35
+ run(port=8080)
36
+
37
+ webenginepy/
38
+ │── engine.py
39
+ │──index.html
40
+ ├── pages/
41
+ │ └── autrepage.html
42
+
43
+ ├── server/
44
+ │ └── css/style.css (autres script possibles)
45
+
46
+ ├── tools/
47
+ ├── exemple.py
@@ -0,0 +1,32 @@
1
+ -webenginepy
2
+
3
+ Mini moteur Python pour créer des sites web ultra simples.
4
+
5
+ -Installation
6
+
7
+ pip install webenginepy
8
+
9
+ Exemple d'utilisation
10
+
11
+ engine.py:
12
+ # Déclarer des pages
13
+ app("/", "index.html")
14
+ app("/contact", "pages/contact.html")
15
+
16
+ # Activer un outil si besoin
17
+ tool("seo")
18
+
19
+ # Lancer le serveur
20
+ run(port=8080)
21
+
22
+ webenginepy/
23
+ │── engine.py
24
+ │──index.html
25
+ ├── pages/
26
+ │ └── autrepage.html
27
+
28
+ ├── server/
29
+ │ └── css/style.css (autres script possibles)
30
+
31
+ ├── tools/
32
+ ├── exemple.py
@@ -0,0 +1,61 @@
1
+ from http.server import BaseHTTPRequestHandler, HTTPServer
2
+ import os
3
+
4
+ ROUTES = {}
5
+ TOOLS = []
6
+ BASE_DIR = os.getcwd()
7
+
8
+ def app(url, file):
9
+ """Déclare une page"""
10
+ ROUTES[url] = file
11
+
12
+ def tool(name):
13
+ """Active un outil"""
14
+ TOOLS.append(name)
15
+
16
+ def run(host="localhost", port=8000):
17
+ """Lance le serveur"""
18
+ class Handler(BaseHTTPRequestHandler):
19
+ def do_GET(self):
20
+ # ROUTES
21
+ if self.path in ROUTES:
22
+ file_path = os.path.join(BASE_DIR, ROUTES[self.path])
23
+ if not os.path.exists(file_path):
24
+ self.send_error(404)
25
+ return
26
+
27
+ html = open(file_path, "r", encoding="utf-8").read()
28
+
29
+ # Appliquer les outils
30
+ for t in TOOLS:
31
+ tool_path = os.path.join(BASE_DIR, "tools", f"{t}.py")
32
+ if os.path.exists(tool_path):
33
+ tool_code = {}
34
+ exec(open(tool_path).read(), tool_code)
35
+ if "apply" in tool_code:
36
+ html = tool_code["apply"](html)
37
+
38
+ self.send_response(200)
39
+ self.send_header("Content-type", "text/html")
40
+ self.end_headers()
41
+ self.wfile.write(html.encode())
42
+
43
+ # SERVER (static)
44
+ elif self.path.startswith("/server/"):
45
+ file_path = os.path.join(BASE_DIR, self.path[1:])
46
+ if os.path.exists(file_path):
47
+ self.send_response(200)
48
+ if file_path.endswith(".css"):
49
+ self.send_header("Content-type", "text/css")
50
+ elif file_path.endswith(".js"):
51
+ self.send_header("Content-type", "application/javascript")
52
+ self.end_headers()
53
+ with open(file_path, "rb") as f:
54
+ self.wfile.write(f.read())
55
+ else:
56
+ self.send_error(404)
57
+ else:
58
+ self.send_error(404)
59
+
60
+ print(f"Site lancé sur http://{host}:{port}")
61
+ HTTPServer((host, port), Handler).serve_forever()
@@ -0,0 +1,20 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel", "build"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "webenginepy"
7
+ version = "0.1.0"
8
+ description = "Mini moteur Python pour créer des sites web ultra simples"
9
+ authors = [
10
+ {name="Ton Nom", email="ton.email@example.com"}
11
+ ]
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ license = {text="MIT"}
15
+ keywords = ["web", "engine", "python", "site", "mini"]
16
+ classifiers = [
17
+ "Programming Language :: Python :: 3",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent"
20
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.4
2
+ Name: webenginepy
3
+ Version: 0.1.0
4
+ Summary: Mini moteur Python pour créer des sites web ultra simples
5
+ Author-email: Ton Nom <ton.email@example.com>
6
+ License: MIT
7
+ Keywords: web,engine,python,site,mini
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: License
14
+ Dynamic: license-file
15
+
16
+ -webenginepy
17
+
18
+ Mini moteur Python pour créer des sites web ultra simples.
19
+
20
+ -Installation
21
+
22
+ pip install webenginepy
23
+
24
+ Exemple d'utilisation
25
+
26
+ engine.py:
27
+ # Déclarer des pages
28
+ app("/", "index.html")
29
+ app("/contact", "pages/contact.html")
30
+
31
+ # Activer un outil si besoin
32
+ tool("seo")
33
+
34
+ # Lancer le serveur
35
+ run(port=8080)
36
+
37
+ webenginepy/
38
+ │── engine.py
39
+ │──index.html
40
+ ├── pages/
41
+ │ └── autrepage.html
42
+
43
+ ├── server/
44
+ │ └── css/style.css (autres script possibles)
45
+
46
+ ├── tools/
47
+ ├── exemple.py
@@ -0,0 +1,8 @@
1
+ License
2
+ README.md
3
+ engine.py
4
+ pyproject.toml
5
+ webenginepy.egg-info/PKG-INFO
6
+ webenginepy.egg-info/SOURCES.txt
7
+ webenginepy.egg-info/dependency_links.txt
8
+ webenginepy.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ engine