Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

This is a lightweight microframework for building restful APIs

Project description


This is a lightweight microframework for building restful APIs
from krull.handlers import endpoint
from krull.server import run_server

@endpoint(path='/users/<int:id>', method='GET')
def getusers(req, res):
user_id = req.path_params["id"] = {"message": "Hello world, number {}!".format(user_id)}
res.status = 200
return res

@endpoint(path='/users/<str:username>', method='GET')
def getuserbyusername(req, res):
username = req.path_params["username"] = {"message": "Hello world, and hey {}!".format(username)}
res.status = 200
return res

@endpoint(path='/users', method='POST')
def postusers(req, res):
# do something with data = {"message": "success!"}
res.status = 201
return res

if __name__ == '__main__':

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 krull, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size krull-0.0.6.tar.gz (1.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page