Skip to main content

A really lightweight and simple API server, built on the socketserver module

Project description


Meager is a tiny web framework built on the socketserver module in Python.

Codacy Badge Build Status Python Versions


Meager is available on PyPI.

You can install meager using pip: pip install meager


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="", port=8080) # Set binding ip address and port, default is localhost:2090

def index(request):
    return "<h1>Hello world!</h1>"

Example returning JSON

import meager
app = meager.Server()
example_dict = {"key1": "val1", "key2": "val2"}

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 

Dynamic GET example

import meager
app = meager.Server()

@app.router.route(request, "/api/<name>")
def api(name):
    return {"status": "success", "name": name}


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for meager, version 0.3.5
Filename, size File type Python version Upload date Hashes
Filename, size meager-0.3.5.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page