a custom web server module.
Project description
AServer
A lightweight, Python web framework built using Python.
Designed for simplicity, learning, and fast prototyping.
Features
- 🚀 Zero dependencies (pure Python)
- 🛣️ Simple dictionary-based routing
- 🎯 Flask-style decorator support
- 📄 HTML template rendering with jinja-like syntax
- ⚡ Fast lightweight HTTP server
- 🔧 Easy to extend into a full framework
Installation
pip install aserver
Usage Example
Basic Server Setup
from aserver import ServerHTTP
data = {
"name": "Aadi",
"title": "AServer"
}
server = ServerHTTP(
("127.0.0.1", 1111),
"index.html",
data=data
)
@server.serve()
def routes():
return {
"/": "index.html",
"/about": "about.html"
}
HTML Template Example
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
</head>
<body>
<h1>Welcome {{ name }}</h1>
</body>
</html>
Routing Example
{
"/<id>": "index.html",
"/about": "about.html",
"/contact": "contact.html"
}
How It Works
- Server listens on host and port
- Matches request path with route dictionary
- Loads corresponding HTML file
- Replaces {{ variables }} using provided data and uses {{ params }} for the variables inside urls along with {% for %} and {% if %} as well as their opposites
Contact
email: aadisankar1001@gmail.com
License
MIT License © 2026
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aserver-0.2.1.tar.gz
(4.4 kB
view details)
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 aserver-0.2.1.tar.gz.
File metadata
- Download URL: aserver-0.2.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
824d5349e5569512b4e3666bf50b0a43b1316c3d4491390628ab1eab034c9fc8
|
|
| MD5 |
0a054e0e011ce3d9b6c5f88684718717
|
|
| BLAKE2b-256 |
35890eab70714416532cbdf218bb6cb61c72f49b346c118ba1ee5cdd243424cc
|
File details
Details for the file aserver-0.2.1-py3-none-any.whl.
File metadata
- Download URL: aserver-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db5e8ea76f03c03fe8717a3c560302f7bbba19e9659e9fa2b83cbda152e0675a
|
|
| MD5 |
5913ff60d8bda34c5b36705667b1dcb3
|
|
| BLAKE2b-256 |
f38d0657df225c6dd733c94195002eed1675af931f83959fb191b01882e5b7e8
|