Skip to content

yws/weppy

 
 

Repository files navigation

logo

pip version build status

weppy is a full-stack python web framework designed with simplicity in mind.

The aim of weppy is to be clearly understandable, easy to be learned and to be used, so you can focus completely on your product's features:

from weppy import App, request, response
from weppy.orm import Database, Model, Field
from weppy.tools import service, requires

class Task(Model):
    name = Field('string')
    is_completed = Field('bool', default=False)

app = App(__name__)
app.config.db.uri = "postgres://user:password@localhost/foo"
db = Database(app)
db.define_models(Task)
app.pipeline = [db.pipe]

def is_authenticated():
    return request.headers["Api-Key"] == "foobar"
    
def not_authorized():
    response.status = 401
    return {'error': 'not authorized'}

@app.route(methods='get')
@service.json
@requires(is_authenticated, otherwise=not_authorized)
def todo():
    page = request.query_params.page or 1
    tasks = Task.where(
        lambda t: t.is_completed == False
    ).select(paginate=(page, 20))
    return {'tasks': tasks}

Installation

You can install weppy using pip:

$ pip install weppy

Documentation

The documentation is available at http://weppy.org/docs. The sources are available under the docs folder.

Examples

The "bloggy" example described in the Tutorial is available under the examples folder. While we're still populating this folder with more examples, you can also take a look at H-Funding, which uses many of weppy's features.

Starter kit

Aside from the examples, we encourage you to look at the starter kit and the convenient scaffold generator written by MJ Davis. These projects can really help you writing your next weppy application.

Benchmarks

weppy was one of several Python 3 frameworks included in some benchmarks published by Kirill Klenov.

This is an extract from the results for a simple JSON serialization:

framework req/s ms/req performance
weppy 0.5.1 10853 18.46 2.5x
flask 0.10.1 6831 29.38 1.6x
django 1.8.6 4330 46.61 1x

Status of the project

Since version 1.0 weppy can be considered stable. Is compatible with Python 2.7, 3.3, 3.4, 3.5 and 3.6.

weppy is currently used in production by:

How can I help?

We would be very glad if you contributed to the project in one or all of these ways:

  • Talking about weppy with friends and on the web
  • Participating in weppy users group
  • Adding issues and features requests here on GitHub
  • Participating in discussions about new features and issues here on GitHub
  • Improving the documentation
  • Forking the project and writing beautiful code

License

weppy is released under the BSD License.

However, due to original license limitations, some components are included in weppy under their original licenses. Please check the LICENSE file for more details.

About

The web framework for humans

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.0%
  • CSS 1.1%
  • Other 0.9%