Bring Your Code to the Web with Ease using a Lightweight WSGI Application.
Project description
pyWSGIapp
pywsgiapp is a lightweight WSGI application framework aimed at simplifying the development of WSGI-based web applications. It offers an intuitive interface for managing HTTP requests and responses, enabling easy creation and deployment of web applications.
Features
- Lightweight and easy-to-use WSGI framework.
- Customizable request handler for processing HTTP requests.
- Compatible with WSGI servers like
gunicorn.
Installation
To install the package, use the following command:
pip install pywsgiapp
Usage
Example: Basic WSGI Application
Here’s an example of how to use pywsgiapp to create a simple WSGI application:
from pywsgiapp.WSGIApp import createWSGIApp
# Define a request handler function
def requestHandler(url: str, requestHeaders: dict, postData: dict) -> dict:
response_body = f"Received URL: {url}, Headers: {requestHeaders}, Post Data: {postData}"
return {
"responseCode": 200,
"responseHeaders": {"Content-Type": "text/plain"},
"responseBody": response_body
}
# Create the WSGI application
app = createWSGIApp(requestHandler)
Save this code in a file (e.g., basic.py) and run it with a WSGI server like gunicorn:
gunicorn basic:app
For more examples, see the Examples Documentation.
pywsgiapp/: The main package containing the framework code.examples/: Example scripts demonstrating how to use the framework.setup.py: Metadata and installation configuration.requirements.txt: List of dependencies for development and deployment.
Development
If you want to contribute or modify the framework, follow these steps:
-
Clone the repository:
git clone https://github.com/jaythorat/pywsgiapp.git cd pywsgiapp
-
Install the package in editable mode:
pip install -e .
Dependencies
The framework requires the following dependencies:
gunicorn>=20.1.0
Install them using:
pip install -r requirements.txt
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! If you’d like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push the branch.
- Open a pull request.
Contact
For any questions or issues, feel free to contact the author:
- Author: Jay Thorat
- Email: dev.jaythorat@gmail.com
- GitHub: jaythorat
- Portfolio: portfolio.jaythorat.in
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
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 pywsgiapp-0.0.7.tar.gz.
File metadata
- Download URL: pywsgiapp-0.0.7.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0f61435184d5f0b821f68d2a12963fb54038a8192db009f428b8bff5e2ee5e4
|
|
| MD5 |
da2612aa5c20dc034ffd5c315510a307
|
|
| BLAKE2b-256 |
5de298627022bffefd5136b9d7124f2b3868017d0e98c2073e531cd3a86958d4
|
File details
Details for the file pywsgiapp-0.0.7-py3-none-any.whl.
File metadata
- Download URL: pywsgiapp-0.0.7-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5a13e9a50e2a0f659045a8a58f54f493a4f7d19d3e43f9843a6a094bc8efb92
|
|
| MD5 |
3531ce442a54d9ed9e2ef8a50db1326c
|
|
| BLAKE2b-256 |
18661bb51a1c37b2c494f399efb39c1f0c3cdcd4e45f7d9f1ad13f0e6bd1b5e4
|