httpackage: Python HTTP Server Module
Overview
httpackage is a Python module that provides a simple HTTP server implementation. It allows you to define routes and corresponding handler functions, making it easy to create basic web applications or APIs. The module is distributed under the Apache License 2.0, giving you the freedom to use, modify, and distribute the code.
License
httpackage is licensed under the Apache License 2.0. You can find a copy of the license in the LICENSE file.
Installation
httpackage does not require any special installation steps. Simply run pip install httpackage in your python terminal and start using it.
Usage
The module provides the server class, which you can use to create an HTTP server. Below is an example of how to use the server class:
from httpackage import server
# Create an instance of the server
app = server()
# Define routes using the `site` decorator
@app.site('/')
def home():
return 'Hello, world!'
@app.site('/about')
def about():
return 'This is the about page.'
# Run the server
if __name__ == '__main__':
app.run(host='localhost', port=8080)
In the above example, we create a simple web application with two routes ('/' and '/about'). The home and about functions are the handlers for each route, which return the respective response.
API
class server
__init__(self)
Create an instance of the HTTP server.
site(self, path)
A decorator function used to define routes and their corresponding handler functions.
path: The URL path for the route.
serve(self, environ, start_response)
A method to handle incoming HTTP requests.
environ: The WSGI environment dictionary containing request details.start_response: A callback function to begin the HTTP response.
run(self, host='localhost', port=8080)
Start the HTTP server and begin serving requests.
host: The hostname or IP address on which the server will listen.port: The port number on which the server will listen.
Support
For any questions or concerns, please contact support@example.com.
Metadata
Release files for httpackage 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| httpackage-1.0.1.tar.gz | 3.4 kB | Without provenance | Details for httpackage-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| httpackage-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for httpackage-1.0.1-py3-none-any.whl |
Total release size: 7.4 kB
Release files / httpackage-1.0.1.tar.gz
| Download URL | httpackage-1.0.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d66e678b1aa9f567b65ab084ec047629e6b29106235677288e1f7519e99eeaf
|
|
BLAKE2b-256 checksum How to use checksums |
9b3d400266aa17f63348a34d24bd399473f31425fad6f64d9fb5efe744b4ea0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / httpackage-1.0.1-py3-none-any.whl
| Download URL | httpackage-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa74c04ef870b59c5d66bbd229a07674e622cde92d7cb14464dd10b3071675fe
|
|
BLAKE2b-256 checksum How to use checksums |
bbfbf832b033df1dd601b16c70cfd138f7a002afeca070a9874f2f8ef26bde0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for httpackage 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.