https://github.com/yyyar/pyappi
Semi-declarative REST API library for Python
https://github.com/yyyar/pyappi
Last synced: 7 months ago
JSON representation
Semi-declarative REST API library for Python
- Host: GitHub
- URL: https://github.com/yyyar/pyappi
- Owner: yyyar
- License: other
- Created: 2013-10-11T23:55:12.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-17T10:42:48.000Z (almost 12 years ago)
- Last Synced: 2025-01-07T08:49:35.175Z (9 months ago)
- Language: Python
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PyAppi
======PyAppi - Semi-declarative REST APIs helpers library
Allows you declaratively define your API endpoint & parameters.
Supports:
- Request parameters validation
- Custom parameters checks
- Custom parameters conversions
- Different & custom response formatters
- Different & custom response serializers
- Bindings to popular python web frameworks (django, flask, etc.)Example:
```python
appi = Pyappi(adapter=django_adapter)@appi.wrap
@appi.params({
'name': {
'required': True,
'description': "User name",
'check': (lambda x: len(x)>4, 'should be longer 4 chars')
},
})
def say_hello(request, name, **kw):
return {
'message': "Hello, " + name,
}...
urlpatterns = patterns('', (r'', say_hello))
```