Web APIs for Flask, made easy, inspired from Django DRF.
Project description
# Django Rest Framework analog for Flask+Mongoengine
[![Build Status](https://travis-ci.org/sallyruthstruik/flask_restframework.svg?branch=master)](https://travis-ci.org/sallyruthstruik/flask_restframework)
[![codecov](https://codecov.io/gh/sallyruthstruik/flask_restframework/branch/master/graph/badge.svg)](https://codecov.io/gh/sallyruthstruik/flask_restframework)
Minimalistic and usage-easy RESTful framework for Flask. Like Django Rest Framework for Flask
This project allows you to write serializers/model serializers and REST resources easily.
This project interface was inspired by Django-rest-framework (https://github.com/tomchristie/django-rest-framework)
## Installation
For installation run:
`pip install flask_restframework`
Example of usage you can see here: https://github.com/sallyruthstruik/angular2_logviewer/tree/master/server
Simple example:
```python
api = Blueprint("api", __name__)
router = DefaultRouter(api)
class LogsSerializer(ModelSerializer):
class Meta:
model = Logs
class LogsResource(DistinctValuesMixin,
ModelResource):
serializer_class = LogsSerializer
queryset = Logs.objects.all()
distinct_fields = ["request_id", "level", "host", "logger_name"]
update_json_filter = update_json_filter #allows to filter with ?json_filters={...}
ordering = ("-@timestamp", ) #default ordering
```
[![Build Status](https://travis-ci.org/sallyruthstruik/flask_restframework.svg?branch=master)](https://travis-ci.org/sallyruthstruik/flask_restframework)
[![codecov](https://codecov.io/gh/sallyruthstruik/flask_restframework/branch/master/graph/badge.svg)](https://codecov.io/gh/sallyruthstruik/flask_restframework)
Minimalistic and usage-easy RESTful framework for Flask. Like Django Rest Framework for Flask
This project allows you to write serializers/model serializers and REST resources easily.
This project interface was inspired by Django-rest-framework (https://github.com/tomchristie/django-rest-framework)
## Installation
For installation run:
`pip install flask_restframework`
Example of usage you can see here: https://github.com/sallyruthstruik/angular2_logviewer/tree/master/server
Simple example:
```python
api = Blueprint("api", __name__)
router = DefaultRouter(api)
class LogsSerializer(ModelSerializer):
class Meta:
model = Logs
class LogsResource(DistinctValuesMixin,
ModelResource):
serializer_class = LogsSerializer
queryset = Logs.objects.all()
distinct_fields = ["request_id", "level", "host", "logger_name"]
update_json_filter = update_json_filter #allows to filter with ?json_filters={...}
ordering = ("-@timestamp", ) #default ordering
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flask_restframework-0.0.8.tar.gz
(53.4 kB
view hashes)
Close
Hashes for flask_restframework-0.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d2036b32cfe6f78026f1e477a324c60efb75a96a50b2ea1518083873480da44 |
|
MD5 | 9f43cabcae378ed79f215bca2476636b |
|
BLAKE2b-256 | f5b6bee84c00fe5c004c80afa07cd23cf9e939beb49dd8eb8f56270f9330c382 |