Skip to main content

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

{
    "/": "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

Contact

email: aadisankar1001@gmail.com

License

MIT License © 2026

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

aserver-0.2.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

aserver-0.2.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file aserver-0.2.0.tar.gz.

File metadata

  • Download URL: aserver-0.2.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aserver-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d48ace54c7687c50c5347d9a4fe58977b9094dae0647cda99f592007b92ccc90
MD5 5dff2139c14a0f91ebaf8968f3013f21
BLAKE2b-256 169c6ed950877eff7b18cba1490a715326ec37f03722129a5e8e65c1ff7bcb24

See more details on using hashes here.

File details

Details for the file aserver-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aserver-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aserver-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c527459dcde70da78197b5ffbce49b6e66c09489cc115345444fc1942cbc69ae
MD5 5d80aa66b04632696c95d8d7a34bebf0
BLAKE2b-256 c4bf964e1928d705b5cfa5bafc8cb30407e77c985b763af39f9ca421897d927c

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