Lightweight HTTP server framework
Project description
PyDobby
Lightweight HTTP server framework built on Python's socket programming using TCP.
Features
- Routing with path parameters support
- Query parameter parsing
- Middleware system for request/response processing
- Custom headers support
Installation
pip install pydobby
Usage
from pydobby import PyDobby, HTTPRequest, HTTPResponse
import json
import logging
app = PyDobby()
# Custom middleware example
class LoggingMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
logging.info(f"Request: {request.method} {request.path}")
response = self.get_response(request)
logging.info(f"Response: {response.status_code}")
return response
app.register_middleware(LoggingMiddleware)
# Basic route with path parameter
@app.get("/hello/<name>")
def hello(request: HTTPRequest, name: str) -> HTTPResponse:
return HTTPResponse(body=f"Hello, {name}!")
# JSON handling example
@app.post("/submit")
def submit(request: HTTPRequest) -> HTTPResponse:
data = json.loads(request.body)
return HTTPResponse(status_code=201)
# Run the server
if __name__ == "__main__":
app.start()
Development
- Clone the repository:
git clone https://github.com/yourusername/pydobby.git
cd pydobby
- Install in development mode:
pip install -e .
- Run the example:
python examples/basic_app.py
TODO
Improvements and features:
- Static File Serving
- CORS Support
- Cookie Handling
- Session Management
- File Upload
- SSL Support
License
MIT License
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
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 pydobby-0.1.2.tar.gz.
File metadata
- Download URL: pydobby-0.1.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da2cbab127666e4aaa1bb9dde7c76c85966d2f85f0d1e79f61a0e6a22c256088
|
|
| MD5 |
d146c3c97c13770ddbb7dda5239dc1c5
|
|
| BLAKE2b-256 |
503b2611c272def952fbe91e3b27e393309c366b20b20cf29a0ca21272889333
|
Provenance
The following attestation bundles were made for pydobby-0.1.2.tar.gz:
Publisher:
pipeline.yml on 0xZaki/pydobby
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydobby-0.1.2.tar.gz -
Subject digest:
da2cbab127666e4aaa1bb9dde7c76c85966d2f85f0d1e79f61a0e6a22c256088 - Sigstore transparency entry: 159411097
- Sigstore integration time:
-
Permalink:
0xZaki/pydobby@2e384cfd3376c390f4f38168c26747882e7664b8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/0xZaki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yml@2e384cfd3376c390f4f38168c26747882e7664b8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pydobby-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pydobby-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c893f51fbd826cd1a66b60435c98a1416bbeee2d95a04303bef1483ac01254ea
|
|
| MD5 |
a08af5bf7dd57167137c56cca704ae86
|
|
| BLAKE2b-256 |
4dcef994d00568969f792fe218715c3dfdda8b4179db4aa2c8230fab850c48c7
|
Provenance
The following attestation bundles were made for pydobby-0.1.2-py3-none-any.whl:
Publisher:
pipeline.yml on 0xZaki/pydobby
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydobby-0.1.2-py3-none-any.whl -
Subject digest:
c893f51fbd826cd1a66b60435c98a1416bbeee2d95a04303bef1483ac01254ea - Sigstore transparency entry: 159411104
- Sigstore integration time:
-
Permalink:
0xZaki/pydobby@2e384cfd3376c390f4f38168c26747882e7664b8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/0xZaki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yml@2e384cfd3376c390f4f38168c26747882e7664b8 -
Trigger Event:
release
-
Statement type: