Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Yet another WSGI web framework

Project Description

Yet another WSGI Web Framework, the simplest and fastest ever written.

Has no dependencies. Works both with Python 2 and Python 3.

Features

  • Support both of functional and object-oriented programming styles
  • Dynamic routes, e.g. “/path/{param}/”
  • Headers, query, data, cookies descriptors
  • Rich extending abilities

Installation

Simply execute following line:

pip install marnadi

“Hello World”

Run this script and open http://localhost:8000 on your browser:

from marnadi.wsgi import App
from marnadi import Response

application = App()


@application.route('/')
@Response.provider
def hello():
    return "Hello World"

if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    make_server('', 8000, application).serve_forever()

More complex example

Script below will respond to http://localhost:8000/foo/bar/ and http://localhost:8000/foo/ requests:

import re
from marnadi.wsgi import App
from marnadi import Response, Route


class MyResponse(Response):

    # HTTP GET request handler
    def get(self, foo, bar=None):
        return 'foo is {foo}, bar is {bar}'.format(foo=foo, bar=bar)

routes=(
    Route('/{foo}'), (
        Route('/', MyResponse),
        Route('/{bar}/', MyResponse),
    )),
)

application = App(routes=routes)

if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    make_server('', 8000, application).serve_forever()
Release History

Release History

This version
History Node

0.2.3

History Node

0.2.2

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Marnadi-0.2.3.tar.gz (9.6 kB) Copy SHA256 Checksum SHA256 Source Mar 1, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting