Flask REST Framework

pip install flask-nap==0.0.1



A nap is a tiny rest. nap is a tiny REST framework for Flask + SQLAlchemy applications. Don't let its size fool you; nap has a lot of features that make it super easy to build APIs. nap allows for easy serialization & deserialization of SQLAlchemy models, integrates with wtforms to provide data validation, has support for filters and API Views that handle basic REST calls, all right out of the box! nap also features an intuitive design for working with model relationships, that way you don't need to think about it too hard.

Authentication and Permissioning support coming soon!

A full featured example application is currently under construction and can be found in the example directory.


pip install flask-nap


nap makes it super easy to serialize a model declared in SQLAlchemy:

from .models import Foo
from nap import ModelSerializer

class FooSerializer(ModelSerializer):
  model = Foo


That's it! Woohoo! 🍻

If you want to filter your model, simply pass in some kwargs, and voila:


Compound primary key? No problem, just pass in some more kwargs:


In fact, one of the motivations for building nap was for building apps whose models contain compound primary keys, in my case time-series data. Lots of other python web frameworks don't support compound keys (sorry Djangonauts!), but in napland time-series data will always be a first-class citizen.

Now is a good time for a word of caution: Beware! nap is super unstable right now, however, I do encourage you to use the bits and pieces of it you find helpful and keep an eye back here as things solidify. Another side-note: my cat just stepped on the keyboard, ruining large swathes of text, so I'll put 🐈 here to commemorate his hard work.


Working with Related Models

API Views



Authentication & Permissions