Meager
Meager is a tiny web framework built on the socketserver module in Python.
Installation
Meager is available on PyPI.
You can install meager using pip: pip install meager
Examples
This is the simplest way of using meager, returning html upon a request to "/".
The module is heavily inspired by flask, and it's ease of use, and readability.
Example returning html
import meager
app = meager.Server(host="0.0.0.0", port=8080) # Set binding ip address and port, default is localhost:2090
@app.router.route("/")
def index(request):
return "<h1>Hello world!</h1>"
app.serve()
Example returning JSON
import meager
app = meager.Server()
example_dict = {"key1": "val1", "key2": "val2"}
@app.router.route("/")
def index(request):
return example_dict # It can detect if you're sending a dictionary
# and automatically changes the "Content-Type:" header to application/json
app.serve()
Dynamic GET example
import meager
app = meager.Server()
@app.router.route(request, "/api/<name>")
def api(name):
return {"status": "success", "name": name}
app.serve()
Metadata
Release files for meager 0.3.5
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 |
|---|---|---|---|---|
| meager-0.3.5.tar.gz | 3.9 kB | Without provenance | Details for meager-0.3.5.tar.gz |
Release files / meager-0.3.5.tar.gz
| Download URL | meager-0.3.5.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d03729270841919b50eee12a40a45ee3e9309f6e683dbfc77de0e2ed5253a84
|
|
BLAKE2b-256 checksum How to use checksums |
8f210e1bf9c50dc0ee4100c6760ae85cf67e26e4b757df693f93dfc4daa84903
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.1
|
Security for meager 0.3.5
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.