Skip to main content

A pythonic interface to web.py

Project description

cup: a pythonic wrapper around web.py framework
=====

## A complete `cup` application

```python
def hello(web):
return 'Hello, World!'

urls = ('/', hello)

import cup
app = cup.application(urls)
app.run()
```

## `web.py` like application

```python
class Hello:

def GET(self, name):
if not name:
name = 'World'
return 'Hello, ' + name + '!'

urls = ('/(.*)', Hello)

import cup
app = cup.application(urls)
app.run()
```

## `bottle` or `flask` like routed application

```python
import cup

route = cup.Route()

@route.GET('/(.*)')
def hello(ctx, name):
if not name:
name = 'World'
return 'Hello, ' + name + '!'

app = cup.application(route.urls)
app.run()
```

## `web.py` with router
```python
import cup

route = cup.Route()

@route('/(.*)')
class Hello:

def GET(self, name):
if not name:
name = 'World'
return 'Hello, ' + name + '!'

app = cup.application(route.urls)
app.run()
```

Project details


Release history Release notifications

This version
History Node

0.2.0

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page