Skip to main content
Flask simple REST
=========================

A Flask extansion for simple ReSTful api generation

Install
-------

For install you can use pip:
```
pip install flask_simplerest
```

Usage
-------

app.py
```
from flask import Flask
from flask.ext.simplerest import SimpleRestApp
from handlers.myhandler import MyHandler

app = Flask(__name__)
rest = SimpleRestApp(app)

MyHandler(rest, 'prefix_if_needed')

@rest('/index', 'PUT')
def some_put_method():
pass

app.run()
```

handlers/myhandler.py
```
from flask.ext.simplerest import SimpleRestResource, rest
from flask.ext.simplerest import fields

class Projects(SimpleRestResource):
@rest('/', 'POST')
def test(self, name=fields.String):
return {'name':name}

@rest('/<int:my_id>/123', 'POST')
def test2(self, my_id, name=fields.String(default='Costos')):
return dict(my_id=my_id, name=name)

```

Bash
(first you must run application)
```
curl http://127.0.0.1:5000/ -d name=Murza
{
'name': 'Murza'
}
```

Metadata

Release files for flask_simplerest 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask_simplerest 1.0.3
File Size Uploaded
flask_simplerest-1.0.3.tar.gz 3.2 kB Details

Release files / flask_simplerest-1.0.3.tar.gz

Download URL flask_simplerest-1.0.3.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7544385b9c7eead32e043ea8773f9ae1f80b09799d516002ad54da0c16271d3b
BLAKE2b-256 checksum
How to use checksums
e099ad6b27458b3b86fb5cf7e22b1b8383e804185bc34c4f311737e9ce8f229e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page